Skip to content

refactor(common): Switch TypeScript module to node16 #14976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Borewit
Copy link
Contributor

@Borewit Borewit commented Apr 16, 2025

Switch Node.js compiler option module from commonjs to node16, to preserve dynamic import. With commonjs these are converted to require. This allows to deprecate the load-esm dependency, introduced in 1e43fcb.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Uses load-esm to be able to load ESM module file-type.

Improvement of #14974.

What is the new behavior?

Switches to a more modern version of CommonJS in the TypeScript compiler, which allow dynamic import, which no longer requires load-esm.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@Borewit Borewit force-pushed the enable-ts-dynamic-import branch 3 times, most recently from 1a88ce2 to 7eed6f0 Compare April 16, 2025 18:49
@kamilmysliwiec
Copy link
Member

image

image

@Borewit Borewit force-pushed the enable-ts-dynamic-import branch 6 times, most recently from 83b01ee to 8f1537b Compare April 17, 2025 19:05
@Borewit Borewit marked this pull request as draft April 18, 2025 13:22
@Borewit Borewit force-pushed the enable-ts-dynamic-import branch 5 times, most recently from b429908 to a8ca949 Compare April 18, 2025 14:04
fix(deps): update dependency fastify to v5.3.1
@Borewit Borewit force-pushed the enable-ts-dynamic-import branch from a8ca949 to 159dfa5 Compare April 18, 2025 14:15
@Borewit
Copy link
Contributor Author

Borewit commented Apr 18, 2025

@kamilmysliwiec you mind have look at remaining failing unit tests?

The FileTypeValidator does not seem to recognize any file running in CircleCI.
If I run npm run test:cov local, all tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants