Review protocol.js form handling
Categories
(DevTools :: Framework, enhancement, P3)
Tracking
(firefox67 fixed)
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 1 open bug)
Details
Attachments
(6 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
Assignee | ||
Comment 2•6 years ago
|
||
None of our actor define a formType
in its specification.
This feature has never been used, so remove it and its test.
Assignee | ||
Comment 3•6 years ago
|
||
Remove all actorid checks in actors and fronts as we never pass a defined detail
argument in them.
Only domstylerule and node are using detail and that, always with detail="actorid".
Also remove ctx and detail in Front constructor as that's not used by these two actors.
Depends on D17612
Assignee | ||
Comment 4•6 years ago
|
||
This feature is only used by node and domrulestyle actors and that, only for actor ID.
Instead of this, support this "pass only actor ID rather than full form" feature
in a more dedicated way.
We might followup on that to clarify/simplify doing this: passing only the actor ID
rather than its full form.
Depends on D17613
Assignee | ||
Comment 5•6 years ago
|
||
Ideally, formAttributeName would be a field on the prototype of each front,
but unfortunately, Firefox doesn't support ES Class's fields yet. So it is
put as an instance attribute instead.
This patch streamline the manually set actorID and the retrieval of actor ID
from root or target front's form into getFront
helper method.
So that all the specific related to the lazy actor is now inside of this helper.
It also moves the special "this.manage(this)" to this helper.
We might be able to followup on this one and finally have only the root front
being self managed. But the initialize method makes it hard.
Note the special tweak made to devtools/client/responsive.html/manager.js
Hopefully this can be removed once the target classes are merged.
Depends on D15832
Assignee | ||
Comment 6•6 years ago
|
||
Now that form argument is no longer used by any front to set its actor ID,
we can remove this argument.
Have a particular look at:
- devtools/client/shared/test/test-actor-registry.js
which was the last Front to be manually instantiated and need some tweaks, - canvas head.js to create canvas front via getFront,
- RDM manager.js, which requires the EmulationFront to be self managed.
Depends on D17615
Assignee | ||
Comment 7•6 years ago
|
||
Hopefully green try:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=e863e640153dea6eab3fad70253f53cf151fd13e
Note that all intermediate revision are having a green try, I'm just not sure about the very last one.
Please have a first overall look on the whole patch queue as I'm cleaning up the same thing multiple time, so that intermediate state may look imperfect.
It is great to see that bug 1503628 should help us use Target.getFront in RDM and simplify the special case of Emulation Front in it!
Here is the overall story of this patch queue:
- remove unused
formType
- remove
detail
argument fromform()
methods. It was only used with detail=actorid. I kept this usecase, but it is now hardcoded into protocol.js. I wish we could followup on this particular subject as I believe that should be the default behavior and we shouldn't have implicit form update. This is what makes the Front very stateful and introduce confusion and complexity! - rebased previous patch to remove the call to form() from Front constructor
- Simplify the story around lazy actor by moving this.manage(this) from each front constructor to protocol.js:getFront and set the actorID from protocol.js:getFront rather than depending on Front constructor to do it
- This allows to drop completely the
form
argument from Front constructor \o/ This helps highlighting all the places where we were manually instantiating a front. It now requires some more manual work, but ideally we should avoid doing that!
Assignee | ||
Comment 9•6 years ago
|
||
Comment 10•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8d0fc09f446c
https://hg.mozilla.org/mozilla-central/rev/e51c403a53dd
https://hg.mozilla.org/mozilla-central/rev/41c84424b5f5
https://hg.mozilla.org/mozilla-central/rev/b974bf8f0374
https://hg.mozilla.org/mozilla-central/rev/96d4f1748866
https://hg.mozilla.org/mozilla-central/rev/936be7433144
Description
•