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?
It’s not just about ambiguous files that are run from the command line, though. Recommended reading:https://medium.com/@bradleymeck/understanding-the-hard-choice-1ea3008fc9d0 …
-
-
Read it before. Thanks for linking. use-strict is false equivalence. That flag changed meaning of every file. Smallest incr. change could’ve been: 1. Entry point gets parsed as script, fallback to module. (module cache would amortize cost) 2. import = module 3. require = node
-
Step 1 means potentially having to re-parse, which seems bad. Regardless of what Node.js decided way back then, every single piece of tooling would then have to implement that change, and get it exactly right. It seems much simpler to just look for a file extension.
- 6 more replies
New conversation -
-
-
This is a somewhat old debate at this point and you're reiterating arguments that many of us disagreed with as if they're self-evident. Would be happy to take this private
Thanks. 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.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.