Load all JSM via ChromeUtils.import (instead of require) in DevTools codebase
Categories
(DevTools :: General, enhancement)
Tracking
(firefox107 fixed)
Tracking | Status | |
---|---|---|
firefox107 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
For now, we support loading JSM via commonjs require
method.
Moving to ChromeUtils.import will help ./mach esmify convert those import to ChromeUtils.importESModule.
And, this better highlight when we escape the commonjs module loader!
Assignee | ||
Comment 1•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
Convert all imports but the one related to SessionDataHelper
as that's an hybrid module which is loaded as a JSM from the main thread,
but loaded as a common js module from the worker thread.
We will be able to drop this once we can migrate this JSM to ESM
once we support loading ESM from the worker thread.
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/77b2425b1481 [devtools] Import all JSMs in DevTools with absolute URIs. r=jdescottes https://hg.mozilla.org/integration/autoland/rev/15f56e5c8176 [devtools] Import all JSM in DevTools via ChromeUtils.import. r=jdescottes
Assignee | ||
Comment 4•2 years ago
|
||
There was some imports of sys.mjs which I migrated to ChromeUtils.defineESModuleGetters
.
Comment 5•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/77b2425b1481
https://hg.mozilla.org/mozilla-central/rev/15f56e5c8176
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ce51354611f9 [devtools] Migrate lazyRequireGetter for JSM to ChromeUtils.defineModuleGetter. r=jdescottes
Comment 7•2 years ago
|
||
bugherder |
Comment 9•2 years ago
|
||
== Change summary for alert #35525 (as of Mon, 26 Sep 2022 20:44:06 GMT) ==
Improvements:
Ratio | Test | Platform | Options | Absolute values (old vs new) |
---|---|---|---|---|
7% | inspector-metrics | linux1804-64-qr | 3,785,754.80 -> 3,519,042.00 | |
7% | inspector-metrics | linux1804-64-shippable-qr | 3,785,564.75 -> 3,520,446.75 | |
7% | netmonitor-metrics | linux1804-64-qr | 3,933,496.80 -> 3,666,784.00 | |
7% | netmonitor-metrics | linux1804-64-shippable-qr | 3,933,306.75 -> 3,666,793.00 | |
6% | webconsole-metrics | linux1804-64-shippable-qr | 4,349,709.75 -> 4,083,196.00 | |
... | ... | ... | ... | ... |
6% | debugger-metrics | linux1804-64-shippable-qr | 4,791,127.58 -> 4,525,553.50 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=35525
Description
•