Closed
Bug 1118692
Opened 10 years ago
Closed 9 years ago
Refactor the markup-view UI code into shareable/reusable/swappable components
Categories
(DevTools :: Inspector, defect)
DevTools
Inspector
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: pbro, Assigned: pbro)
References
Details
Attachments
(2 files, 1 obsolete file)
|
58.92 KB,
image/png
|
Details | |
|
611.78 KB,
patch
|
Details | Diff | Splinter Review |
Some of the advantages of refactoring the UI code into shareable components and clearly separating them from the model are:
- better maintainability and testability,
- simpler learning curve for new contributors,
- components can be shared (i.e. displaying a DOM node in the debugger or console becomes very simple and the node is guaranteed to look/behave the same everywhere),
- components can be swapped easily, as long as they have the same signature (e.g. making it easy to swap for an HTML-like output to an HAML-like output).
Reactjs is clearly a good candidate for this. Choosing to adopt a framework like Reactjs for this project is not an easy question to answer.
I intend this bug to be used as an experiment which, hopefully, would make answering the question easier.
| Assignee | ||
Comment 1•10 years ago
|
||
This is my experiment so far.
This replaces the markup-view code completely.
90% of the features are missing, so it's a very long way from being done, but it does display something if you visit a page and *then* open the inspector (don't try to navigate or reload or anything fancy like this).
I've created a new model thing that talks to the Walker and builds an internal tree representation of the currently displayed DOM tree. Each time this internal model changes, an event is emitted, and that is used by the new markup-view to refresh itself.
The react components are split in a way that should make it easy to embed a node anywhere in the devtools, and make this node either dynamic (ability to expand it and reacting to mutations), or just static.
Just for fun, instead of the usual HTML-like output, I've implemented a very simple HAML-like component to demonstrate how easy it is to swap components once you've made sure they are simple/small/stateless enough (will include a screenshot).
| Assignee | ||
Comment 2•10 years ago
|
||
| Assignee | ||
Comment 3•10 years ago
|
||
CC'ing a few people, including Irakli and James who know way more about React than me and might be interested in telling me where my patch sucks :)
| Assignee | ||
Updated•10 years ago
|
Attachment #8545176 -
Attachment is patch: true
| Assignee | ||
Comment 4•10 years ago
|
||
Assignee: nobody → pbrosset
Attachment #8545176 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
| Assignee | ||
Comment 6•9 years ago
|
||
WONTFIXing this. Not a priority just now. Keeping this work as a reference for later when we do migrate the markup-view panel to react.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•