Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developer Experience: Use Chrome elements panel to interact with render tree #172

Open
bryphe opened this issue Dec 29, 2018 · 2 comments
Open
Labels
A-infrastructure Area: Project infrastructure, build system, Ci, website etc. enhancement New feature or request help wanted Extra attention is needed

Comments

@bryphe
Copy link
Member

bryphe commented Dec 29, 2018

This is from @jchavarri and @jordwalke 's ideas on the Discord channel. A key value proposition of Electron is that it's really easy to debug - you get a built-in debugger with Electron! Right now, we don't have anything equivalent in the revery world.

The idea Javier and Jordan had was that we could leverage the Chrome DevTools using either their integration API, or by creating pseudo-elements in the DOM and listen to mutation event

Potential Paths

Option 1: Integrate with the Chrome UI DevTools directly - Javier posted this link: https://www.chromium.org/developers/how-tos/inspecting-ash This documentation on the DevTools protocol looks helpful, too: https://chromedevtools.github.io/devtools-protocol/ This could open the door for inspecting Revery elements in the browser, as well as hooking up to other 'adapters' that speak the chrome debug protocol, like VSCode.

Option 2: Render pseudo-elements to the Chrome UI DevTools - Jordan showed how to create elements and then hook up mutation observers to essentially create a two-way sync.
image

These options aren't necessarily mutually exclusive; we could potentially use Option 1 for native and Option 2 for JSOO, for example!

Open Questions

  • Would it make sense to build this integration in revery or reason-reactify? The nice thing about it being in reason-reactify is that any consumer of that library could also benefit from the developer tools!
  • Would it be possible to open this elements panel directly while running revery - similiar to how you can open the developer tools in Electron? It seems like we could open a Chrome instance with a special URL that accesses devtools + a host/port where the revery debug adapter would be.
@bryphe bryphe added enhancement New feature or request help wanted Extra attention is needed labels Dec 29, 2018
@jordwalke
Copy link
Contributor

These options aren't necessarily mutually exclusive; we could potentially use Option 1 for native and Option 2 for JSOO, for example!

And I believe you could use either approach for either native or JS. It would all work with everything.

@bryphe bryphe changed the title Developer Experience: Use Chrome elements panel to interact with render treee Developer Experience: Use Chrome elements panel to interact with render tree Jan 3, 2019
@glennsl glennsl added the A-infrastructure Area: Project infrastructure, build system, Ci, website etc. label Nov 26, 2019
@zbaylin
Copy link
Member

zbaylin commented Feb 13, 2020

I'm going to try to kickstart some work on this.

I found this project by Facebook which does essentially the same thing for Android development: https://facebook.github.io/stetho/. The main thing I would want to look at would be how they port the view hierarchy over to the Chrome dev tools.

I also think we would need a websocket server. I found websocket, but I am not the best at LWT and it might take me a bit to familiarize myself with how the library works.

I'm very excited to see how this can turn out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-infrastructure Area: Project infrastructure, build system, Ci, website etc. enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants