Post

I get the desire for ESM for things like tree shaking (though I'd like to see some numbers on impact here). I get the nicer syntax. But, unbundled ESM takes about 2x as long as CJS to load in my tests (can show if desired). If your users aren't bundling ESM opts them in to big a load-time perf hit.

0 reposts7 likes

CommonJS is fine, its not gonna go anywhere but its legacy. The effort needs to go into making esm better and working with APM. The answer is not "use commonjs", but work on the spec

100% agreed on all counts, but with the nuance of: Library authors who care about their users' cold-start times on unbundled apps should continue to ship CJS until ESM load performance is improved, and that's not as niche a use case as it may sound to some folks.

Interesting, I didn’t know this. Perhaps I should move to using it for unbundled Node.js app, and with Node supporting require am, this should be good to work with

Thanks for sharing this great article. The first time I read it, I came to the same conclusion I came just right now: we treat ESM like a novelty, but more time has passed since its introduction than the one passed from CJS to ESM introduction. As a community, we are just exiting the py2->py3 loop