Closed Bug 1473578 Opened 4 years ago Closed 4 years ago

Remove ModuleAPI and synchronous DebuggerServer.registerModule

Categories

(DevTools :: General, enhancement, P3)

enhancement

Tracking

(firefox63 fixed)

RESOLVED FIXED
Firefox 63
Tracking Status
firefox63 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

All this code is only used for devtools/server/actors/webbrowser.js.
We could simplify actor registration a bit by removing all that.
The only thing that is used from ModuleAPI is setRootActor and it is just a wrapper for DebuggerServer.setRootActor.
We can surely register the root actor function differently.
Assignee: nobody → poirot.alex
Severity: normal → enhancement
Priority: -- → P3
Depends on: 1473628
I went for replacing this:
  DebuggerServer.registerModule("path/to/module")
by:
  const { createRootActor } = require("path/to/module");
  DebuggerServer.setRootActor(createRootActor);

But I'm open to alternatives:
  * let the module call DebugerServer.setRootActor itself,
  * have a "loadRootActorModule" on DebuggerServer,
  * ...?
Comment on attachment 8990009 [details]
Bug 1473578 - Remove deprecated synchronous DebuggerServer.registerModule feature.

https://reviewboard.mozilla.org/r/255034/#review261950

Thanks, this looks great to me! :)
Attachment #8990009 - Flags: review?(jryans) → review+
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cbdea658bee1
Remove deprecated synchronous DebuggerServer.registerModule feature. r=jryans
https://hg.mozilla.org/mozilla-central/rev/cbdea658bee1
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Blocks: dbg-server
You need to log in before you can comment on or make changes to this bug.