Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

recursive entry grouping for huge collections #35

Merged
merged 2 commits into from
Mar 7, 2016
Merged

recursive entry grouping for huge collections #35

merged 2 commits into from
Mar 7, 2016

Conversation

alexkuz
Copy link
Owner

@alexkuz alexkuz commented Feb 27, 2016

(there's a lot of changes, I'm sorry for that, it probably shouldn't be in one PR)

  • If Object, Array or Iterable has more than collectionLimit entries (50 by default), only collectionLimit entries are shown, the rest are grouped recursively (so than not more than collectionLimit groups are shown). If collectionLimit = 0, all items are shown.

Example screencast (as a part of redux-devtools-inspector):

json

  • Added prop postprocessValue(value) (identity by default): allows to replace value on rendering. Useful for huge collections, as there is no need to traverse all entries, just the ones that are rendered.
  • Added prop isCustomNode(value) (returns false by default): if returns true, item is rendered via JSONValueNode, which allows to render custom component for any type of item (not just literals). Should be used with valueRenderer.
  • Objects with circular references are never expanded by default, even with expandAll = true.
  • Some refactoring :)

@alexkuz
Copy link
Owner Author

alexkuz commented Feb 27, 2016

btw, I'm not good at naming things, so if it's confusing, I would be glad to hear your suggestions :)
@gaearon

@alexkuz
Copy link
Owner Author

alexkuz commented Feb 29, 2016

@chibicode please take a look!
I should warn though, it will break other PRs, because of refactoring.
But I really need it for https://github.com/alexkuz/redux-devtools-inspector :)

@chibicode
Copy link
Contributor

@alexkuz I will asap, sorry I've been gone in Lake Tahoe last week

@gaearon
Copy link
Collaborator

gaearon commented Mar 6, 2016

From a very cursory glance this looks 👍 to me.

chibicode added a commit that referenced this pull request Mar 7, 2016
recursive entry grouping for huge collections
@chibicode chibicode merged commit 38d7c1c into alexkuz:master Mar 7, 2016
@chibicode
Copy link
Contributor

Merged! @alexkuz I didn't get to read getCollectionEntries carefully, but I added you as a collaborator just in case you wanted to make further changes. (Also, thanks @gaearon for reviewing, I added you as a collaborator too, if you don't mind)

@chibicode
Copy link
Contributor

@alexkuz published 0.6.0. I'll try to merge other PRs and publish 0.6.1 but not sure when I'll get to that

@chibicode
Copy link
Contributor

@alexkuz trying to figure out how to incorporate this PR after the refactoring - could you help me out? https://github.com/chibicode/react-json-tree/pull/36/files

@alexkuz
Copy link
Owner Author

alexkuz commented Mar 8, 2016

Thanks!
I'm not sure if that PR is still relevant - @leonaves, would you take a look? (if it is, would be helpful to see an example)

@leonaves
Copy link

leonaves commented Mar 9, 2016

From what I've seen it's not an issue that's affecting react-devtools-inspector anymore, but I'm not sure if that's because of these changes or what you've changed in rdi (i.e. it may be an issue that could still affect someone using react-json-tree). I'll take a look tonight and get back asap.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants