s...@chromium.org, cbr...@chromium.org
https://v8.dev/features/top-level-await
https://github.com/tc39/proposal-top-level-await
https://tc39.es/proposal-top-level-await/
HTML integration:
https://github.com/whatwg/html/pull/4352
ServiceWorker integration:
https://github.com/w3c/ServiceWorker/pull/1444
https://docs.google.com/document/d/15jxKo7kqj0bRHcnSmwjhj1XaWH1AXRDtYPiJHluCSiA/edit
Allow the `await` keyword at the top-level within JavaScript modules.
https://github.com/w3ctag/design-reviews/issues/376
Issues addressed
Stage 3 TC39 proposal, thus risk is low that others browsers will not implement it.
Gecko: Worth prototyping (https://mozilla.github.io/standards-positions/#top-level-await)
WebKit: Positive (https://lists.webkit.org/pipermail/webkit-dev/2020-September/031418.html)
Web developers: Positive
Not possible to polyfill.
Could cause timeouts and races in the hands of inexperienced developers.
Yes
In test262: https://github.com/tc39/test262/tree/master/test/language/module-code/top-level-await
Changes to module script timing in WPT in various places. (See the TopLevelAwait virtual WPT suite.)
https://bugs.chromium.org/p/v8/issues/detail?id=9344
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAN-e9e-qQfgDVcb%3DyBYsjc41jA%2Bw4Hzw3kKKRHJj%2BYgJf23jZw%40mail.gmail.com.
Debuggability
Could cause timeouts and races in the hands of inexperienced developers.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes
Is this feature fully tested by web-platform-tests?
In test262: https://github.com/tc39/test262/tree/master/test/language/module-code/top-level-await
Changes to module script timing in WPT in various places. (See the TopLevelAwait virtual WPT suite.)
Tracking bug
https://bugs.chromium.org/p/v8/issues/detail?id=9344
Link to entry on the Chrome Platform Status
--
I believe the question at hand is how to use new syntactic feature of the language such as TLA without transpiling for browsers that implement those features.
Unlike API additions that can be dynamically feature tested, new syntax would cause parse errors on older browsers. Currently you can use the module/nomodule paradigm to target a certain set of language features that are known to be supported if the browser supports ES modules. Any newer features need to be transpiled as I don't believe there is any way to do content negotiation, or we have to rely on somewhat brittle user agent sniffing at the server, which is getting removed.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACj%3DBEj67cmDuQZCnOzDUFX6_nNyDZ3nYQv8Kijint13q375-g%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAKXHy%3Dfdd%3D_85jke8Dvmtd2uG_0Wq02J1JhfeCnQuf6EjM2qoQ%40mail.gmail.com.