Remix.run Logo
Tade0 5 days ago

> (although do you still need to use the .mjs hack?)

Syntax detection is enabled by default in v22.7.0, v20.19.0:

https://nodejs.org/api/packages.html#syntax-detection

Sounds like the obvious correct solution, making .cjs and .mjs obsolete - unless of course someone uses import() statements exclusively, in which case I need to ask: why?

hiimshort 5 days ago | parent | next [-]

It is surprising for me to see these features finally being added to Node after such a long time. Especially so when I remember reading discussion after discussion about how something like this wasn't possible. I touched on this in a blog post some time ago [1]. Glad Node is catching up.

[1] https://kilo.bytesize.xyz/an-incorrect-specification

Tade0 4 days ago | parent [-]

I don't see in your blogpost any sources cited regarding anyone saying that ES modules were infeasible.

Additionally, io.js actually forked off due to internal drama which started with Ben Noordhuis having changed some pronouns here and there and people wanting to cancel him for that, to which he picked up his toys and left the sandbox.

It so happened that aside from being competent himself, he had competent people on his side, which eventually forced those governing Node.js to concede.

Bun is just a cash grab in comparison.

madeofpalk 5 days ago | parent | prev [-]

And for a few earlier versions `type: module` in package.json was all that was needed for .js files to be treated as ESM.