I will use this issue as an Epic for ongoing work for modernizing Lingui codebase.
The goals of this Epic are:
Migrate to ES Modules
Migrate to Vite from Jest
Update libraries which update was blocked by es modules.
Setup dependabot
Migrate to ES Modules
This is a challenging task because we are supporting babel macro plugin which is not supporting ES modules yet, and this blocks all used in this plugin dependencies to be migrated to ESM. (CJS modules could be imported from ESM modules, but ESM modules could not be imported from CJS synchronously). I started working on ground changes in the babel to support ESM in the babel-plugin-macros
This would be a major update with a breaking changes, because everyone who uses lingui internals from CJS context will not be able to do so after switching to ESM.
While we would be waiting for broader adoption of these changes in the babel & babel-plugin macros, I'm going to use jiti to provide CJS shim for ESM macro.
Subtasks:
Deprecate / remove pieces of code which could not be directly translated to ESM. Here
Convert every package to type: module
Drop CJS entries in packages
Implement CJS shim for macro with jiti
Migrate to Vite from Jest
Vite starts up much faster, needs less setup, and works well with ESM right away. While Jest has been popular for a long time, its many users make it hard to change things fundamentally without breaking existing setups. This has slowed down progress and made it tough to improve quickly.
I will use this issue as an Epic for ongoing work for modernizing Lingui codebase.
The goals of this Epic are:
Migrate to ES Modules
This is a challenging task because we are supporting babel macro plugin which is not supporting ES modules yet, and this blocks all used in this plugin dependencies to be migrated to ESM. (CJS modules could be imported from ESM modules, but ESM modules could not be imported from CJS synchronously). I started working on ground changes in the babel to support ESM in the babel-plugin-macros
This would be a major update with a breaking changes, because everyone who uses lingui internals from CJS context will not be able to do so after switching to ESM.
While we would be waiting for broader adoption of these changes in the babel & babel-plugin macros, I'm going to use
jiti
to provide CJS shim for ESM macro.Subtasks:
type: module
Migrate to Vite from Jest
Vite starts up much faster, needs less setup, and works well with ESM right away. While Jest has been popular for a long time, its many users make it hard to change things fundamentally without breaking existing setups. This has slowed down progress and made it tough to improve quickly.