-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
(graphcache) - Implement RFC for optimistic behavior enhancements #750
Conversation
Set<string> => Record<string, true>
🦋 Changeset is good to goLatest commit: 2648544 We got this. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
c1c7e22
to
4c7cc93
Compare
a32ef53
to
3cdb60b
Compare
Both new strategies seem to be working. It's pretty exciting how this makes both aspects of optimistic mutations (refetching while they're active, and settling with/without optimistic updates) more intuitive. This branch only needs some new unit tests. |
3cdb60b
to
bc20f8a
Compare
The semaphore map isn't necessary anymore as all optimistic mutation results are flushed at the same time.
Previously we called clearLayer when clearing an optimistic mutation result batch, which may erase existing mutation result data. This shouldn't be possible but we can account for duplicate mutation results this way and also stop exposing clearLayer.
2215228
to
398254f
Compare
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 refactor paired with this is awesome
Guys, as explained here I created a new CodeSandbox with an entire CRUD! We can test on it this amazing work! (I'll in a few minutes, I'm on smartphone). Thank you guys! 😄 |
From the first tests everything seems to work! 🥳 |
This has been released in |
Summary
This PR implements both recommendations from RFC #747.
These changes have been validated and tested so far against @frederikhors' unexpected behaviour reproductions in CodeSandboxes:
Set of changes
Set<string>
totype Dependencies = Record<string, true>
Dependencies
)executePendingOperations
to trigger refetch for previously blockedcache-and-network
operations