46 bytes, text/x-phabricator-request
|Details | Review|
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).
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
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
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/587532e4c6fe emit event when target scoped front is created; r=ochameau
You need to log in before you can comment on or make changes to this bug.