top | item 45552307

(no title)

pyramation | 4 months ago

ES modules are cancer. I'm fine w the syntax — in fact, I love the syntax.

But if you use "module: true" in your package.json, you are splitting the npm ecosystem into two groups, and it's not moving us forward.

discuss

order

pyramation|4 months ago

and fwiw, my opinion comes from attempting to upgrade packages that I've depended on that all of a sudden add the module: true, which essentially requires that ALL packages must upgrade — which is 99% of the time not possible because all the other deps are usually CJS.

this is also similar to the non-incremental way TS rolled out in the early days, also causing knee-jerk reactions to TypeScript. However over time, devs found ways to incrementally type JS to TS, and so we've all mostly evolved by now.

If ESM could do similar, allowing for incremental evolution, then it would solve all of the problems. I don't see why cjs and esm cannot co-exist