Skip to content
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

Add option to limit arrays and objects #104

Closed
wants to merge 1 commit into from
Closed

Add option to limit arrays and objects #104

wants to merge 1 commit into from

Conversation

MikeAlOwe-CodeSignal
Copy link
Contributor

There have been issues reported regarding the browser hanging when logging certain objects/arrays #87 #91. After some investigation it seems the size of the objects/arrays is the problem since console-feed had to iterate through everything to serialize it and the browser faced trouble when rendering them.
I added an option to limit the size of the objects and arrays so that we only serialize the data to a certain point.
I had to also make it transparent that the logged data was truncated and include in the serialized data how many remaining items there are and display the logged data correctly (like the array length).
The implementation is a bit hacky since react-inspector doesn't support limiting and I had to do a few workarounds to render everything.

Example of setting the limit to 10:
Screen Shot 2022-06-17 at 16 42 52

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant