The reason node wants .mjs is not a new problem about diff semantics and the meaning of .js. It's about solving a problem Node has.
-
-
Replying to @wycats @bradleymeck
Is there a 0.1% chance that we could solve the plain js vs modules problem without a special extension and without perf penalties?
2 replies 0 retweets 0 likes -
If the grammars didnt collide, probably but this was talked about in Janhttps://github.com/tc39/tc39-notes/blob/master/es7/2017-01/jan-25.md#13iia-proposed-grammar-change-to-es-modules …
1 reply 1 retweet 3 likes -
Replying to @bradleymeck @satya164
Rejecting package.json + "use modules" for standalone files isn't on technical grounds. But that's where we're at.
3 replies 0 retweets 0 likes -
What's the actual reason people don't like .mjs? It seems like a really easy solution to a complicated problem!
2 replies 0 retweets 1 like -
Because there are tons of different things that .js means already *including ES modules* and a new extension is unneeded and not free.
2 replies 1 retweet 6 likes -
If you're using TypeScript does this matter at all? You're still tranpiling. It's a config flag. Is there a greater cost than just renaming?
3 replies 0 retweets 0 likes -
The reason to avoid .mjs is the same reason node itself chose .js initially despite CJS modules != script.
3 replies 1 retweet 1 like -
.js is widespread and already has broad meaning. .mjs is an unnecessary version marker. Again, .js already means script *and* CJS
2 replies 0 retweets 0 likes -
The more I talk about this the more I love .mjs. Also people will hate "use module" plenty too. Actual cost for Dx with mjs is TINY
1 reply 0 retweets 0 likes
You won't need that in any new ESM project. Just transitional.
-
-
I wrote down the list of concerns I have with .mjs in Defense of JS. doubt I'll beat that on Twitter.
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.