Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop supporting CommonJS builds #439

Closed
nazarhussain opened this issue Jan 16, 2025 · 0 comments · Fixed by #440
Closed

Stop supporting CommonJS builds #439

nazarhussain opened this issue Jan 16, 2025 · 0 comments · Fixed by #440

Comments

@nazarhussain
Copy link
Contributor

nazarhussain commented Jan 16, 2025

Is your feature request related to a problem? Please describe.

With growing support of ESM in all tooling now maintaining CJS builds seems not necessary anymore.

Describe the solution you'd like

We can simply remove the support for CJS builds and it will cleanup the lib/cjs directory.

  • Need to remove package.json scripts
  • Bump the version to breaking change
  • Update the main fields for the package.json

Additional context

Dropping CommonJS (CJS) support in favor of ECMAScript Modules (ESM) offers several advantages:

  1. Modern Standard: ESM is the official JavaScript module standard, ensuring better future compatibility and native support in Node.js and browsers.
  2. Improved Performance: ESM allows for static analysis, tree-shaking, and better optimization during bundling, resulting in smaller and faster builds.
  3. Simplified Codebase: Maintaining only ESM reduces build complexity, configuration overhead, and maintenance effort.
  4. Better Interoperability: ESM integrates smoothly with modern tooling, packages, and web platforms, improving developer experience and ecosystem alignment.
  5. Future-Proofing: The JavaScript ecosystem is moving toward ESM, and deprecating CJS ensures alignment with evolving best practices.
@nazarhussain nazarhussain changed the title Remove the CJS support Stop supporting CommonJS builds Jan 16, 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 a pull request may close this issue.

1 participant