Expose a helper on protocol's Front class to help retrieve the parent front
Categories
(DevTools :: Framework, enhancement, P1)
Tracking
(firefox70 fixed)
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: gl, Assigned: gl)
References
(Blocks 2 open bugs)
Details
(Whiteboard: dt-fission-m1)
Attachments
(1 file)
In Bug 1539764, we added a targetFront
attribute to retrieve the target front. This would allow us to do async calls to retrieve target-scoped fronts like the Inspector via await nodeFront.target.getInspector()
.
Since we know these child fronts of target-scoped fronts are initialized and managed by their parent target-scoped fronts, we could add an attribute targetScoped
to retrieve their ancestor target-scoped fronts. Allowing us to have synchronous access to the target-scoped fronts.
As an example, nodeFront
is a child front of walkerFront
. nodeFront.targetScoped
and walkerFront.targetScoped
would both point to the inspectorFront
which is the target-scoped front.
Assignee | ||
Comment 1•5 years ago
|
||
Only children of the target-scoped fronts will have a targetScoped attribute set.
This targetScoped attribute returns the ancestor target-scoped front. As an example,
nodeFront.targetScoped would return the InspectorFront.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Out of curiosity, in terms of naming was there a discussion around suffixing properties with Front? Naively, it seems like that would be assumed. i.e I would assume that a parent
property of a front would be a front.
Assignee | ||
Comment 3•5 years ago
|
||
(In reply to Jason Laster [:jlast] from comment #2)
Out of curiosity, in terms of naming was there a discussion around suffixing properties with Front? Naively, it seems like that would be assumed. i.e I would assume that a
parent
property of a front would be a front.
This has came up before. You can imagine the problem in the inspector where we have a InspectorFront
and call it inspector
on the client. We end up calling something like inspector.inspector
instead of inspector.inspectorFront
. So, we added the Front suffix to be explicit about what we are calling. You can also see in the phabricator comments why we couldn't use parent
as the name because we have conflict with the NodeFront
already using _parent
.
Comment 5•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Updated•3 years ago
|
Description
•