JoshMarler / react-juce

Write cross-platform native apps with React.js and JUCE
https://docs.react-juce.dev
MIT License
765 stars 79 forks source link

Implement Hermes debugger support #240

Open JoshMarler opened 3 years ago

JoshMarler commented 3 years ago

Hermes supports the chrome debugger protocol along with some profiling tools. Lets see how far we can take this. Can we get react-dev-tools working for example ...

Should ideally work using the same experience as the current Duktape debug integration, i.e. CMD-D starts the debugger and awaits client attach.

JoshMarler commented 3 years ago

Turns out we'll need to implement the chrome debug/inspector protocol as is done in ReactNative so this will be a non-trivial integration.

See: https://github.com/facebook/hermes/issues/486

zigen commented 3 years ago

FYI I tried react-dev-tools and it works (sometime it's buggy and too old version of react-juce). I hope this will help you. https://github.com/zigen/blueprint/compare/7d5d776...devtools

update: I found a screenshot and I draw the slide to describe the internal architecture Screen Shot 2020-11-02 at 0 17 09

https://docs.google.com/presentation/d/1F-Fpp_nRZRTSsvWRra41AH5smLbJGOFShcSluUs577Q/edit?usp=sharing

JoshMarler commented 3 years ago

@zigen ahh that's awesome! I'll take a look over your branch and try to digest some of this. react-dev-tools isn't something I know a huge amount about but I'd love to see it available for profiling render cycles etc.

nick-thompson commented 3 years ago

@zigen you're a hero 🙏 ! I haven't looked to closely at your code yet, but at a quick first pass this seems very much like something we could integrate upstream here

zigen commented 3 years ago

Thanks for quick replies! If I have a time, I want to merge into upstream, but perhaps I will be busy. Anyone can copy/edit my code as you need.

When I tried, I was so confused because there're few document about react-devtools, so I drew a sketch. now I remember it and rewrite it as a google slide. If you have a question, please ask here or comment to my slides

https://docs.google.com/presentation/d/1F-Fpp_nRZRTSsvWRra41AH5smLbJGOFShcSluUs577Q/edit?usp=sharing