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?
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.
-
-
We’re both considering network effects. All tooling already deals w this ambiguity. What isn’t yet already dealt with is servers everywhere understanding what .mjs is. Reparse would only need to happen on entrypoint, which could be amortized by node module cache, as I mentioned.
-
“All tooling already deals w this ambiguity.” Exactly, through additional configuration!https://twitter.com/mathias/status/1096035892899266560 …
- 4 more replies
New conversation -
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.