V6 Roadmap: ESM Only distribution #2455
timofei-iatsenko
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The JavaScript ecosystem keeps moving forward, and more and more projects are switching to ESM-only distribution.
I’ve tried to make this change a few times already, but each time I was blocked by various incompatibilities. LinguiJS is a complex project consisting of multiple parts — runtime, CLI, and plugins for different tools.
Switching to ESM-only requires ensuring interoperability across all these tools. The main roadblock was usually supporting ESM in the
babel-plugin-macros. I even contributed to Babel itself babel/babel#16860 to make this possible in the future.However, the
babel-plugin-macroscodebase is quite outdated, and before working on the original issue, a lot of maintenance work was needed just to bring everything up to date. Because of that, I had to postpone this task for a long time.Fortunately, the ecosystem has evolved, and with recent Node.js improvements — such as
require(esm)backported to Node.js 20 — this workaround is no longer necessary. That means we can now distribute LinguiJS as pure ESM.I expect no major changes will be required from users unless they rely on very specific or non-standard setups. Still, since this is a significant shift, it should be released as a new major version, similar to what Storybook 10 did.
I don’t plan to include any other major changes in this release — this breaking change will be big enough on its own.
Testing checklist:
babel-plugin-macrosmetroBump minimal nodejs version requirement to 20.16+, 22.19+, or 24+
Blockers:
Another fixes to be included in the V6 release
To do List:
strict: true&"strictNullChecks": false,for most of packages (cli + core + react) refactor!: strictNullChecks for cli lib packages #2412jest-mockspackage intotest-utilschore: rename jest-mocks to test-utils, vitest@4, prettier@3 #2413@linguipeerDependenciespo-gettextpackage.Bump previously blocked by ESM deps (nice to have, but not blocker)
Remove deprecations:
LinguiConfig.format: string&&formatOptions?: CatalogFormatOptionsfeat!: remove deprecated format as string and formatOptions #2419@lingui/macropackage chore: remove deprecated @lingui/macro package #2422Post-release
Beta Was this translation helpful? Give feedback.
All reactions