Open Kikobeats opened 8 years ago
Maybe this options is implemented and I didn't find how to enable it.
It is not implemented. At the moment, we don't have the contextual information like depth
of the element.
N
level ?max
level If we provide support for N
levels? ( Remember, we will lose lazy rendering of elements upto N
levels). There is a performance issue for rendering some big objects with more than one self aliases when N
is big. (e.g. global
with GLOBAL
, global
and root
aliases)console output
and global environment
section ?[Off topic] I suggest to use regex viewer for the above example.
Actually I don't know how prints in the REPL is implemented, but I think that util.inspect (depth
option) could be useful for do it:
https://nodejs.org/api/util.html#util_util_inspect_object_options
This code is an example of copy/paste from internet. Although your offtopic is great sugar for the REPL, you need think that (IMHO) copy/paste is a universal driven development 😛.
@Kikobeats As per current implementation, there is no depth limit as such. Its lazy and therefore, the stack won't grow and is fast since we are serving nested object's view only when the user interested in viewing it. Configuration for top level auto expansion is good option. 👍 I don't see issues in carrying depth info around while building object tree.
Hmm but click in ">" is more a frontend issue, or how to resolve it?
@princejwesley I think it is a good idea to expand and show the result up to 2 levels. This should also be driven only through a setting. It is also good to have depth setting for console. Yes we can ignore depth support for Regex, Charts and Buffers
@Kikobeats >
carries a initial state that has to be toggled based on the configuration and pass on the current depth + 1
level to its immediate children.
Only problem is, we should limit the max depth
level(may be 5
or 8
).
Reasons are,
util#inspect
case, util#inspect
does know the circular references. In our case, objects are free and are built recursively on demand). Would it be possible to implement this? How difficult is it? It would be really useful!
Maybe this options is implemented and I didn't find how to enable it.
Basically instead of write something and click in the object return to be expanded, expanded automatically:
Maybe could be possible setup a N depth level in settings