Closed Bug 1791969 Opened 2 years ago Closed 2 years ago

Load all JSM via ChromeUtils.import (instead of require) in DevTools codebase

Categories

(DevTools :: General, enhancement)

enhancement

Tracking

(firefox107 fixed)

RESOLVED FIXED
107 Branch
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: nobody → poirot.alex
Status: NEW → ASSIGNED

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.

Blocks: 1792410
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

There was some imports of sys.mjs which I migrated to ChromeUtils.defineESModuleGetters.

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 107 Branch
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ce51354611f9
[devtools] Migrate lazyRequireGetter for JSM to ChromeUtils.defineModuleGetter. r=jdescottes

== 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

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: