- The proposal
import awaitgist- PR to proposal explainer
- slide from march meeting discussing
import await - Issue for W3C TAG Review
- WebpackPR to add
import async
Concerns raised in initial import await gist
- Asynchronicity of imported module is not visible
- Imports of async modules can have potentially performance impact and should be visible to the developer
- It's difficult to see which modules are affected by the top-level-await
- Once this is visible, developer can break the async chain with
import()
- Microticks between imports may be unexpected
- Developer don't know if modules are evaluated sync or async
- Execution order is no longer guaranteed when modules add top-level-awaits
- No more microticks unless there is top-level await
- If no top-level await in graph then it is executed synchronously
- Optmizes async execution
- Only the modules that include a Top-Level Await are run asyncronously
- Subsquent sub graphs are run synchronously
- No micro ticks for remaining graph
- Viral Syntax
- no way to introduce async module into graph without
import awaitto root - use of
import awaitdefensively likely to happen
- no way to introduce async module into graph without
- wasm modules will be async
- will force introduction of wasm modules to be Semver-Major (and viral)
- Removes ability for engine to optimize async execution
import awaitwould force graph up to root to execute asynchronously- running
import asyncmodules synchronously would break developer contract
- It is my belief that
import awaitis not a replacement forTop-Level Await - This does not mean that others, e.g. webpack, should not experiment with the API
- this does not preclude
import awaitfrom being presented to the committee as an additional proposal in the future