News for hackers. Stuff that matters.
Re:Top-level await in JavaScript is a footgun by theefer on Wednesday September 14, 2016 @04:50PM (#12501090)
> `await import('./foo.js')` could kick off a speculative fetch for foo.js

Interesting, and kind of makes sense.

However:

> Of course that doesn't help for dynamic cases like `` await import(`./language-packs/${navigator.language}.js`) ``.

Isn't that the main, possibly only advantage of `await import(...)` though?

For static import names, why write `const x = await import('x');` if you can simply write `import x from 'x';`?

Re:Top-level await in JavaScript is a footgun by domenicd on Thursday September 22, 2016 @06:34AM (#12555844)
Because await import() can be used inside if statements or similar.