Never miss a release that matters
AI-powered summaries of every GitHub release.
AI Summaries
Changelogs condensed into clear, actionable insights.
Always Free
Track up to 5 packages at no cost, forever.
Weekly Digest
A curated summary of every release, delivered weekly.
TL;DR
SWR now includes an unload() API to manually clear cached data.
New
unload()API (manually removes specific cache entries).
TL;DR
SWR now removes support for the downlevelIteration option, which may require code updates if you were explicitly setting this option.
Breaking
- Removed
downlevelIterationoption (controls older browser support).
Fixes Worth Knowing
- Fixed an issue where SWR could incorrectly unsubscribe from data updates, leading to stale data.
- Resolved a problem preventing promises from suspending correctly when data was already resolved.
- Corrected a bug related to data fetching in specific scenarios.
TL;DR
SWR now supports functional optimisticData, allowing for more dynamic and responsive UI updates when mutations occur.
New
- Functional
optimisticDataallows you to provide a function to calculate optimistic UI state (temporary UI state) during mutations.
Fixes Worth Knowing
- Fixed an issue where
suspenseandrevalidateIfStaledidn’t work correctly together. - Resolved a type error in
SWRConfig.
TL;DR
SWR now requires a return type when using the mutate function, improving type safety for data updates.
Breaking
mutatefunction requires a return type (ensures correct data handling).
New
None.
Fixes Worth Knowing
None.
Before You Upgrade
Update your mutate calls to explicitly define a return type to avoid TypeScript errors.
TL;DR
SWR now correctly handles revalidation on focus, improving data freshness when switching between tabs or windows.
Fixes Worth Knowing
Fixed an issue where SWR would not revalidate data when a window regained focus, leading to stale data in some scenarios.
TL;DR
SWR now exposes its internal cache, allowing developers more control over data management (data storage and retrieval).
New
- Exposed Cache: Developers can now directly access and manipulate SWR’s cache for advanced use cases like pre-fetching or custom invalidation strategies.