I wonder how people are going to feel about .cjs 
-
Show this thread
-
for context https://github.com/nodejs/ecmascript-modules/blob/modules-lkgr/doc/api/esm.md …pic.twitter.com/Fmjxretvu4
4 replies 4 retweets 17 likesShow this thread -
Replying to @MylesBorins
Seems weird/wasteful to load the package.json even if the extension is unambiguous. Why not make extension the first check?
3 replies 0 retweets 7 likes -
Replying to @mathias @MylesBorins
package.json#type is intended to be reusable for a variety of things, in particular eventually configuring your own extension <-> content-type mapping has been discussed.
1 reply 0 retweets 1 like -
Replying to @bradleymeck @MylesBorins
Is it a goal to allow overriding the meaning of .cjs and .mjs too? Because if not, the extension check could still be hoisted.
1 reply 0 retweets 3 likes -
Replying to @mathias @MylesBorins
Given that you can overload any format checks using loaders, I don't think hoisting can really be done. However, most loaders should work be able to run ahead of time which kind of hoists?
1 reply 0 retweets 0 likes -
Replying to @bradleymeck @MylesBorins
I think it would be reasonable to carve out .cjs and .mjs. It’d be worth it for the reduced disk I/O alone!
@guybedford1 reply 0 retweets 2 likes -
anytime you don't do custom stuff we can certainly do better :)
1 reply 0 retweets 1 like
Well, not with the spec as currently written
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.