更新日志
请访问 SWR release page 查看所有的历史版本。
v2.6.0-beta.0
发布于 Tue Sep 22 2026.
Feature
- Add cache tag revalidation support by @WITS in https://github.com/vercel/swr/pull/4336
Misc
- [ci] add prevent deployment config by @huozhi in https://github.com/vercel/swr/pull/4326
- Chore: Fix X handle link by @shuding in https://github.com/vercel/swr/pull/4334
New Contributors
- @WITS made their first contribution in https://github.com/vercel/swr/pull/4336
Full Changelog: https://github.com/vercel/swr/compare/v2.5.1...v2.6.0-beta.0
v2.5.1
发布于 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
发布于 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
发布于 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
发布于 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 <a href="https://github.com/pengshenghai" target="blank" rel="noopener">@pengshenghai</a> 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