Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 a "memory management" documentation page #11415
add a "memory management" documentation page #11415
Changes from 1 commit
4db8159
23eda87
5c6e6af
47158ba
9d8562f
76d6fdb
21f8eea
08fe05d
01962e0
74a3ba5
5415d52
9969c07
d21e117
873c1c5
46a318a
ada5348
0f5841c
3ac76cf
106510f
b4dfd1e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a relevant link for "understand data flow inside Apollo Client" to give folks a sense of what they need to know?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That really should be an intro to the next paragraph that tries to give that overview :/ Do you have any idea how to bring that out better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. Well the next sentences describe the source types, but the "data flow" part is unclear for me. Is that what's described when talking about transforming inputs to outputs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "base value" the same as a default value? Is there a unit we can provide?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unit is "whatever we put into the cache" - we maybe could say "objects" of "cached values".
"Base value" here is the value we use to scale all other values of:
1000 for caches using user-provided DocumentNodes -> 2000 or 4000 for transformed ones.
For a base value of 500 it would be
500 for caches using user-provided DocumentNodes -> 1000 or 2000 for transformed ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, will put in a suggestion that reflects this info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't let me leave a comment on the line above, but I would suggest something like this:
You should choose cache sizes appropriate for storing a reasonable number of values rather than every value. To prevent too much recalculation, choose cache sizes that are at least large enough to hold memoized values for all hooks/queries on the screen at any given time.