-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Get rid of CommonJS module format, use only ES Modules. #2102
Comments
This change requires bumping the major version. I strongly suggest we stop "saving a bunch of stuff" for a 5.0 release. We should organically perform the changes we need to perform to keep the project modern, and if that means we release this and it is the only reason to bump to version 5.0, then we release other breaking changes later to bump to 6.0, 7.0, etc, later, that would be totally fine. We don't have the manpower and resources to coordinate a huge single breaking release, and IMO that has been holding us back. Also, without making too many breaking changes at once, it will be easier for people to follow a migration path over time. |
I will re-place the original PR that I'd started at #1689 with a new one that maintains backwards compat. |
PR: #2106 |
Feature request
The future is already here, and it is ES Modules. We currently build SSR to CommonJS, for example. CommonJS is outdated now, and we should move onto ES Modules and simplify our setup for all possible tooling that now understand the ES Module standard.
What problem does this feature solve?
We have legacy complexity. Move to modern standard.
What does the proposed API look like?
Remove any CommonJS (CJS) outputs, ensure everything is ES Modules (ESM).
Note, .eslintrc.cjs remains as CommonJS because current ESLint v8 doesn't support ESM in eslintrc. ESLint 9 will require the new "flat config" format, which will require ESM.
How should this be implemented in your opinion?
F.e. open rollup configs, don't output to cjs, output to esm.
Are you willing to work on this yourself?
Yes (PR #2106)
Is this a breaking change?
Yes, this update can possibly break any dev's tooling relying on old CJS. This will not break people who import Docsify with script tag, only people who build Docsify source code. We should provide a clear path in the release notes.
The text was updated successfully, but these errors were encountered: