Skip to content

Conversation

@davidfirst
Copy link
Member

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:

  • Have high file counts during bootstrap
  • Are used in concentrated locations (easy to convert)
  • Don't break type safety

Approach

Convert static imports to await import() calls for selected packages, focusing on the best effort-to-impact ratio.

Progress

  • Analyze package usage and identify candidates
  • Convert imports step by step, one package at a time
  • Maintain proper TypeScript types (avoid any)
  • Ensure functionality remains intact
  • Measure file count reduction after each package

🚧 This is a draft PR for incremental development

@davidfirst davidfirst changed the title feat: convert static imports to dynamic imports to reduce bootstrap file count feat: prepare for full ESM, replace babel-mocha env with typescript-mocha env Oct 9, 2025
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