0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
Commit graph

142 commits

Author SHA1 Message Date
github-actions[bot]
1836e61b8c
ci: Version Packages (#11303)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-26 10:56:25 +02:00
Wonsuk Choi
44645e9eb1
docs(preact-query): rename 'results' to 'postQueries' in 'useSuspenseQueries' example (#11299) 2026-08-26 15:16:52 +09:00
Wonsuk Choi
dbd8fbab49
docs(preact-query): document request-waterfall avoidance across 'useSuspenseQuery' and 'useSuspenseQueries' (#11298)
* docs(preact-query): warn about request waterfalls and point to 'useSuspenseQueries' in 'useSuspenseQuery'

* docs(preact-query): add multiple-parallel-queries example to 'useSuspenseQueries'
2026-08-26 14:52:10 +09:00
Wonsuk Choi
e17de345ce
docs(preact-query): remove redundant 'infiniteQueryOptions' usage from 'useInfiniteQuery' examples (#11297) 2026-08-26 13:59:02 +09:00
Wonsuk Choi
904ab016b0
docs(preact-query): use function declarations instead of arrow functions in example code (#11296) 2026-08-26 13:44:13 +09:00
Wonsuk Choi
f6ed6e4bde
docs(preact-query): expand JSDoc @example coverage across hooks (#11295)
* fix(preact-query): guard 'fetchNextPage' example with 'isFetching', not just 'isFetchingNextPage'

* docs(preact-query): add global loading indicator example to 'useIsFetching'

* docs(preact-query): add mutation-state, 'Promise.all', and 'Promise.allSettled' examples to 'useMutation'

* docs(preact-query): add 'isPending'/'isError' example alongside 'status' to 'useQuery'

* docs(preact-query): fix dependent-query example in 'useQuery' to use 'isLoading' instead of 'isPending'

* docs(preact-query): add pagination example with 'keepPreviousData' to 'useQuery'

* docs(preact-query): correct consecutive-mutation callback wording in 'useMutation' example

* docs(preact-query): add per-call 'onError' callback to basic 'useMutation' example

* docs(preact-query): use contextual message in 'console.error' for 'Promise.all' example in 'useMutation'
2026-08-26 13:31:02 +09:00
github-actions[bot]
51f12db919
ci: Version Packages (#11294)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-25 23:24:07 +02:00
Wonsuk Choi
d09cf1d605
docs(preact-query): backtick bare code-symbol references in JSDoc ('QueryClient', 'suspense', 'throwOnError') (#11290)
* docs(preact-query): wrap bare 'QueryClient' type name in backticks in JSDoc

* docs(preact-query): backtick 'QueryClient' in 'children' prop doc and 'suspense'/'throwOnError' in QueryErrorResetBoundary
2026-08-26 00:14:24 +09:00
Wonsuk Choi
e6503b0990
docs(preact-query): cross-link hooks with their options factories via '@see' and move the infinite-query caveat to '@remarks' (#11289) 2026-08-25 23:28:25 +09:00
Wonsuk Choi
0a16a362dd
docs(preact-query): tag 'subscribed' with '@defaultValue' for structured default-value rendering (#11288) 2026-08-25 23:15:31 +09:00
Wonsuk Choi
84b4f13470
docs(preact-query): document type parameters with '@template' and add 'useQueryClient' throws note (#11285)
* docs(preact-query): document type parameters with '@template' and add 'useQueryClient' throws note

* docs(preact-query): fix TQueryData select direction and TResults/TDepth phrasing flagged by CodeRabbit
2026-08-25 21:28:15 +09:00
Wonsuk Choi
5bb950be80
docs(preact-query): document interfaces and type aliases with JSDoc for generated reference docs (#11284)
* docs(preact-query): document interfaces and type aliases with JSDoc for generated reference docs

* docs(preact-query): fix finite/infinite mix-ups and opaque-array fallback claims flagged by CodeRabbit
2026-08-25 19:35:48 +09:00
Wonsuk Choi
720725d113
docs(preact-query): import 'noop' from '@tanstack/preact-query' instead of '@tanstack/query-core' in examples (#11283) 2026-08-25 17:06:26 +09:00
Wonsuk Choi
870bd854cc
docs(preact-query): document functions and components with JSDoc for generated reference docs (#11204)
* docs(preact-query): document functions and components with JSDoc for generated reference docs

* docs(preact-query): replace concrete API calls with abstract fetcher names in JSDoc examples

* docs(preact-query): rename mutation example fetcher to be CRUD-neutral

* docs(preact-query): rename mutation example fetcher to 'createPosts'

* docs(preact-query): add examples for Suspense, prefetch, and options-builder functions

* docs(preact-query): add optimistic update, dependent query, and SSR hydration examples

* docs(preact-query): add parameterized factory and mutationKey lookup examples to queryOptions/mutationOptions

* docs(preact-query): add infiniteQueryOptions factory example and restore useMutationState's third example

* docs(preact-query): add TkDodo-inspired multi-API reuse, initialData, and per-call mutate callback examples

* docs(preact-query): document useIsRestoring, initialData, mutateAsync, and skipToken-excluded queryFn fields

* docs(preact-query): fill in empty Returns sections for hooks and options builders

* docs(preact-query): systematic sweep of generated pages for missing field descriptions and fix mismatched mutationOptions example

* docs(preact-query): split mutationOptions' mutationKey overload into basic usage and lookup examples

* docs(preact-query): fix overloads whose example didn't match their initialData-required type

* docs(preact-query): fill overloads missing examples and useSuspenseQueries' queryClient param description

* docs(preact-query): remove duplicated overload example and fix examples that failed type-checking

* docs(preact-query): describe every documented parameter and restore reverted overload example

* docs(preact-query): describe children props and low-level context exports

* fix(preact-query): remove inaccurate 'queryFn is optional' claim from infiniteQueryOptions overload

* docs(preact-query): add missing @returns to mutationOptions overloads and provider components

* docs(preact-query): describe QueryErrorResetBoundary children and its render-function parameter

* docs(preact-query): fix prose-accuracy issues found by multi-agent audit

Corrects useQuery's first overload @returns to match its actual return
type, moves the useSuspenseQuery/useSuspenseInfiniteQuery cancellation
caveat out of the @returns block, softens overstated skipToken/queryFn
claims, merges a duplicated useMutationState description, and adds
missing JSDoc to QueryErrorResetBoundary's function-type aliases and
UseMutateFunction/UseMutateAsyncFunction.

* docs(preact-query): soften remaining overstated queryFn requirement in Suspense options

* docs(preact-query): fix inaccurate prose in hydration, queryFn, and useQueries docs

* docs(preact-query): correct hydration freshness gate, placeholderData arity, and deprecated 'fetchInfiniteQuery' reference

* docs(preact-query): remove leftover 'data is never undefined' claim in 'useInfiniteQuery' overload docs

* docs(preact-query): replace deprecated 'prefetchQuery'/'prefetchInfiniteQuery' calls in examples with 'query'/'infiniteQuery'

* docs(preact-query): point 'usePrefetchQuery' JSDoc at 'queryClient.query' to match its actual option type
2026-08-25 16:43:01 +09:00
github-actions[bot]
730b3aa06c
ci: Version Packages (#11276) 2026-08-25 04:21:47 +09:00
Wonsuk Choi
714c2856e0
fix(preact-query/usePrefetchQuery): replace deprecated 'queryClient.fetchQuery' with 'queryClient.query' (#11274)
* fix(preact-query/usePrefetchQuery): replace deprecated 'queryClient.fetchQuery' with 'queryClient.query'

* chore(.changeset): use conventional-commits style wording for changeset entry
2026-08-25 04:06:26 +09:00
Wonsuk Choi
9484a8903e
chore(preact-query): remove eslint-disable comments for rules already off at the package level (#11275) 2026-08-25 04:03:32 +09:00
github-actions[bot]
388bbaf181
ci: Version Packages (#11265)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-23 19:57:36 +02:00
Dominik Dorfmeister 🔮
f2a5da27fb
chore: update knip (#11262)
* chore: update knip

* ref: move cli options to config options

* fix package lock somehow

* pnpm dedupe
2026-08-23 19:24:11 +02:00
github-actions[bot]
bc423b37ef
ci: Version Packages (#11261)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-23 12:57:01 +02:00
Wonsuk Choi
be1352b848
test(*): add adapter-level type coverage for optional undefinable mutate variables (#11257) 2026-08-23 12:08:14 +09:00
github-actions[bot]
5743468462
ci: Version Packages (#11206)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-22 20:52:42 +02:00
Định Lê
2215bb0311
fix(query-core): make MutateFunction optional undefinable-variables (#8737)
* feat(query-core): make `MutateFunction` optional undefinable-variables

* test(query-core): MutateFunction

* test(query-core): MutateFunction

* vue

* ci: apply automated fixes

* angular

* fix adapter signatures

* ci: apply automated fixes

* changeset

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-22 11:24:11 +02:00
Wonsuk Choi
abd81f4463
test(preact-query/useSuspenseQuery): add regression tests for suspense release on programmatic 'setQueryData' (#11248) 2026-08-22 11:17:06 +09:00
Dominik Dorfmeister 🔮
37127dbe47
fix/11018 (#11245)
* revert: remove NoInfer from useQuery return types

* add union type tests

* changeset
2026-08-21 16:22:28 +02:00
Ciarán Curley
4e48c581b7
Preact: update usePrefetchQuery to use new methods with docs (#10669)
* feat(preact-query): use new methods for usePrefetchQuery plus tests

* docs(preact-query): updated docs for usePrefetchQuery

* Update docs/framework/preact/reference/interfaces/UsePrefetchInfiniteQueryOptions.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update packages/preact-query/src/usePrefetchInfiniteQuery.tsx

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>

* Update packages/preact-query/src/usePrefetchQuery.tsx

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-08-20 18:35:10 +02:00
Dominik Dorfmeister 🔮
1ef42087c9
ref: remove experimental_prefetchInRender (#11221) 2026-08-20 11:32:10 +02:00
Jooyoung Shin
4913802895
fix(preact-query): allow retryOnMount when throwOnError is function (#11166)
Ports #9338 to preact-query: ensurePreventErrorBoundaryRetry now
receives the cached query and evaluates a function-form throwOnError
against the actual error before setting retryOnMount = false, instead
of treating any function as truthy. Includes the regression tests
from #9338, two of which fail on current main.

Fixes #11165

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-08-20 11:07:35 +02:00
Dominik Dorfmeister 🔮
b866a95add
ref: remove unused experimental_beforeQuery and experimental_afterQuery (#11233) 2026-08-19 20:34:40 +02:00
Dominik Dorfmeister 🔮
294d4e62c4
fix: declaration emit (#11224)
Co-Authored by @artemxknpv
2026-08-18 17:48:33 +02:00
Dominik Dorfmeister 🔮
267154cf6b
chore: tsup -> tsdown (#11222)
* chore: tsup -> tsdown

* revert size-limit and fix the build instead

* fix angular and devtools build

* fix nextJs builds

* more solid related things

* fix: import order
2026-08-18 15:19:43 +02:00
Lazizbek Ergashev
cb6c9d3725
fix({react,preact}-query): default 'TData' of infinite query options to 'InfiniteData' (#11147)
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-08-18 10:51:47 +02:00
Reza Rahemtola
e546d03bef
fix(react-query): remove placeholderData from suspense infinite query (#11144)
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-08-18 10:44:27 +02:00
Zelys
6e3d521fe5
fix(types): propagate generic type params to useMutationState select callback (#10373)
* fix(types): propagate generic type params to useMutationState select callback

When TResult is a typed MutationState, the select callback parameter
now receives the correctly typed Mutation instead of the base Mutation type.

Adds a second type param TMutation (defaulting to MutationTypeFromResult<TResult>)
to MutationStateOptions across all five framework adapters. Uses a non-distributive
conditional type to avoid union expansion when TResult is unresolved.

Fixes #9825

* ci: apply automated fixes

* refactor(types): simplify useMutationState cast to mutation as TMutation

Replace the double-cast `(fn as unknown as (m: Mutation) => TResult)(m)`
with the direct `fn(m as TMutation)` across all five framework packages.

The constraint `TMutation extends Mutation<any, any, any, any>` creates
sufficient overlap for the single cast to compile cleanly on TS 5.4–6.0.

* fix(test): reorder imports in useMutationState.test-d.tsx per import/order rule

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor(svelte-query): eliminate duplicate MutationTypeFromResult definition

Export MutationTypeFromResult from types.ts so useMutationState.svelte.ts
can import it instead of redefining it. Also normalises the else branch to
plain Mutation, matching every other adapter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-08-18 10:02:05 +02:00
Dominik Dorfmeister 🔮
279bb5508b
chore: update to ts 7 and move cut-off to 5.6 (#11212)
* update to ts 7 and move cut-off to 5.7

* changeset

* fix: use typescript v6 with tsup

* ci: apply automated fixes

* ref: update sveltejs/package

* ref: make ts6 the default typescript

* fix: lit build

* effing tsup

* move ignoreDeprecations to solid tsup config

* move ignoreDeprecations to relevant tsup configs

* better lit fix

* restore vue queryClient

* Revert "restore vue queryClient"

This reverts commit 4f95fc918a.

* fix things

* ignore devDep ordering

* vue needs to use ts6

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-17 22:50:18 +02:00
Ciarán Curley
c6fc17cfad
feat(query-core): add simplified query methods (#10658)
* feat(query-core): add simplified query methods

* tests: stage adapter queryOptions coverage for new query methods

* ref: disallow `enabled`

* ci: apply automated fixes

* remove outdated test

* test(lit): remove other outdated test

---------

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-17 13:59:13 +02:00
Alem Tuzlak
46d7f02f1c
docs: use the dynamic README header endpoint (#11136)
* docs: use the dynamic README header endpoint

* docs: add README header banners to the framework adapter packages
2026-08-03 13:43:19 +02:00
Wonsuk Choi
fbe532c477
test({react,preact}-query): replace 'toBeDefined'/'toBeFalsy' with exact-value assertions (#11123)
test({react,preact}-query): assert exact values instead of loose matchers
2026-07-27 00:57:58 +09:00
SiHyunLee
a3b0612729
test({react,preact}-query/usePrefetchQuery): use the '.then()' convention consistently (#11091)
Co-authored-by: Wonsuk Choi <sukvvon@gmail.com>
2026-07-24 12:30:17 +09:00
github-actions[bot]
86bb8a6fb2
ci: Version Packages (#11094)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-21 15:00:30 +02:00
github-actions[bot]
181ea826cb
ci: Version Packages (#11089)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-20 14:01:04 +02:00
Wonsuk Choi
6d55b0759b
test({react,preact}-query): use the '.then()' convention consistently (#11085)
* test({react,preact}-query/useInfiniteQuery): use the '.then()' convention consistently

* test({react,preact}-query/useMutation): use the '.then()' convention consistently

* test({react,preact}-query/useQueries): use the '.then()' convention consistently

* test({react,preact}-query/useQuery): use the '.then()' convention consistently
2026-07-20 19:38:28 +09:00
Wonsuk Choi
44f38df5de
test({react,preact,solid}-query/useInfiniteQuery): inline the shared 'fetchItems' helper into the tests that use it (#11082) 2026-07-19 16:55:57 +09:00
Wonsuk Choi
d1558c1491
test({react,preact}-query/usePrefetchQuery): inline the 'generateQueryFn' factory into each call site (#11080)
* test({react,preact}-query/usePrefetchQuery): inline the 'generateQueryFn' factory into each call site

* test({react,preact}-query/usePrefetchQuery): drop the unnecessary 'vi.fn()' wrapper on the never-asserted sentinel queryFn
2026-07-19 02:36:41 +09:00
Wonsuk Choi
99690d18b7
test({react,preact}-query/usePrefetchInfiniteQuery): inline single-use helpers and adopt the 'pageParam' mock convention (#11079) 2026-07-18 21:43:09 +09:00
Wonsuk Choi
10770f0720
test({react,preact}-query/usePrefetchInfiniteQuery): inline the shared 'Suspended' component into each test (#11078) 2026-07-18 21:10:27 +09:00
Wonsuk Choi
dbd5a86e95
test({react,preact}-query/usePrefetchQuery): inline the shared 'Suspended' component into each test (#11077) 2026-07-18 21:10:18 +09:00
Wonsuk Choi
b955f60d79
test({react,preact}-query/useSuspenseQuery): assert the 'loading' fallback is rendered when gcTime is 0 (#11076) 2026-07-18 14:47:58 +09:00
Wonsuk Choi
b9c657e20b
test({react,preact}-query/usePrefetchQuery): assert the 'Loading...' fallback is rendered before the prefetch resolves (#11075) 2026-07-18 14:47:42 +09:00
max
79d2384db5
docs(*): fix 'homogenous', 'stoage', 'supressed', 'compoennts' spelling typos (#11040)
* fix: correct spelling typos across docs, examples, and source comments

- homogenous -> homogeneous in 7 useQueries/createQueries source files
- stoage -> storage in react and vue createPersister docs
- supressed -> suppressed in react and angular pagination examples
- compoennts -> components in solid-start-streaming example

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(react-query/useSuspenseQueries): correct 'homogenous' typo to 'homogeneous' in comment

---------

Co-authored-by: maxtaran2010 <ocotifuzo727@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Wonsuk Choi <sukvvon@gmail.com>
2026-07-13 14:06:03 +09:00