Enable dynamic module import by default
Categories
(Core :: JavaScript Engine, defect, P2)
Tracking
()
People
(Reporter: jonco, Assigned: jonco)
References
(Blocks 2 open bugs)
Details
(Keywords: dev-doc-complete)
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Updated•6 years ago
|
Comment 1•6 years ago
|
||
Tracking for 67 as it will probably deserve a mention in out developers release notes.
Updated•6 years ago
|
Assignee | ||
Comment 2•6 years ago
|
||
This has been enabled in nightly since the end of January and there haven't been any major bugs found. (Bug 1529203 was discovered but this was already present). What do you think about enabling this by default and letting it ride the trains, to ship in 67?
Comment 3•6 years ago
|
||
Please send email about this to dev.platform
Comment 5•6 years ago
|
||
bugherder |
Comment 6•6 years ago
|
||
Hi, maybe I'm doing something wrong, but I'm not able to import a module in a webextension content script via the dynamic import. I also tried this version which works in chrome: https://github.com/otiai10/chrome-extension-es6-import
By trying it myself I got the following errors:
Error: TelemetryStopwatch: key "WEBEXT_CONTENT_SCRIPT_INJECTION_MS" was already initialized ExtensionTelemetry.jsm:106:31
Error: TelemetryStopwatch: key "WEBEXT_CONTENT_SCRIPT_INJECTION_MS_BY_ADDONID" was already initialized ExtensionTelemetry.jsm:110:41
Error: TelemetryStopwatch: requesting elapsed time for nonexisting stopwatch. Histogram: "WEBEXT_CONTENT_SCRIPT_INJECTION_MS", key: "" ExtensionTelemetry.jsm:106:31
Error: TelemetryStopwatch: requesting elapsed time for nonexisting stopwatch. Histogram: "WEBEXT_CONTENT_SCRIPT_INJECTION_MS_BY_ADDONID"
However the provided add-on above does not produce any errors, but still doesn't log anything to the console.
Firefox Developer Edition 66.0b14 (64-Bit), Linux with enabled javascript.options.dynamicImport pref;
Assignee | ||
Comment 7•6 years ago
|
||
(In reply to robbendebiene from comment #6)
I've filed bug 1536094 for this.
Comment 8•6 years ago
|
||
Note to MDN writers:
We've already added a note about this to the Fx67 rel notes:
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/67#JavaScript
It looks like the BCD for import() could do with being updated
I also think it'd make sense to include a tutorial somewhere (in the JS guide?) explaining JS module import/export, how to use them, etc.
Comment 9•6 years ago
|
||
BCD updated for this bug: https://github.com/mdn/browser-compat-data/pull/4110
Comment 10•6 years ago
|
||
I've also finished rabbit-holing on my guide to JS modules:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
With that, I think the docs here and now complete. Feel free to give me a shout if you notice anything that isn't quite right.
Description
•