Open MaxDesiatov opened 4 years ago
I've got an inspector Chrome extension partially working. It builds a Set
of the MountedViews
(and some related data), then encodes it to JSON and passes it to the extension. Then the extension uses id
and parent
properties to construct a tree from the data.
The extension is also written in Tokamak 🙃
Is the extension shared somewhere?
I imagine this could work similarly to React dev tools. Just evaluating the mounted components tree and matching those to rendered DOM elements would already be useful.
I didn't look into the details of how React dev tools do it, but in our case it probably could be implemented by importing a callback or an object into the WebAssembly module, or agreeing on a certain symbol being available when the dev tools extension is present. The renderer could check for that symbol and expose the mounted element tree through it. Alternative approaches are obviously welcome.