Change Log
Please visit the SWR release page for all history releases.
v2.5.1
Published on Wed Aug 12 2026.
Patches
- fix: hydrate cacheData for hooks without a fetcher by @yongsk0066 in https://github.com/vercel/swr/pull/4293
- fix: revalidate suspense cacheData on remount by @javascripter in https://github.com/vercel/swr/pull/4312
- fix: clean up completed subscription state by @iroiro147 in https://github.com/vercel/swr/pull/4310
Misc
- chore: bump version to 2.5.1 by @huozhi in https://github.com/vercel/swr/pull/4315
- chore: remove deprecated eslint config files by @abhiramvsmg in https://github.com/vercel/swr/pull/4308
New Contributors
- @abhiramvsmg made their first contribution in https://github.com/vercel/swr/pull/4308
- @yongsk0066 made their first contribution in https://github.com/vercel/swr/pull/4293
- @iroiro147 made their first contribution in https://github.com/vercel/swr/pull/4310
Full Changelog: https://github.com/vercel/swr/compare/v2.5.0...v2.5.1
v2.5.0
Published on Mon Aug 03 2026.
Features
RSC cache preloading
Preload data in React Server Components and pass it to client hooks through SWRConfig. This avoids a duplicate initial browser request and hydrates the result into the SWR cache. The new cacheData option is experimental.
https://github.com/vercel/swr/pull/4275
New unload() API
Use unload() to clear the entire SWR cache and discard in-flight requests and mutations. Mounted hooks revalidate by default, or you can pass { revalidate: false } to keep the cache empty until the next revalidation.
https://github.com/vercel/swr/pull/4298
Fixes
- Fixed the
swr/_internalReact Server export so it resolves correctly in the published package by @pengshenghai in https://github.com/vercel/swr/pull/4272
New Contributors
- @pengshenghai made their first contribution in https://github.com/vercel/swr/pull/4272
Full Changelog: https://github.com/vercel/swr/compare/v2.4.2...v2.5.0
v2.5.0-beta.1
Published on Wed Jul 15 2026.
Feature
- feat: unload() api by @huozhi in https://github.com/vercel/swr/pull/4298
Full Changelog: https://github.com/vercel/swr/compare/v2.5.0-beta.0...v2.5.0-beta.1
v2.5.0-beta.0
Published on Tue Jul 07 2026.
Features
- feat: rsc fetches and prefill swr cache by @huozhi in https://github.com/vercel/swr/pull/4275
Patches
- fix: point _internal react-server export at existing file by @pengshenghai in https://github.com/vercel/swr/pull/4272
New Contributors
- @pengshenghai made their first contribution in https://github.com/vercel/swr/pull/4272
Full Changelog: https://github.com/vercel/swr/compare/v2.4.2...v2.5.0-beta.0
v2.4.2
Published on Mon Jun 22 2026.
Patches
- fix: guard against double-unsubscribe removing wrong subscriber in cache.ts by @tomohiro86 in https://github.com/vercel/swr/pull/4252
- Prevent resolved promise to suspend due to missing status by @devjiwonchoi in https://github.com/vercel/swr/pull/4271
Chores
- Update axios versions in the examples by @lukesandberg in https://github.com/vercel/swr/pull/4243
- ci: switch npm publish to OIDC trusted publishing by @huozhi in https://github.com/vercel/swr/pull/4274
- ci: remove registry url by @huozhi in https://github.com/vercel/swr/pull/4277
- ci: update release job by @huozhi in https://github.com/vercel/swr/pull/4278
- 2.4.2 by @huozhi in https://github.com/vercel/swr/pull/4279
- chore: pin pnpm 10.33.0 by @styfle in https://github.com/vercel/swr/pull/4258
- ci: update GitHub Actions for Node 24 by @promer94 in https://github.com/vercel/swr/pull/4254
- chore: remove the axios examples by @huozhi in https://github.com/vercel/swr/pull/4263
New Contributors
- @lukesandberg made their first contribution in https://github.com/vercel/swr/pull/4243
- @tomohiro86 made their first contribution in https://github.com/vercel/swr/pull/4252
Full Changelog: https://github.com/vercel/swr/compare/v2.4.1...v2.4.2