Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Bump swr from 0.5.6 to 1.2.0#64

Closed
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/npm_and_yarn/swr-1.2.0
Closed

Bump swr from 0.5.6 to 1.2.0#64
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/npm_and_yarn/swr-1.2.0

Conversation

@dependabot
Copy link

@dependabot dependabot bot commented on behalf of github Feb 1, 2022

Bumps swr from 0.5.6 to 1.2.0.

Release notes

Sourced from swr's releases.

1.2.0

Highlights of This Release

Optimistic Updates with Auto Error Rollback

There are now some new options in mutate:

mutate(patchUser(user), {
  optimisticData: user,
  populateCache: true,
  rollbackOnError: true,
  revalidate: true,
})

Here the cache will be immediately updated to user, the “optimistic value”. And then a request (remote mutation) is started via patchUser(user) and the response will be written to the cache. If that request fails, the original result will be rolled back safely so the optimistic value will be gone. And after all those finish, a revalidation will start to fetch the latest value.

This is extremely helpful for building the optimistic UI pattern.

You can do the same for the global mutate, just remember to pass the key. Also, the current mutate APIs stay unchanged so mutate(data, false) works the same.

Here's an example: https://codesandbox.io/s/swr-basic-forked-k5hps.

CleanShot.2022-01-27.at.15.39.58.mp4

.mjs Support

SWR now has .mjs exported for bundlers that prefer this format.

This doesn’t break environments that don’t support .mjs. An alternative .esm.js and CJS bundle are also published.

You can read more about ES modules here.

What's Changed

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [swr](https://github.com/vercel/swr) from 0.5.6 to 1.2.0.
- [Release notes](https://github.com/vercel/swr/releases)
- [Commits](vercel/swr@0.5.6...1.2.0)

---
updated-dependencies:
- dependency-name: swr
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@vercel
Copy link

vercel bot commented Feb 1, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/gssequence/population-graph/2DbTWdVauCFY8U6EPTi4n98FznyJ
✅ Preview: https://population-graph-git-dependabot-npmandyarnswr-120-gssequence.vercel.app

@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Feb 1, 2022
@dependabot dependabot bot mentioned this pull request Feb 1, 2022
@dependabot @github
Copy link
Author

dependabot bot commented on behalf of github Mar 1, 2022

Superseded by #72.

@dependabot dependabot bot closed this Mar 1, 2022
@dependabot dependabot bot deleted the dependabot/npm_and_yarn/swr-1.2.0 branch March 1, 2022 03:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants