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

(graphcache) - Reimplement default-storage serializer/deserializer #866

Merged
merged 6 commits into from
Jun 14, 2020

Conversation

kitten
Copy link
Member

@kitten kitten commented Jun 14, 2020

Resolve #864

Summary

This fixes an issue where deleted values wouldn't be persisted correctly, since the default-storage serializer coerced both null and undefined to "null" JSON values. The @urql/exchange/default-storage implementation now comes with a new serializer which is incompatible with the old one but should be faster and more correct. It's incompatible with the old one, so the default idbName has been bumped to graphcache-v4.

Set of changes

  • Prevent optimistic layers from queueing up unnecessary keys onto the data.persist set
  • Implement a new serializer and deserializer on default-storage

@changeset-bot
Copy link

changeset-bot bot commented Jun 14, 2020

🦋 Changeset is good to go

Latest commit: 0d11c8f

We got this.

This PR includes changesets to release 1 package
Name Type
@urql/exchange-graphcache Patch

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

@kitten kitten requested a review from JoviDeCroock June 14, 2020 18:12
Copy link
Collaborator

@JoviDeCroock JoviDeCroock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 💯

@kitten kitten force-pushed the fix/optimistic-persistence branch 2 times, most recently from 826aecf to bf9fcd1 Compare June 14, 2020 18:23
@kitten kitten force-pushed the fix/optimistic-persistence branch from bf9fcd1 to 0d11c8f Compare June 14, 2020 18:23
@frederikhors
Copy link
Contributor

I can't wait to try it!

@frederikhors
Copy link
Contributor

Tried with codesandbox tar package. IT WORKS!!! :)

@kitten kitten merged commit 147e628 into master Jun 14, 2020
@kitten kitten deleted the fix/optimistic-persistence branch June 14, 2020 19:14
@frederikhors
Copy link
Contributor

Will you release soon?

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.

With makeDefaultStorage and offlineExchange: error: "Cannot read property '0' of null"
3 participants