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

Avoid using DepTrackingCache for optimistic reads. #4251

Merged
merged 8 commits into from
Dec 19, 2018

Commits on Dec 19, 2018

  1. Avoid DepTrackingCache for optimistic reads.

    This should help with #4210, since temporary optimistic ObjectCache
    objects will no longer be instanceof DepTrackingCache, so the result
    caching system will be disabled for those reads, and thus the temporary
    objects will not be retained in any cache keys:
    
    https://github.com/apollographql/apollo-client/blob/7d0ed16a97e57cb3789f352fd4f359eaaa2eec0b/packages/apollo-cache-inmemory/src/readFromStore.ts#L123
    
    https://github.com/apollographql/apollo-client/blob/7d0ed16a97e57cb3789f352fd4f359eaaa2eec0b/packages/apollo-cache-inmemory/src/readFromStore.ts#L144
    benjamn committed Dec 19, 2018
    Configuration menu
    Copy the full SHA
    56c5dcb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b1ac9ef View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    307c8c9 View commit details
    Browse the repository at this point in the history
  4. Allow disabling InMemoryCache result caching.

    Although this is a rather drastic option, creating an InMemoryCache that
    does not attempt to cache previous results may help reduce memory usage,
    at the expense of cache performance on repeated reads:
    
      new InMemoryCache({
        resultCaching: false, // defaults to true
      })
    
    See this comment by @barbalex for one such situation:
    #4210 (comment)
    
    At the very least, this option should help diagnose problems with result
    caching, even if it's not the right long-term solution.
    benjamn committed Dec 19, 2018
    Configuration menu
    Copy the full SHA
    cfc8fdf View commit details
    Browse the repository at this point in the history
  5. Remove extremely frustrating auto-git add behavior from lint-staged.

    Anyone who uses `git add -p` or `git commit -p` to contruct their commits
    from a careful subset of current changes has been bitten by this
    thoughtless policy many times. I'm done working around it.
    benjamn committed Dec 19, 2018
    2 Configuration menu
    Copy the full SHA
    d5a9dd1 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c9a5370 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    9b828e1 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f25c0dd View commit details
    Browse the repository at this point in the history