feat: prepare for full ESM, replace babel-mocha env with typescript-mocha env #10009
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Optimize ESM transition by converting static imports to dynamic imports for packages that contribute significantly to bootstrap file loading.
Background
With the removal of lazy-loading in the babel -> typescript env transition, the bootstrap file count increased from ~1042 to ~2400+ files. This PR aims to reduce that count by identifying packages that:
Approach
Convert static imports to
await import()calls for selected packages, focusing on the best effort-to-impact ratio.Progress
any)🚧 This is a draft PR for incremental development