5 ms·
I've been following ES module standardization for a while now. From the early days I was not convinced that we need a new syntax. We could adopt require/module
by msoad 3y ago
I've been following ES module standardization for a while now. From the early days I was not convinced that we need a new syntax. We could adopt require/module as language features without breaking the entire ecosystem. It was just not "impactful" and "sexy" enough to do so.
Since then I'm yet to see ES modules solve real problems that CommonJS couldn't as the OP argues.
- Timon3 3y agoAsync exports are the obvious answer. You might not think that they are useful, but they are a giant difference.
- kesor 3y agoWe could just as well have async requires in addition to the regular requires.
- kesor 3y agoThe "break the whole ecosystem" bit is what bugs me the most. It is nearly impossible now to write a short script in Node.js these days when you have mixed dependencies of ESM & CommonJS. Every 100 line script now forces you to include a code bundler of some sort, just because the two will not work in the same script.