News for hackers. Stuff that matters.
Re:Microsoft Edge supports ES6 modules by MatthewPhillips on Tuesday May 17, 2016 @02:34PM (#11716097)
Yes, it makes separate requests, like if you made separate script tags (just using module semantics instead). With HTTP2 it will be ok, but you will still need something that understands your dependency graph so your server knows which modules to include with the request.
Re:Microsoft Edge supports ES6 modules by eknkc on Tuesday May 17, 2016 @02:47PM (#11716217)
I guess service workers might solve a lot of issues here. You could do weird stuff like basically serving a tar file for all assets and use a service worker to handle individual requests.
Re:Microsoft Edge supports ES6 modules by MatthewPhillips on Tuesday May 17, 2016 @02:52PM (#11716255)
That's a really smart idea, I hadn't considered that. Once you add in caching you might get pretty reasonable performance.
Re:Microsoft Edge supports ES6 modules by WorldMaker on Tuesday May 17, 2016 @03:54PM (#11716812)
Also, the not yet implemented module loader spec would include a format similar to the AMD bundle format where modules are wrapped in calls to `System.register`.
Re:Microsoft Edge supports ES6 modules by MatthewPhillips on Tuesday May 17, 2016 @04:13PM (#11716997)
There's no such bundling format under consideration, as far as I'm aware. System.register is a SystemJS API, not a spec one.
Re:Microsoft Edge supports ES6 modules by WorldMaker on Wednesday May 18, 2016 @09:45AM (#11721848)
The Loader spec does include the concepts of a module registry and a low level API for them. From what I can tell skimming the specs, the high level construct of System.register has been in and out of the spec. Also from what I can tell, System.register may be possible to be implemented on top of the low level API regardless of whether it makes it into the final spec or not.
Re:Microsoft Edge supports ES6 modules by egeozcan on Tuesday May 17, 2016 @03:10PM (#11716428)
This is an interesting idea. On the other hand, I think if you started packing everything into a tar file, that could as well be a js file.
Re:Microsoft Edge supports ES6 modules by gsnedders on Tuesday May 17, 2016 @03:14PM (#11716459)
> On the other hand, I think if you started packing everything into a tar file, that could as well be a js file.

Modules give you a certain degree of namespacing, which is nice. Compiling down to a tar to be served to a Service Worker is undoubtedly easier than the mangling needed to remove the modules.