Open Bug 1443182 Opened 7 years ago Updated 2 years ago

Investigate NOT emitting ready / destroyed event in panels

Categories

(DevTools :: Framework, enhancement, P3)

enhancement

Tracking

(firefox60 affected)

Tracking Status
firefox60 --- affected

People

(Reporter: nchevobbe, Unassigned)

References

(Blocks 1 open bug)

Details

It looks like almost all panel emit `ready` [1] / `destroyed` [2] events, but it's unclear if they actually are of any use. Let's see if they are, and if not, remove them. [1] https://searchfox.org/mozilla-central/search?q=emit(%22ready%22&case=false&regexp=false&path=devtools%2Fclient [2] https://searchfox.org/mozilla-central/search?q=emit(%22destroyed%22&case=false&regexp=false&path=devtools%2Fclient
I imagine `ready` has been replaced by these events: https://searchfox.org/mozilla-central/source/devtools/client/framework/toolbox.js#1756-1757 But there isn't direct equivalent to `destroyed` ones, there are these, but it is fired just before we start destroying the panels https://searchfox.org/mozilla-central/source/devtools/client/framework/toolbox.js#2731-2732 (We may emit `${panelId}-destroyed` events from toolbox.js when `panel.destroy()` returned promise resolves?) `ready` events seems unused, but a couple of `destroyed` still are: https://searchfox.org/mozilla-central/search?q=.once(%22destroyed&case=false&regexp=false&path= Especially these occurrences: https://searchfox.org/mozilla-central/source/devtools/client/framework/toolbox-process-window.js#209 https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/head.js#327 https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/test/head.js#344 This bug report also highlights some other potential cleanups we could do now that there is no more xul addons: * EventEmitter interface on panels is forced from toolbox, it looks hacky, it would be clear if all panels explicitely implement this interface https://searchfox.org/mozilla-central/rev/c217fbde244344fedfd07b57a740c694a456dbca/devtools/client/framework/toolbox.js#1721-1728 https://searchfox.org/mozilla-central/rev/c217fbde244344fedfd07b57a740c694a456dbca/devtools/client/framework/toolbox.js#1748-1754 * All panels most likely all have an `open` method, so there is propably dead piece of code here: https://searchfox.org/mozilla-central/rev/c217fbde244344fedfd07b57a740c694a456dbca/devtools/client/framework/toolbox.js#1733-1742
Severity: normal → enhancement
Priority: -- → P3
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.