-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Top-level await #376
Comments
Quick triage note from our Reykjavik F2F: I placed this in the milestone for next week's telcon and marked this as urgent, as they've requested we get back to them in before 4 June. |
From dynamic imports it is clear that the operation is async given that you must write Would it be possible to create new syntax? say |
@kenchris We considered this at tc39/proposal-top-level-await#60 . There was a bit of excitement in the developer community about this alternative, which has a draft implementation in webpack by @sokra webpack/webpack#9177 . I think this is an interesting alternative. Some rationale for the current proposal (in more depth at tc39/proposal-top-level-await#60 (comment)):
For example, WebAssembly modules are proposed to be async (to give time for parallelizable work when instantiating modules, today important in JSC, but possibly in the future in other engines). I believe it would be bad if there were breaking change when a module upgrades its implementation from JavaScript to WebAssembly, but if we adopt explicit |
Don't you end up with the other problem as well, given that WASM modules are async, I would want to execute in parallel as much as possible and move away from declarative import statements and instead use |
@kenchris The semantics of top-level await are based around these import statements executing in parallel, not in series, so it should be like using The current top-level await proposal is based on making normal |
@hober I've clarified further how the top-level await proposal maintains expectations of synchronous module loading behavior at https://github.com/tc39/proposal-top-level-await/blob/master/README.md#without-this-proposal-module-graph-execution-is-synchronous-does-this-proposal-maintain-developer-expectations-that-such-loading-be-synchronous . I'd be interested to hear your feedback. |
Thanks for riding the TAG train, hope to see you soon again! |
Góðan dag TAG!
I'm requesting a TAG review of:
Further details (optional):
You should also know that...
The introduction of asynchronous modules may be interesting to the TAG, as modules can now take a broader role in asynchronous loading, including various kinds of loaded resources.
We'd prefer the TAG provide feedback as (please select one):
Please preview the issue and check that the links work before submitting
For background, see our explanation of how to write a good explainer.
The text was updated successfully, but these errors were encountered: