TokamakUI / Tokamak

SwiftUI-compatible framework for building browser apps with WebAssembly and native apps for other platforms
Apache License 2.0
2.62k stars 111 forks source link

Tokamak dev tools #242

Open MaxDesiatov opened 4 years ago

MaxDesiatov commented 4 years ago

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.

carson-katri commented 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.

Screen Shot 2020-08-05 at 11 04 18 PM

The extension is also written in Tokamak 🙃

aehlke commented 1 year ago

Is the extension shared somewhere?