import await a, { b, c } from "top-level-await.js"; import await a, { b, c } from "module.wasm"; import async aPromise, { bPromise, cPromise } from "module2.js"; import a from "top-level-await.js"; // <- Error
-
-
For me it makes perfect sense
You can await a promise, but you don't have to. -
I think what seb is referring to is that this pattern appears to be viral If a single leaf uses top-level await or import await, the entire branch need to await import to the root
- 4 more replies
New conversation -
-
-
Last sentence is confusing. Seems odd if you have: import await bar from './bar.js'; And then: import bar from './bar.js'; In another. Unless it's required? Unclear what this is trying to solve.
-
The idea is that there are two kinds of modules (normal/sync modules and async modules) and it's explicit on import which kind of module is imported (like calling an async function need to have an explicit await). Using this syntax would probably avoid the breaking ESM change.
- 11 more replies
New conversation -
-
-
That was on purpose though when this came up in the discussion at JSKongress - requiring this to be explicit in every module up the dependency graph makes you more aware of the impact this could have on initialization time
-
My concern would rather be overloading the await keyword like this makes it look like the modules are loaded sequentially
- 5 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 