chore(deps): update dependency swr to v2 #249
Open
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.
This PR contains the following updates:
^1.0.0
->^2.0.0
Release Notes
vercel/swr (swr)
v2.2.5
Compare Source
Patches
Misc
New Contributors
Full Changelog: vercel/swr@v2.2.4...v2.2.5
v2.2.4
Compare Source
Patches
index.js
suffix ofuse-sync-external-store/shim
to support React Native" by @huozhi in https://github.com/vercel/swr/pull/2802Full Changelog: vercel/swr@v2.2.3...v2.2.4
v2.2.3
Compare Source
Patches
index.js
suffix ofuse-sync-external-store/shim
to support React Native by @malash in https://github.com/vercel/swr/pull/2767Misc
New Contributors
Full Changelog: vercel/swr@v2.2.2...v2.2.3
v2.2.2
Compare Source
What's Changed
ArgumentsTuple
by @Andarist in https://github.com/vercel/swr/pull/2761New Contributors
Full Changelog: vercel/swr@v2.2.1...v2.2.2
v2.2.1
Compare Source
What's Changed
revalidate
to supportparallel
option by @promer94 in https://github.com/vercel/swr/pull/2727New Contributors
Full Changelog: vercel/swr@v2.2.0...v2.2.1
v2.2.0
Compare Source
What's Changed
React.use
API by @himself65 in https://github.com/vercel/swr/pull/2596startTransition
so mutation hook could update immediately by @promer94 in https://github.com/vercel/swr/pull/2654useSWRMutation
type. by @promer94 in https://github.com/vercel/swr/pull/2604New Contributors
Full Changelog: vercel/swr@v2.1.5...v2.2.0
v2.1.5
Compare Source
What's Changed
Full Changelog: vercel/swr@v2.1.4...v2.1.5
v2.1.4
Compare Source
What's Changed
New Contributors
Full Changelog: vercel/swr@v2.1.3...v2.1.4
v2.1.3
Compare Source
What's Changed
Data
foruseSWRSubscriptionOptions
by @promer94 in https://github.com/vercel/swr/pull/2551New Contributors
Full Changelog: vercel/swr@v2.1.2...v2.1.3
v2.1.2
Compare Source
Patches
swr/subscription
SWRSubscriptionOptions
type forswr/subscription
Changes
useSWRSubscription
types by @promer94 in https://github.com/vercel/swr/pull/2535New Contributors
Full Changelog: vercel/swr@v2.1.1...v2.1.2
v2.1.1
Compare Source
Patches
data
type for defaultSWRConfig
generic type by @connorch in https://github.com/vercel/swr/pull/2506Documentation
New Contributors
Full Changelog: vercel/swr@v2.1.0...v2.1.1
v2.1.0
Compare Source
v2.0.4
Compare Source
Patches
Misc
New Contributors
Full Changelog: vercel/swr@v2.0.3...v2.0.4
v2.0.3
Compare Source
Patches
Chores
-
characters in README.md by @JanKaifer in https://github.com/vercel/swr/pull/2334New Contributors
Full Changelog: vercel/swr@v2.0.2...v2.0.3
v2.0.2
Compare Source
Patches
Chores
Full Changelog: vercel/swr@v2.0.1...v2.0.2
v2.0.1
Compare Source
In this patch release, we majorly improved typing support and SWR can infer the types based on the configuration.
suspense
option istrue
, the returneddata
will excludeundefined
and theisLoading
will always befalse
.fallbackData
option is provided, the returneddata
will be the same type offallbackData
, and theisLoading
will always befalse
.Here's a demo for it:
swr-2.0.1.mp4
What's Changed
New Contributors
Full Changelog: vercel/swr@2.0.0...v2.0.1
v2.0.0
Compare Source
Announcing SWR 2.0
We are excited to announce the release of SWR 2.0! The new version comes with a lot of improvements:
And more!
Read our blog post and migration guide: https://swr.vercel.app/blog/swr-v2
What's Changed
isLoading
state and refactor the core by @shuding in https://github.com/vercel/swr/pull/1928keepPreviousData
option by @shuding in https://github.com/vercel/swr/pull/1929throwOnError
option by @shuding in https://github.com/vercel/swr/pull/2182New Contributors
Full Changelog: vercel/swr@1.2.2...2.0.0
v1.3.0
Compare Source
What's Changed
Full Changelog: vercel/swr@1.2.2...1.3.0
v1.2.2
Compare Source
Highlights of This Release
populateCache
Option Now Supports FunctionWe added better Optimistic UI support in v1.2.0. However, what if your API is only returning a subset of the data (such as the mutated part), that can be populated into the cache? Usually, an extra revalidation after that mutation is needed. But now you can also use a function as
populateCache
to transform the mutate result into the full data:The new definition:
Here is a demo for it: https://codesandbox.io/s/swr-basic-forked-hi9svh
Bug Fixes
What's Changed
populateCache
as a function by @shuding in https://github.com/vercel/swr/pull/1818Full Changelog: vercel/swr@1.2.1...1.2.2
v1.2.1
Compare Source
Highlights of This Release
shouldRetryOnError
accepts a functionPreviously
shouldRetryOnError
is either true or false. Now it accepts a function that conditionally determines if SWR should retry. Here's a simple example:Thanks to @sairajchouhan for contributing!
What's Changed
shouldRetryOnError
accepts a function that can be used to conditionally stop retrying by @sairajchouhan in https://github.com/vercel/swr/pull/1816New Contributors
Full Changelog: vercel/swr@1.2.0...1.2.1
v1.2.0
Compare Source
Highlights of This Release
Optimistic Updates with Auto Error Rollback
There are now some new options in
mutate
:Here the cache will be immediately updated to
user
, the “optimistic value”. And then a request (remote mutation) is started viapatchUser(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 currentmutate
APIs stay unchanged somutate(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
SupportSWR 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
Configuration
📅 Schedule: Branch creation - "every weekend" in timezone Asia/Tokyo, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.