bvaughn / react-devtools-experimental

Experimental rewrite of the React DevTools extension
https://react-devtools-experimental.now.sh
MIT License
965 stars 55 forks source link

Document/allow custom panel/extensions #380

Closed rescribet closed 5 years ago

rescribet commented 5 years ago

We'd like to show additional information in the devtools (when a certain prop is available), it would be neat if the running application could provide some additional debugging views in the right pane without needing to recompile the devtools.

I'm not sure views are shareable between the render thread and the extension, but just being able to provide a plain object like the current props view would already be really helpful

E.g.

__REACT_DEVTOOLS_GLOBAL_HOOK__.addPanel('My library info', (props, ref) => {
  const customLibraryResult = someLibrary.process(props.example)

  return {
    question: 'Will be visible in the devools?',
    answer: customLibraryResult // true
  }
})
bvaughn commented 5 years ago

This doesn't sound like a feature we would want to support. Extensions APIs add a lot of maintenance and release complexity.

We can continue to chat about it here, but I'm going to close the issue for now because I don't think we'll take any action on it.