-
Notifications
You must be signed in to change notification settings - Fork 23
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
How to render primitives with the "%o" specifier #31
Comments
Is the problem really the word "expandable"? I mean, documenting and agreeing on format specifiers and their basic meaning does seem key to me. As a developer I may care about seeing the object nature or the element nature of something - different tools could make that expandable or tree view or treetable or lots of things, but I do think I want to express 'this is the data I'm interested in', no? |
I guess I'm mainly viewing the spec as the contract between the console.* and the developer. Not between the tool, page and the developer. So, I think it's the idea in general as the one sentence implies two things for the console UI:
I think documenting what the expected object type for After all in some scenarios it might be different. For example in IE if you were to log the object before the tools were open (and had console logging always on) we would serialize the entire message as a string. That way we don't have to keep the object alive for inspection or store enough data to enable a tree view. In IE10 of the tools we didn't have a tree view so instead had a "Add watch" button to the end of the console view which would add a watch in the debugger that was expandable. Or another example of a different UI is for logging. Internally we have some tools that record the console messages (as strings) to file which is compared later on and folk use that in various automated testing scenarios. Basically there's lots of awesome to be had from console.log and it's fine to have example visualizations but developers expectations of what they see in the tool should be set by the tool. |
I understand "expandable" as "in detailed view mode". We don't have any details to offer for primitives, and that's my point. Also maybe Andy has made a good point with this argument:
Is that something we should explain in the spec? Florent |
The spec says:
But is that relevant to display the properties of a primitive?
FWIW, Firebug and the Chrome DevTools print the representations of the primitives rather an object view:
Same question for the "%O" specifier, BTW. Currently, the only implementation (AFAIK) that follows the spec is the Chrome DevTools and seem to display the primitives with an expand icon (though they don't show any properties).
Thoughts?
Florent
The text was updated successfully, but these errors were encountered: