Allow to listen for front creations by typeName

RESOLVED FIXED in Firefox 65

Status

enhancement
P2
normal
RESOLVED FIXED
9 months ago
Last month

People

(Reporter: ochameau, Assigned: yulia)

Tracking

(Blocks 1 bug)

unspecified
Firefox 65
Dependency tree / graph

Firefox Tracking Flags

(firefox65 fixed)

Details

(Whiteboard: dt-fission)

Attachments

(1 attachment)

Reporter

Description

9 months ago
Bug 1222047 introduced a generic API to instantiate fronts, but it doesn't allow to listen for fronts being created.
It would be really helpful to expose such API in order to easily register event listeners whenever a front get created, that, without forcing the instantiation of a new one.

The typical usecase is the toolbox class. It has to listen for some events on the performance and inspector-related fronts, but these fronts don't necessarily have to be instantiated on toolbox opening. They will be created depending on which panel we open. For now, in order to mitigate that, we managed these fronts creation from toolbox. But for fission we have to uncouple that from the toolbox, instead it should be handled by the target or the root fronts. In addition to that, we will start instantiating more than just one of these actors and so it will be handy to have a way to listen for all the new ones being created.

So TabTarget.getFront:
  https://searchfox.org/mozilla-central/rev/819cd31a93fd50b7167979607371878c4d6f18e8/devtools/client/framework/target.js#363-373
and RootClient.getFront:
  https://searchfox.org/mozilla-central/rev/819cd31a93fd50b7167979607371878c4d6f18e8/devtools/shared/client/root-client.js#277-293
Should both emit an event whenever a new front is created. This event should be easily listened by typeName as listeners will most likely care about one particular type of front.
We might also want to emit an event on destruction (if that is *really* useful as fronts are going to be destroyed anyway and there is no value to do it only for removing the listeners).
Reporter

Updated

9 months ago
Blocks: 1495388
Reporter

Updated

9 months ago
Blocks: 1495389
Assignee

Updated

8 months ago
Depends on: 1485661
Assignee

Comment 1

8 months ago
this change only impacts the target front, and emits an event every time a target is
created. No listners yet.
Attachment #9015526 - Attachment description: Bug 1495386 - WIP emit event when target front is created; r=ochameau → Bug 1495386 - WIP emit event when target scoped front is created; r=ochameau
Reporter

Updated

8 months ago
Whiteboard: dt-fission
Assignee

Updated

8 months ago
Blocks: 1503562
Assignee

Updated

8 months ago
No longer blocks: dt-fission
Reporter

Updated

8 months ago
Assignee: nobody → ystartsev
Attachment #9015526 - Attachment description: Bug 1495386 - WIP emit event when target scoped front is created; r=ochameau → Bug 1495386 - emit event when target scoped front is created; r=ochameau

Comment 2

7 months ago
Pushed by ystartsev@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/587532e4c6fe
emit event when target scoped front is created; r=ochameau

Comment 3

7 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/587532e4c6fe
Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 65
You need to log in before you can comment on or make changes to this bug.