Skip to content

refactor: migrate to ES module syntax#5665

Draft
bjohansebas wants to merge 1 commit intonextfrom
migrate-to-esm
Draft

refactor: migrate to ES module syntax#5665
bjohansebas wants to merge 1 commit intonextfrom
migrate-to-esm

Conversation

@bjohansebas
Copy link
Copy Markdown
Member

Summary

What kind of change does this PR introduce?

Did you add tests for your changes?

Does this PR introduce a breaking change?

If relevant, what needs to be documented once your changes are merged or what have you already documented?

Use of AI

@bjohansebas bjohansebas marked this pull request as draft April 26, 2026 18:11
@bjohansebas
Copy link
Copy Markdown
Member Author

For this, we’ll first need to migrate to Node.js’s test runner so everything works properly and we avoid weird issues, since Jest only has experimental support for it (in a separate PR to make it easier to review). Then we can proceed with this one by migrating to ESM, so it stays focused on that change. After that, we continue with the http-proxy-middleware PR, which will allow us to update that dependency and complete the migration to ESM-only.

Comment thread eslint.config.mjs
// ES2025 needed for import attributes (`import(x, { with: ... })`).
// eslint-config-webpack pins ecmaVersion to 2024 for Node 22.
ecmaVersion: "latest",
},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work without this, because we automatically takes ecmaVersion from node in package.json

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see https://github.com/webpack/eslint-config-webpack/blob/32eaa6f7518e0fd64f305e055354320ad3d1ec2e/configs.js#L73 and the problem is that estree treats that functionality mentioned in the comment as part of ES2025, but for Node 22, we have it available

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, I think we need to fix it in our shared config, but let's do it separately, not here

@alexander-akait
Copy link
Copy Markdown
Member

Also feel free to use experimental support of ecma modules in jest, it should work, to avoid unnecessary work right now, we will migrate to nodejs test runner later, will be great to make a release soon

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