Open
Bug 1257548
Opened 9 years ago
Updated 2 years ago
There should be a way for extensions to register a new rep
Categories
(DevTools :: Shared Components, defect, P3)
DevTools
Shared Components
Tracking
(Not tracked)
NEW
People
(Reporter: Honza, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [btpp-backlog])
User Story
User Story As a web developer who is using a javascript framework I would like the console to format the logged framework objects with my custom formatters such that I see nicely formatted object data instead of the raw JavaScript objects. Acceptance Criteria * Compatibility with the Chrome Custom Formatters API * Recognize custom formatters registered on the page * Log a console message acknowledging the custom formatter has been registered * Use the custom formatters to format the log messages they match
JSON View and DOM panel are rendering JS/DOM types using set of components called Reps.
devtools/client/shared/components/reps
There should be a way for extensions to register a new rep that renders custom data types like e.g. those coming from custom JS libraries (e.g. one for jQuery object etc.)
Honza
Comment 1•9 years ago
|
||
We should take a look at chrome's "custom formatters" API here https://docs.google.com/document/d/1FTascZXT9cxfetuPRT2eXPQKXui4nWFivUnS_335T3U/preview and see how that relates to reps. It's a way for framework authors to define custom outputters for objects by setting a window.devtoolsFormatters object, like https://github.com/andrewdavey/immutable-devtools.
Reporter | ||
Comment 2•9 years ago
|
||
Thanks for the link!
Yes, this is very interesting, it's been around at least for about a year (here is the doc I have mentioned at our meeting: https://docs.google.com/document/d/1FTascZXT9cxfetuPRT2eXPQKXui4nWFivUnS_335T3U/edit#heading=h.xuvxhsd2bp05) and it looks like getting more and more attention.
An existing application of custom formatters:
https://github.com/binaryage/dirac
Honza
Comment 3•9 years ago
|
||
Adding user story.
Note that I'm requesting we log a message to the console with something like:
"Custom Log formatter registered" such that our users are aware of DevTools using the formatters. I think it will be helpful when you're looking at the production site which accidentally shipped with the formatters and when you thought you included the formatters but actually didn't.
User Story: (updated)
Priority: -- → P3
Whiteboard: [btpp-backlog]
Component: Developer Tools: Framework → Developer Tools: Shared Components
Discussed in Github too https://github.com/devtools-html/devtools-core/issues/392
Comment 5•7 years ago
|
||
This would also be useful for clojurescript development.
Updated•6 years ago
|
Product: Firefox → DevTools
Comment 6•5 years ago
|
||
Any news on this one?
Reporter | ||
Comment 7•5 years ago
|
||
Still not on our roadmap, sorry.
Honza
Comment 8•5 years ago
|
||
In case people want to see this faster, please comment here or ping me with your specific use cases.
Comment 9•5 years ago
|
||
I would love to be able to use cljs-devtools in Firefox. It relies on the custom formatters api in Chromium to translate the pretty unusable raw JS data structures into pretty-printed Clojurescript ones.
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•