Remove DebuggerClient.release method
Categories
(DevTools :: Console, task, P3)
Tracking
(Fission Milestone:Future)
Fission Milestone | Future |
People
(Reporter: ochameau, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Whiteboard: dt-fission-future)
Attachments
(2 obsolete files)
Updated•6 years ago
|
Reporter | ||
Comment 1•6 years ago
|
||
Comment 2•6 years ago
|
||
Comment 3•6 years ago
|
||
Reporter | ||
Comment 4•6 years ago
|
||
Comment 5•6 years ago
|
||
Reporter | ||
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Comment 6•6 years ago
|
||
Comment 7•6 years ago
|
||
Reporter | ||
Comment 8•6 years ago
|
||
I'm sorry if I've been misleading in the bug comment, but this change:
- doesn't help switching to protocol JS types: we still pass around actor ID,
- we still emit a request from the console front, in the name of of another actor.
This comment was confusing:
WebConsoleClient.release();
I actually meant to have a release
method on all clients that have to be released.
And it is not clear if it is only used for ObjectActor, or if it also used from other type of actors. May be network events?
Unfortunately, doing that would most likely lead to modifying many things in the callsites (a significant one would be reps) in order to pass around the client/front instead of the actor ID. But it would be great to have a sense of how many modifications are required.
Note that protocol.js is having a special release
flag on specs, which will force calling destroy
method after calling the release
one:
https://searchfox.org/mozilla-central/source/devtools/shared/specs/animation.js#35
https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/devtools/server/actors/animation.js#127-131
https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/devtools/shared/protocol.js#1205-1212
And some other fronts are using yet another pattern: one way "finalize" methods:
https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/devtools/shared/specs/highlighters.js#64-66
https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/devtools/server/actors/highlighters.js#559
https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/devtools/server/actors/highlighters.js#506
Finally, I should mention the RFC I opened: https://github.com/firefox-devtools/rfcs/issues/58
It highlights that a few panels are using actor IDs instead of passing around clients/fronts. I've not been about to make progress on that topic, but we may want to ease such practice or at very least acknowledge it. The main issue is that it seems to go against protocol.js fronts and having instances of things on the client side.
Comment 9•6 years ago
|
||
Thanks for the clarification. I didn't understand the initial description correctly.
Taking another look at the codebase, we have three distinct panels that are using debuggerClient.release --> Debugger, Scratchpad, and Webconsole.
Debugger
For the debugger it appears to exclusively be used from reps: https://searchfox.org/mozilla-central/search?q=releaseActor&case=false®exp=false&path=debugger
reps
reps usage of release is limited to the objectInspector:
We set actors in two locations:
If we trace the NODE_PROPERTIES_LOADED event to where it is being set as the actor value, we come to this point:
We are operating on rdpGrips: https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/devtools/client/debugger/new/packages/devtools-reps/src/object-inspector/utils/node.js#54-68
It is called, for example, from nodeExpand: https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/devtools/client/shared/components/reps/reps.js#7026
Which sets its actor from this function: https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/devtools/client/shared/components/reps/reps.js#2969-2973
This is fortunately the only usage of getActor in the devtools-reps codebase. https://searchfox.org/mozilla-central/search?q=getActor(&case=false®exp=false&path=devtools-reps
We can just replace it with getValue
For the GETTER_INVOKED event, it is easier, we just need to pass the object client from here:
It looks like we are not even setting the actor id string there.
Webconsole
Within the webconsole -- ignoring reps, we have a collection of removed actors held in state:
https://searchfox.org/mozilla-central/search?q=removedActors&case=false®exp=false&path=webconsole
We could modify the following to create an array of actors rather than actor strings: https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/devtools/client/webconsole/reducers/messages.js#563-583
Then modify this line to release the actors: https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/devtools/client/webconsole/enhancers/actor-releaser.js#53
We have a releaseObject method that does not seem to be used anywhere as well:
Scratchpad
Scratchpad seems to use it exclusively from the variablesview: https://searchfox.org/mozilla-central/search?q=releaseActor&case=false®exp=false&path=scratchpad
VariableView
Like in other places, it appears that this collection only exists in order to release the actors.
These seem like large enough changes that each of these should have their own bug.
I think this is everything. Let me know if I missed something. I will break this into independent bugs.
Updated•6 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 10•5 years ago
|
||
Renaming the bug so it makes more sense (I think).
Scratchpad is no more
the VariablesViewController will be removed as part of Bug 1591874 since it's not used anywhere (I think)
WebConsole won't be using DebuggerClient.release as part of Bug 1579090
I think the last consumer will be the inspector extension, which will be handled by Bug 1599432.
Comment 11•5 years ago
|
||
dt-fission-reserve bugs do not need to block Fission Nightly (M6).
Comment 12•4 years ago
|
||
Tracking dt-fission-reserve bugs for Fission MVP until we know whether they really need to block Fission or not.
Updated•4 years ago
|
Comment 13•4 years ago
|
||
Moving old "dt-fission-reserve" bugs to "dt-fission-future" because they don't block Fission MVP.
Updated•2 years ago
|
Description
•