Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6cd2c9e
test(query-test-utils): add 'fakeTimers' and 'clearOnDispose' disposa…
cursoragent Nov 1, 2026
5697272
feat(query-core, react-query): add experimental query handles and 'us…
cursoragent Nov 1, 2026
bb8efc5
docs: add the experimental query handles guide
cursoragent Nov 1, 2026
c19f1b5
test(react-query): keep the tRPC-like proxy helper types module-private
cursoragent Nov 2, 2026
b0e3c35
refactor(query-core, react-query): replace 'experimental_useWaterfall…
cursoragent Nov 2, 2026
53e3fb6
test(react-query): unmount the handle tests' renders with 'using'
cursoragent Nov 2, 2026
8b31d3b
docs(query-core, react-query): use plainer words in the query handles…
cursoragent Nov 2, 2026
5567de7
fix(query-core): take only the factory's input in the handle functions
cursoragent Nov 2, 2026
358d6a4
feat(query-core): export only the handle types integrations need
cursoragent Nov 2, 2026
f9b843e
feat(query-core): drop the data from query handles
cursoragent Nov 2, 2026
46a66c5
test(react-query): check that select infers through experimental_from…
cursoragent Nov 2, 2026
b6bc296
feat(query-core): add experimental_InferQueryHandleData
cursoragent Nov 2, 2026
287ddeb
feat(query-core, query-devtools): show how query handles started thei…
cursoragent Nov 1, 2026
1fbd5b1
test(query-core, query-devtools): unsubscribe and unmount the start i…
cursoragent Nov 2, 2026
3f7066e
docs(query-core, query-devtools): use plainer words in the start info…
cursoragent Nov 2, 2026
8f594fe
fix(query-core, query-devtools): keep handles free of symbols and war…
cursoragent Nov 2, 2026
f639acc
feat(query-core): only record query start info in development
cursoragent Nov 2, 2026
5455997
feat(query-core): rename the handle verbs to experimental_queryHandle…
cursoragent Nov 5, 2026
452a67c
docs: document experimental_queryHandle and experimental_queryHandleA…
cursoragent Nov 5, 2026
5d6a765
feat(query-core): take a staleTime for one call in experimental_query…
cursoragent Nov 5, 2026
b630005
docs: use a call's staleTime to use cached data, even if stale
cursoragent Nov 5, 2026
4aff64c
Merge TanStack/query main into cursor/experimental-query-handles-271e
KATT Nov 5, 2026
e64886f
feat(query-core): add experimental_ensureQueryHandle and drop the per…
cursoragent Nov 5, 2026
3b1283f
feat(query-core): add experimental_getQueryHandleData for awaited han…
cursoragent Nov 6, 2026
d100561
refactor(query-core): read handle data without a guard or an options …
cursoragent Nov 6, 2026
91bd116
refactor(query-core): pick factory options from QueryObserverOptions
cursoragent Nov 6, 2026
fe960f1
docs(react-query): warn against building query inputs from loader data
cursoragent Nov 6, 2026
5d4fd98
docs(react-query): add loader pitfalls to the query handles guide
cursoragent Nov 6, 2026
c4d2bfc
docs(react-query): say how awaited handles differ in types
cursoragent Nov 6, 2026
aa990d2
docs(react-query): show an allKeyed ponyfill instead of a polyfill
cursoragent Nov 6, 2026
a477d81
docs(react-query): start page state from the handle, and show a real …
cursoragent Nov 6, 2026
e1bf0d8
docs(react-query): drop the allKeyed credit
cursoragent Nov 6, 2026
c67e30d
docs(query-handles): main examples ensure the post, prefetch comments…
cursoragent Nov 6, 2026
195183b
docs(query-handles): make the author's posts and search results infin…
cursoragent Nov 6, 2026
d39c8f5
feat(query-core)!: drop experimental_waterfallHandle
cursoragent Nov 7, 2026
3787bb6
Merge #12512's head d39c8f500, and detect waterfalls without experime…
cursoragent Nov 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/experimental-query-handles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@tanstack/query-core': minor
'@tanstack/react-query': minor
---

Add experimental query handles. `experimental_queryHandle`, `experimental_queryHandleAsync` and `experimental_ensureQueryHandle` start a query from a query factory and return a small serializable handle: the first doesn't wait, the second waits for fresh data, and the third waits for any data, even if it is stale. `experimental_fromHandle` rebuilds the query's options from a handle. `experimental_getQueryHandleData` reads the data of a handle that one of the awaited functions returned. `experimental_InferQueryHandleData` gives the type of the data a reader gets from a factory or handle.
6 changes: 6 additions & 0 deletions .changeset/query-handles-devtools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@tanstack/query-core': minor
'@tanstack/query-devtools': minor
---

Show in the devtools how experimental query handles started their queries. In development, `experimental_getQueryStartInfo` returns which handle function started a query, where and when, and whether anything has read it since. Production builds record nothing. The devtools show this, mark with a `waterfall` badge queries whose first fetch a component's query hook started on a client that uses handles, and flag prefetched queries that nothing read. In development, `dehydrate` warns when it leaves out a pending query that a handle function started on the server.
4 changes: 4 additions & 0 deletions docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@
"label": "Prefetching & Router Integration",
"to": "framework/react/guides/prefetching"
},
{
"label": "Query Handles (experimental)",
"to": "framework/react/guides/query-handles"
},
{
"label": "Server Rendering & Hydration",
"to": "framework/react/guides/ssr"
Expand Down
Loading