Add support for ES modules in PromiseWorker
Categories
(Toolkit :: Async Tooling, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox117 | --- | fixed |
People
(Reporter: standard8, Assigned: arai)
References
Details
Attachments
(1 file)
Bug 1834360 added support for ES modules to Chrome workers.
We should probably use automatic detection of the file extension (mjs vs js) to set the module type when creating the chrome worker.
Using mjs also allows our tools to detect the files as modules, so I think it is reasonable to use that as the detection switch.
It might also be worth checking that PromiseWorker.js can correctly be loaded into a chrome module. I don't know if the require method will still work with modules.
Comment 1•2 years ago
|
||
With support for ESM imports, require support is not strictly required, at least not for new code.
There is a new consumer of PromiseWorker in bug 1831947 that uses require for the lack of anything better, but if modules were to be supported, that would have been preferable. (Hmm would dynamic imports work to reduce the migration effort down the road?)
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 2•2 years ago
|
||
In order to use the same implementation between regular script and module script,
convert PromiseWorker.js into a template, which is processed by GeneratePromiseWorkerScript.py.
Comment 4•2 years ago
|
||
Backed out changeset 4429ec0ce7e1 (Bug 1835279) for causing failures in browser_all_files_referenced.js CLOSED TREE
Log: https://treeherder.mozilla.org/logviewer?job_id=423706588&repo=autoland&lineNumber=4208
Backout: https://hg.mozilla.org/integration/autoland/rev/e456cc863b26a4eaaef19a92d04686c72b991cdd
| Assignee | ||
Updated•2 years ago
|
Comment 6•2 years ago
|
||
| bugherder | ||
Description
•