Or, .mjs [1].
[1] https://github.com/nodejs/node-eps/blob/master/002-es6-modul...
I was worried this was short for "Microsoft JS", thanks for the link.
For example, you might depend on "foo" and "bar". "foo" also depends on "bar", but it needs version 1 and you need version 2. In this case, setting paths for "bar" won't work, the paths are different for each parent.
The loader spec provides a hook "resolve" that allows you to work around this, just wanted to point out that configuration alone wouldn't be enough.
It's also worth noting that the Loader spec doesn't have a real urgency to it. What I mean is that likely browsers will implement script type=module first, give it some time to brew, and then pull in things from whatwg/loader over time. In the meantime we'll want solutions that do allow us to use script type=module and still have modern workflows we are used to.
[1] https://blog.cloudflare.com/cloudflares-impact-on-the-http-2...
That users aren't connecting to http/2 web sites is no indicator that http/2 is not available.
If 47% of all CloudFlare users are not connecting via HTTP/2 (even though it is supported server side), I believe it means that those users do not have client side support (or are behind a proxy, etc. which doesn't allow it).
At the end, if someone is thinking about making a website which would be much slower for non-HTTP/2 users then right now it means around 47% of their users.
1. No way to dynamically import a module (the article explains this).
2. All imports must be relative or absolute urls, so either ./foo.js or /foo.js or http://example.com/foo.js
This means you can't npm install lodash and import the string "lodash".
3. All imports must include the file extension (.js). So even if you set up a server route for /lodash it would break as soon as one of lodash's imports didn't use .js (or it imports another package). This is assuming lodash is written with import/export; it's not so it wouldn't work at all.
4. Until http2 comes around, this is probably not something you want to ship to production (unless you have a small app with only have a handful of scripts being imported), so bundlers are here to stay for a while.
It might be possible to work around 1, 2, and 3 using Service Workers, I wrote about this a while ago: https://matthewphillips.info/posts/loading-app-with-script-m...