Closed Bug 1788762 Opened 2 years ago Closed 2 years ago

Migrate devtools network observer to an ES module

Categories

(Remote Protocol :: Agent, task, P1)

task
Points:
3

Tracking

(firefox108 fixed)

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Blocks 4 open bugs)

Details

(Whiteboard: [webdriver:m5])

Attachments

(4 files)

The first step to make the DevTools network observer codebase shared with remote/ is to migrate the code from DevTools common JS modules to ESM.

In this bug we don't intend to change the interface of the observer at all, the goal is only to do a technical migration and to check that there are no issues when using (and debugging) the network observer modules

To understand the topic right of this bug you are planning to move the observer or to place a ES copy of it into remote? Maybe we should clarify that a bit better in the summary.

The goal is only to migrate the common JS module to ESM. The modules will stay in the same location, will not move to remote, etc...

Summary: Move devtools network observer to an ES module → Migrate devtools network observer to an ES module
Blocks: 1788777
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Blocks: 1525652

Depends on D156968

Cleanup of the ChannelMap class

  • use private fields
  • move static method to module-local method
  • add comments
  • rename methods to match behavior
Blocks: 1790362
Points: --- → 3
Priority: -- → P1
Whiteboard: [webdriver:m5]
Depends on: 1790383

Requires some devtools changes before we can actually continue with this bug.

Whiteboard: [webdriver:m5] → [webdriver:m5:blocked]
Status: ASSIGNED → NEW

Unfortunately, defineESModuleGetters is only contextual.
There is no argument to force it to load in another global.

This requires to switch to synchronous import, or,
introduce some temporary lazy getter until we migrate CommonJS modules to ESM.

At the end of ESM migration, we should mostly have one usage of loadInDevToolsLoader:true,
when we import DevToolsServer from Launcher.sys.mjs. Then, it should all be contextual.

Blocks: 1795466
Blocks: 1795474
Blocks: 1795475
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7fb16f9cb039 Migrate devtools network observer to an ES module r=ochameau https://hg.mozilla.org/integration/autoland/rev/ea331a657dc9 [devtools] Code cleanup devtools ChannelMap.sys.mjs r=ochameau https://hg.mozilla.org/integration/autoland/rev/f87b165f729e [devtools] Load the NetworkObserver modules in DevToolsLoader if invisibleToDebugger is set r=ochameau
Status: NEW → ASSIGNED
Whiteboard: [webdriver:m5:blocked] → [webdriver:m5]
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: