News for hackers. Stuff that matters.
Re:Microsoft Edge supports ES6 modules by Arnavion on Tuesday May 17, 2016 @03:33PM (#11716610)
>Note that since ES6 imports are statically defined, the browser can find and begin to download dependent files before even parsing the actual JS.

I think you meant executing the actual JS. Finding the imports requires parsing the file, and imports can be anywhere in the file as long as they're at the top level.

Re:Microsoft Edge supports ES6 modules by domenicd on Tuesday May 17, 2016 @03:41PM (#11716683)
It depends. For HTML all browsers do a form of "preparsing" where they do simplistic string searches for things that look like URLs and start speculatively fetching based on that. You could imagine a similar pass for JS modules.
Re:Microsoft Edge supports ES6 modules by bzbarsky on Wednesday May 18, 2016 @02:37AM (#11720188)
Firefox doesn't do simplistic string searches, for what it's worth. It actually tokenizes the HTML and kicks off loads from tokenization.

If someone then misuses document.write the token stream has to be thrown out and things have to be retokenized, but that's rare in practice. The tradeoff is better accuracy of the preloader and not having to go through the text twice unless someone is misusing document.write.

Re:Microsoft Edge supports ES6 modules by Arnavion on Tuesday May 17, 2016 @04:10PM (#11716967)
Ah, that's cool.