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
Chrome's Custom Formatters #16505
Comments
Still no plan to do this on our end. I think my comment from January would still be relevant:
|
I think we’d consider a pull request though. If you’re interested. |
@gaearon Yes sure. Is there any guidelines on the new architecture of the dev tools? Trying to understand where to start looking at that. |
https://github.com/bvaughn/react-devtools-experimental/blob/source/OVERVIEW.md We’re also in the process of moving the code to React repo but haven’t managed yet. |
That PR is #16381 |
I saw that there was a similar issue about immutable.js that was fixed here: #16424 - it seems though the root cause was different. I was wondering if we could do something from ClojureScript’s side to follow the code path used for immutable JS, eg we could provide a “render” function that would return a proper JS object at inspection time. |
I just want to add that there is currently a workaround via "Store as global variable". This delegates value to Chrome DevTools which causes the value to be re-rendered with custom formatters applied (if enabled). But I agree that this is doable and would be a great improvement in React Devtools not only for ClojureScript developers - but anyone who relies on custom formatters for debugging (e.g. Immutable.js). My original comment still holds. A rewrite of JsonML renderer from Chrome DevTools is not that difficult IMO. The hairy part is to manage styles to achieve the same look. The HTML code generated by custom formatters relies heavily on ambient CSS present in Chrome DevTools Console (at least in case of cljs-devtools). React DevTools would have to try to emulate it and properly sandbox custom formatted html code and firewall those styles not to bleed into surrounding React DevTools UI. |
Do you want to request a feature or report a bug?
Feature
Transferring feature request from the old repo facebook/react-devtools#989
Hi! Is there any plans on supporting Chrome's custom formatters to display custom data structures in readable format in React dev tools?
For example when debugging ClojureScript's immutable data structures we have a custom formatter that outputs data into the console in readable and inspectable format.
Here how it looks like
And here's how data looks like in React Dev Tools inspector (basically underlying implementation of a data structure as seen in plain JS)
I think this can be done for React Dev Tools since once Custom Formatters are defined they are applied everywhere in Chrome's Dev Tools where it's possible to inspect data.
The text was updated successfully, but these errors were encountered: