An Update on ES6 Modules in Node.js
James M Snell

Question — Does the ES Module spec expect that imports are loaded before the rest of the code is run?

If that is the case, for all intents and purposes, you can effectively treat the imports statements as synchronous. They are loaded before the file is even executed. Just because this is subtley different than how “require” works shouldn’t matter in practice. In fact, I could write something analagous to this on the web. In fact, this is exactly how requirejs works. Can you illustrate an error that would be caused by making the assumption that imports function in a roughly synchronous fashion? I’m not sure if I truely understand the problem here.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.