Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Include DevTools as Public API #4593
The idea is to have a multi-version extension that allow you to attach a "debugger" to a running React instance. This debugger protocol injects intercepted functions into a particular version of React which exposes development hooks.
This is not intended to expose stateful reflection APIs in production use since it will negatively affect performance.
referenced this issue
Aug 10, 2015
+1 this is really interesting. I'm currently developing a tool that intends to be a react devtools extension so I would love to have this possible.
Any WIP on this? Maybe I can help. However I don't have a good knowledge of the React source code and where to start looking at.
I'm very interested in this.
With the advent of stateless components there's no easy way for my library to get internal instance of the root component to traverse the tree and force update it.
The important part for me is that multiple tools should be able to hook up to this API. Both DevTools and my library should be able to register independently without interfering with each other.
Would you like me to propose a straw man API based on what DevTools uses now?
Yes please. The new devtools was designed with this in mind.
We would like to move the integration part into React's core and expose that API.
The key to this design is that React should not need to maintain any state itself. Other than the component state. The API could force a complete rerender to get a replay of changes but the API should not require React keeping the previous render in memory.
I'm not certain whether this can be done in a way that doesn't impact performance, but I thought I'd mention this for what it's worth. It'd be really nice to be able to debug a production react application. Angular does this by setting