-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Include DevTools as Public API #4593
Comments
+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. https://github.com/facebook/react-devtools/tree/master/backend/integration 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 |
Is this still something that is being discussed? How's it coming along? I'm not familiar with the React codebase really but I would love to contribute and I'm searching for a place to start that I may understand. |
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.
Effectively this: https://github.com/facebook/react-devtools/tree/devtools-next/backend/integration
This is not intended to expose stateful reflection APIs in production use since it will negatively affect performance.
The text was updated successfully, but these errors were encountered: