I don't understand what actual concrete benefit there is to using .mjs on client-side JavaScript modules. It seems to only cause problems with tools that .js completely avoids. What's the specific upside?
-
-
Replying to @justinfagnani
Python mime type server now recognizes mjs Moving forward through ietf process. Primary value imho is an easy to identify out of band mechanism that is cross platform.
1 reply 0 retweets 8 likes -
Replying to @MylesBorins
What's the real concrete benefit today though? Is there something that works now if you use .mjs vs .js? Seems like there's only downsides right now.
3 replies 0 retweets 7 likes -
Replying to @justinfagnani
Write a module that "just works" in browser and node (assuming compatible tool chain for dev server) Visual identifier in source tree that file is module without looking at source
1 reply 0 retweets 3 likes -
Replying to @MylesBorins
For client-side modules, the first point doesn't matter. Plus Node doesn't yet support even .mjs modules, right? For the second point *all* my JS is modules. I bet this is true of a huge number of projects already, and files only become non-modules when run through a bundler.
1 reply 0 retweets 8 likes -
Replying to @justinfagnani
Shruggie You do you. I want node as a platform to have mechanisms that allow people to write code the way they want to I think mjs has value, but don't want you to be forced to use it if you don't want to. Don't think these things need be mutually exclusive
3 replies 0 retweets 7 likes -
Replying to @MylesBorins
Sure, I usually do :) But I'm not talking about Node, just the browser. I see people using .mjs today, then hitting problems. .js just avoids all the problems.
3 replies 0 retweets 6 likes -
Replying to @justinfagnani @MylesBorins
what are the problems w using it in browser? (we do today without issue but I'm certain I've missed something)
1 reply 0 retweets 1 like -
Replying to @brianleroux @MylesBorins
Many tools trip up on .mjs. It's like whack-a-mole trying to fix them all.
3 replies 0 retweets 1 like
I’d love to hear more about what’s broken, so I can help get these issues fixed.
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.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.