Intent to Ship: JavaScript module import()

961 views
Skip to first unread message

Kouhei Ueno

unread,
Sep 26, 2017, 12:55:05 AM9/26/17
to blink-dev

Contact emails

V8 implementation: gsa...@chromium.org

Blink implementation: kou...@chromium.org

Spec: dom...@chromium.org


Explainer

N/A


Spec

JavaScript side: https://tc39.github.io/proposal-dynamic-import/

This is a stage 3 proposal, which per the TC39 process is the appropriate time to implement (and ship).


Web side: https://github.com/whatwg/html/pull/3044 (derived from an earlier draft); preview

 

TAG review


Summary

import() is an addition to the JavaScript module system which allows dynamic importing of modules, as opposed to the static/declarative importing provided by the import declaration. It is a new JavaScript "function-like" syntactic form, similar to super().



Link to “Intent to Implement” blink-dev discussion

https://groups.google.com/a/chromium.org/d/msg/blink-dev/wRLMM5-kpCY/Y0be_ASaAwAJ



Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes.


Demo link

https://dynamic-import.firebaseapp.com/



Risks

Interoperability and Compatibility

This is a mature feature in the TC39 process, implying at least support from all the JavaScript engine teams from each browser. We anticipate it being implemented rapidly, either alongside initial implementations of JavaScript modules or shortly thereafter.


Edge: Shipped in ChakraCore; in progress in Edge

Firefox: Public support in TC39 (Bugzilla tracking bug)

Safari: Shipped in Safari 11

Web developers: Strongly positive


Ergonomics

N/A


Activation

This is a straightforward API with clear performance benefits. So, we expect that adoption will be good with the usual level of efforts around awareness.


Is this feature fully tested by web-platform-tests?

Yes. They are at https://github.com/w3c/web-platform-tests/tree/master/html/semantics/scripting-1/the-script-element/module/dynamic-import

We confirmed that Safari Tech Preview passes all of them.

Chrome ToT currently passes tests with the exception of “dynamic import from classic script w/ CSP+SRI enabled” case, which we plan to fix shortly before flipping the flag by default.


Entry on the feature dashboard

https://www.chromestatus.com/feature/5684934484164608


--
kouhei

TAMURA, Kent

unread,
Sep 26, 2017, 4:26:10 AM9/26/17
to Kouhei Ueno, blink-dev
LGTM1.


--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAPVAxLXb471F_QKF5Kxv-4-KcfvNhi_RuDmLxELnXC5uk9hRAA%40mail.gmail.com.



--
TAMURA Kent
Software Engineer, Google


Dimitri Glazkov

unread,
Sep 26, 2017, 10:40:31 AM9/26/17
to TAMURA, Kent, Kouhei Ueno, blink-dev

Rick Byers

unread,
Sep 26, 2017, 9:46:10 PM9/26/17
to Dimitri Glazkov, TAMURA, Kent, Kouhei Ueno, blink-dev
Reply all
Reply to author
Forward
0 new messages