惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
Vercel News
Vercel News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
量子位
Y
Y Combinator Blog
IT之家
IT之家
博客园 - 聂微东
L
LangChain Blog
爱范儿
爱范儿
H
Help Net Security
GbyAI
GbyAI
F
Fortinet All Blogs
B
Blog
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
C
Check Point Blog
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
D
DataBreaches.Net
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
宝玉的分享
宝玉的分享

TanStack Blog

TanStack + Vercel Partnership | TanStack Blog TanStack AI Enters the RC Phase | TanStack Blog Inside a TanStack Router Navigation | TanStack Blog Form v2 is here: All you need to know about the alpha | TanStack Blog Announcing TanStack Table V9 | TanStack Blog TanStack Has a New Look | TanStack Blog Introducing TanStack Markdown and TanStack Highlight | TanStack Blog We Removed React Server Components from TanStack.com | TanStack Blog We Stopped Using RSC on TanStack.com | TanStack Blog Inside TanStack Table V9 Reactivity | TanStack Blog Run Any Coding Agent in a Sandbox, With One chat() Call | TanStack Blog TanStack Start and TanStack AI Win 2026 Open Source Awards | TanStack Blog How an Underrated Refactor Saved 90% Memory Usage | TanStack Blog TypeScript Performance in TanStack Table V9 | TanStack Blog TanStack AI Beta: The Switzerland of AI Tooling Grows Up | TanStack Blog TanStack Table V9: Taking Form | TanStack Blog TanStack AI: Your MCP, your way | TanStack Blog TanStack Start Adds First-Class Rsbuild Support | TanStack Blog Introducing Experimental Workflows and Orchestrators in TanStack AI | TanStack Blog Chat UIs Are Lists Until They Aren't | TanStack Blog Structured Output That Remembers Across Turns | TanStack Blog TanStack Virtual just got a lot faster, and finally handles iOS | TanStack Blog TanStack AI now fully speaks AG-UI | TanStack Blog Stop Waiting on JSON: Stream Structured Output with One Schema | TanStack Blog Hardening TanStack After the npm Compromise | TanStack Blog Postmortem: TanStack npm supply-chain compromise | TanStack Blog Who Owns the Tree? RSC as a Protocol, Not an Architecture | TanStack Blog TanStack AI Just Learned to Compose Music | TanStack Blog Your AI Tool Calls Should Fail at Compile Time, Not in Production | TanStack Blog One Flag, Every Chunk: Debug Logging Lands in TanStack AI | TanStack Blog
Announcing TanStack Query v5 | TanStack Blog
Dominik Dorfmeister · 2023-10-17 · via TanStack Blog

by Dominik Dorfmeister on Oct 17, 2023.

About one year ago, we announced the TanStack Query v5 roadmap, and the whole team has been working hard on that version ever since. So we're super happy to announce that today is the day: After 91 alpha releases, 35 betas and 16 release candidates, TanStack Query v5.0.0 is finally here! 🎉

v5 continues the journey of v4, trying to make TanStack Query smaller (v5 is ~20% smaller than v4), better and more intuitive to use. One of the main focus points for this release was around streamlining and simplifying the APIs we offer:

As a big breaking change, we've removed most overloads from the codebase, unifying how you use and other hooks. This is something we wanted to do for v4, but a TypeScript limitation prevented us from doing that. TypeScript addressed this issue in TS 4.7, so we were able to remove all the overloads that we had for calling with a different amount of parameters. This is a huge DX win, because methods with overloads usually have quite bad TypeScript error messages.

This is the biggest breaking change in v5, but we think it's worth it. The API is now much more consistent - you always just pass one object. To alleviate the pain of changing all occurrences manually, we have tried to prepare everyone for this coming change for the last months. The documentation was changed to use the new API, and we released an auto-fixable eslint rule in our eslint package. Additionally, v5 comes with a codemod to help with the transition.

Apart from that, we've renamed to to better reflect what it is doing, merged with , renamed states to and removed the callbacks from . All these changes make v5 the most consistent and best version for new starters.

To read more about the breaking changes, have a look at our migration guide.

Of course, v5 comes loaded with amazing new features as well 🚀:

Simplified optimistic updates

Enjoy a brand new, simplified way to perform optimistic updates by leveraging the returned from , without having to write code that updates the cache manually. For more details, have a look at the optimistic updates documentation

Sharable mutation state

A frequently requested feature, as seen in this two-year-old issue, finally comes to life in v5: You can now get access to the state of all mutations, shared across components thanks to the new useMutationState hook.

1st class support

That's right - for data fetching is no longer experimental, but fully supported. React Query ships with new , and hooks. Have a look at the suspense docs to learn about the differences to the non-suspense versions.

Streaming with React Server Components

v5 also comes with an experimental integration for suspense on the server in nextJs, unifying the best of both worlds: The react-query-next-experimental adapter allows us to write a single , which will initiate data fetching as early as possible: on the server, during SSR. It will then stream the result to the client, where it will be put into the cache automatically, giving us all the interactivity and data synchronization of React Query.

Improved Infinite Queries

Infinite Queries can now prefetch multiple pages at once, and you have the option to specify the maximum amount of pages stored in the cache as well.

New Devtools

The Query devtools have been re-written from scratch in a framework-agnostic way to make them available to all adapters. They also got a UI revamp and some new features like cache inline editing and light mode.

Fine-grained persistence

Another long-standing discussion from 2021 highlights the importance of fine-grained persistence with just-in-time restore capabilities (especially for mobile development) that the plugin doesn't have. With v5, we now have a new experimental_createPersister plugin that allows you to persist queries individually.

The API

Now that we have a unified way to call (with just one object as parameter), we can also build better abstractions on top of that. The new queryOptions function gives us a type-safe way to share our query definitions between and imperative methods like . On top of that, it can make type-safe as well.


We hope you're going to enjoy using v5 as much as we've enjoyed building it. What's left for us to say thanks to everyone who made this release possible. No matter if you're core contributor, implemented an issue from the roadmap, if you've fixed a typo in the docs or gave feedback on the alpha releases: Every contribution matters! It's the people that makes this library great, and we're blessed to have such an amazing community. ❤️