-
Notifications
You must be signed in to change notification settings - Fork 205
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
Switch to ESM breaks 3rd party libraries #103
Comments
That's why it was a major version bump. Because it has breaking behavior. |
I can relate to the frustration surrounding ESM and am open to hear this argument out, though I have to admit that so far I cannot quite follow the reasoning in the OP. |
i agree its exactly how semver is supposed to work - major version bump for breaking change for browsers, esm is definitely the way to go - no doubt however, i dont see a benefit of how to consume
perhaps if what i do for my library is package both
also, rules are slightly different when library has small number of users vs +1m like this one has |
One challenge I am seeing btw. is where the CommonJS module just exports a single class, here const Long = require("long"); with an upgrade path of import Long from "long"; which isn't exactly compatible, also when it comes to typings. What's the typical attack angle there? For instance, for the former, typings are |
yes, its a challenge, but:
|
I might me overlooking something, but it seems that if the package is ESM first, then having a CJS re-export is off the table due to the lack of top-level await. Or is there a way? For reference, here is what I have so far. |
There is an UMD fallback now. Let me know if there are any issues :) |
Thanks! I agree the Node.js 12 support (EOL May 2022) is the compelling reason to add this; that's how I cam across this. |
Given the fact that
long.js
is used by 1m+, hard switch toESM
is ... well ... weirdYes, those projects can pin version to 4.0, but that means that overall package updates (e.g.
npm update --depth 1
) to fix security vulnerabilities in less maintained projects breaks everything (which i've just experienced)And asking 1m+ users to update their code is not realistic
Btw, official NodeJS roadmap places Stability as top-most priority:
The text was updated successfully, but these errors were encountered: