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

5,550 commits

Author SHA1 Message Date
Wonsuk Choi
eb8ab6ed76
test(vue-query): replace mock type casts with 'vi.mocked' and remove unused 'getCurrentInstance' mocks (#11630) 2026-09-25 17:00:34 +09:00
Wonsuk Choi
b0222f23b4
test(query-core/timeoutManager): remove redundant 'vi.mocked' around the 'console.error' spy (#11634) 2026-09-25 16:53:58 +09:00
Wonsuk Choi
edbe7b3633
test(vue-query/{useQuery,useQueries,useMutation}): add tests for the 'shallow' option (#11622)
* test(vue-query/{useQuery,useQueries,mutationOptions}): add tests for the 'shallow' option

* test(vue-query/{useQuery,useQueries,mutationOptions}): add tests for deeply reactive and readonly results when 'shallow' is not set

* test(vue-query/{useMutation,mutationOptions}): move the 'useMutation' 'shallow' tests to 'useMutation.test.ts'
2026-09-25 15:21:34 +09:00
Wonsuk Choi
b6da52620b
test(vue-query/{useQuery,useQueries,useIsMutating}): assert the query or mutation actually runs in the 'onScopeDispose' tests (#11626) 2026-09-25 15:17:20 +09:00
Wonsuk Choi
6ced66cf6a
test(vue-query/ssr): add test for resolving a dependent query whose 'queryKey' changed before 'suspense' in 'onServerPrefetch' (#11618) 2026-09-25 15:08:20 +09:00
Wonsuk Choi
7655a43ad5
test(vue-query/useMutation): add test for stopping listening to changes on 'onScopeDispose' (#11619)
* test(vue-query/useMutation): add test for stopping listening to changes on 'onScopeDispose'

* test(vue-query/useMutation): assert the mutation actually runs in the 'onScopeDispose' test with 'isMutating'
2026-09-25 15:03:47 +09:00
Wonsuk Choi
606968e01a
test(vue-query/queryClient): add tests for custom 'queryCache'/'mutationCache' and the arguments 'invalidateQueries' passes to 'refetchQueries' (#11621) 2026-09-25 14:56:29 +09:00
Wonsuk Choi
d649c4de42
test(vue-query/useIsMutating): add tests for filters wrapped in a 'ref' and a 'queryClient' passed as the second argument (#11620) 2026-09-25 14:53:59 +09:00
Wonsuk Choi
2ae71c17d7
test(vue-query/vueQueryPlugin): add tests for 'clientPersisterOnSuccess' and the 'unmount' returned by 'clientPersister' (#11623) 2026-09-25 14:39:43 +09:00
Wonsuk Choi
3e5e7eba46
test(vue-query/useQueries): add test for using the current 'queryKey' value when 'refetch' is called (#11617) 2026-09-25 14:32:14 +09:00
Wonsuk Choi
dfc3d9abed
docs(svelte-query/useMutationState): align the JSDoc description with the other adapters (#11624)
* docs(svelte-query/useMutationState): replace 'hook instance' with 'createMutation' call in JSDoc

* docs(svelte-query/useMutationState): align the JSDoc description with the other adapters
2026-09-25 14:27:22 +09:00
autofix-ci[bot]
bf3a04c21c
ci: apply automated fixes 2026-09-25 05:17:34 +00:00
Lachlan Collins
57f40eb05b
chore(deps): update non-major dependencies (#11625)
* chore(deps): update non-major dependencies

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-09-25 15:15:46 +10:00
changbaebang
1e90d389e5
docs(svelte-query): add package 'README.md' (#11604)
* docs(svelte-query): add package README

Every other adapter (react, preact, solid, vue, lit, angular) ships a
README; svelte-query did not, so its npm page is empty. Copied from
solid-query, which uses the ci badge that still resolves.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs(svelte-query): fix the CI link encoding and point the downloads badge at this package

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs(svelte-query/README): replace 'Primitives' with 'Functions' in the description

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Wonsuk Choi <sukvvon@gmail.com>
2026-09-25 14:12:34 +09:00
Wonsuk Choi
0d118a0694
test(vue-query/useMutation): assert the error watcher throw on both Vue 2 and Vue 3 (#11606)
* test(vue-query/useMutation): assert the error watcher throw on both Vue 2 and Vue 3

* test(vue-query/useMutation): remove the 'unhandledRejection' listener in 'onTestFinished' so it does not leak when the test fails

* test(vue-query/useMutation): assert the 'unhandledRejection' listener receives the rejected promise with 'expect.any(Promise)'
2026-09-25 11:29:48 +09:00
Wonsuk Choi
397ad07f60
test({query-core,react-query,preact-query,solid-query}): pass 'unhandledRejectionFn' directly so 'process.off' removes the 'unhandledRejection' listener (#11610)
* test(query-core/{mutation,mutationObserver}): pass 'unhandledRejectionFn' directly so 'process.off' removes the 'unhandledRejection' listener

* test(react-query/useMutation): pass 'unhandledRejectionFn' directly so 'process.off' removes the 'unhandledRejection' listener

* test(preact-query/useMutation): pass 'unhandledRejectionFn' directly so 'process.off' removes the 'unhandledRejection' listener

* test(solid-query/useMutation): pass 'unhandledRejectionFn' directly so 'process.off' removes the 'unhandledRejection' listener
2026-09-25 11:26:16 +09:00
Wonsuk Choi
3d6144e42c
test(vue-query/utils): assert 'updateState' sets keys missing from the update to 'undefined' (#11609) 2026-09-25 11:25:39 +09:00
Wonsuk Choi
c9c86ff4db
test(vue-query/useQueries): assert the other query is not refetched when refetching a single query (#11608) 2026-09-25 11:24:30 +09:00
Wonsuk Choi
43dcbd99e0
test(vue-query/useIsMutating): use 'sleep(10)' so the 'onScopeDispose' test fails if the subscription is kept (#11607) 2026-09-25 11:24:13 +09:00
Wonsuk Choi
c420d59d66
test(vue-query/useQuery): assert the 'suspense' result in the enabled, default and 'throwOnError' tests (#11605)
* test(vue-query/useQuery): assert the 'suspense' result in the enabled, default and 'throwOnError' tests

* test(vue-query/useQuery): remove the 'unhandledRejection' listener in 'onTestFinished' so it does not leak when the test fails
2026-09-25 11:23:17 +09:00
autofix-ci[bot]
077230bf29
ci: apply automated fixes 2026-09-24 10:02:48 +00:00
Wonsuk Choi
d03806572a
fix(svelte-query/{createQuery,queryOptions}): correct the overload selected for 'initialData' (#11592)
* fix(svelte-query/{createQuery,queryOptions}): correct the overload selected for 'initialData'

* test(svelte-query/queryOptions): use a non-literal condition instead of a wrapper function in the optional 'initialData' object test
2026-09-24 20:01:04 +10:00
Wonsuk Choi
645291a439
test(solid-query-persist-client/PersistQueryClientProvider): rename 'console.error' spy from 'onErrorMock' to 'consoleMock' to align with react-query (#11603) 2026-09-24 14:12:35 +09:00
Wonsuk Choi
b2dcd86837
test({angular-query-experimental,angular-query-persist-client}): align mock names with react-query and the options they are passed to (#11602) 2026-09-24 14:12:14 +09:00
Wonsuk Choi
f6036d75f2
test(svelte-query/createMutation): rename per-call 'onSuccess' mocks to 'onSuccessMutate' to align with react-query (#11601) 2026-09-24 14:11:29 +09:00
Wonsuk Choi
7bfe142e8a
test(vue-query/useQuery): wire the mock 'queryFn' into the fresh-data 'suspense' test (#11600) 2026-09-24 13:23:28 +09:00
Wonsuk Choi
a43e741e04
test(vue-query): align mock names with react-query and the options they are passed to (#11599) 2026-09-24 13:11:27 +09:00
Wonsuk Choi
bf07891f8a
test(vue-query): add tests for a 'computed' 'queryFn' resolving to 'skipToken' and a whole-'queryKey' getter (#11427)
* fix(vue-query): widen 'SkipToken' to 'symbol' so it type-checks inside a whole-options getter

* chore(vue-query): add changeset for 'SkipToken' widening fix

* test(vue-query/useQuery): document that widening 'SkipToken' also accepts unrelated symbols

* fix(vue-query): unify 'UseQueryOptions' with 'QueryOptions' so 'queryFn' accepts a 'computed' resolving to 'skipToken'

* test(vue-query): add runtime coverage for 'skipToken' and bare-getter 'queryKey' across 'useQuery'/'useQueries'/'useInfiniteQuery'

* fix(vue-query): narrow 'queryOptions()' input back to only 'enabled'/'queryKey'/'queryFn' reactive

* test(vue-query/useQuery): verify 'TQueryFnData' inference for a computed 'queryFn' resolving to 'skipToken'

* test(vue-query): fill remaining type-coverage gaps for reactive 'queryFn'/'queryKey' and 'queryOptions()' input narrowing

* test(vue-query/queryOptions): verify skipToken ternary inside a whole-options getter

* test(vue-query/useQueries): import 'reactive' from 'vue' and 'computed'/'ref' from 'vue-demi'

* test(vue-query): downgrade 'computed' 'queryFn' assertions 'vue-tsc' can't resolve to 'assertType'

* chore(vue-query): shorten changeset summary to match PR title

* fix(vue-query/infiniteQueryOptions): separate plain output type from reactive input and allow a bare getter for 'queryKey'

* fix(vue-query/index): export 'InfiniteQueryOptions'

* fix(vue-query): restore 'enabled' plain-callback support on 'infiniteQueryOptions'

Narrowing 'InfiniteQueryOptions' to match 'QueryOptions' had also copied its
narrower 'enabled' union, which drops the plain '(query) => boolean' callback
that 'InfiniteQueryObserverOptions' allows. Restore 'enabled' to source from
'InfiniteQueryObserverOptions' directly so all four shapes keep working.

* docs(vue-query): correct inaccurate test comments flagged by CodeRabbit

The 'unrelated symbol' comment on 'useQuery.test-d.ts' claimed it behaves like
'skipToken' at runtime, but 'ensureQueryFn' only identity-checks the exact
'skipToken' value and returns anything else verbatim, so an unrelated symbol
throws once invoked as a function. Also note why the '@ts-expect-error' in
'queryOptions.test-d.ts' sits on 'queryKey' rather than 'staleTime': overload
resolution fails on the whole object literal, and TypeScript reports it at the
first property.

* chore(vue-query): re-sync changeset summary with PR title

The 'infiniteQueryOptions()' narrowing clause got appended to the changeset
only, drifting it back over the 100-char limit and out of sync with the PR
title again. The title's 'align queryOptions/infiniteQueryOptions input'
already covers it.

* test(vue-query/{useQuery,useQueries,useInfiniteQuery}): align the 'skipToken' and whole-'queryKey' getter tests with their neighboring tests

* test(vue-query/{useQuery,useQueries,useInfiniteQuery}): use a real 'sleep(10)' delay in the new 'skipToken' and whole-'queryKey' getter tests

* test(vue-query/{useQuery,useInfiniteQuery}): drop the whole-options getter 'skipToken' test and the 'useInfiniteQuery' whole-'queryKey' getter test
2026-09-24 12:49:49 +09:00
Wonsuk Choi
ac3256ad0d
docs(vue-query): redirect flat reference URLs broken by the TypeDoc migration (#11398)
docs(config): register redirect_from mappings for vue-query reference pages
2026-09-24 11:57:53 +09:00
Lachlan Collins
32ca5b50d4
chore(examples): update Expo from v52 to v57 (#11596) 2026-09-23 21:24:20 +10:00
Wonsuk Choi
c74591ea22
test({angular,vue,solid}-query/queryOptions): add type tests for an optional 'initialData' object (#11593) 2026-09-23 19:11:07 +09:00
Wonsuk Choi
5c018edc2d
test({react,preact}-query/queryOptions): use a non-literal condition instead of a wrapper function in the optional 'initialData' object test (#11594) 2026-09-23 19:10:49 +09:00
Wonsuk Choi
852924d586
docs({react,preact}-query): fix a missing 'noop' import, a link, and typos in the SSR guide (#11591)
* docs({react,preact}-query): fix a missing 'noop' import, a link, and typos in the SSR guide

* docs(react-query): fix subject-verb agreement in the SSR guide's waterfall section
2026-09-23 18:11:51 +09:00
Wonsuk Choi
545911defe
docs(*): fix article and grammar typos in docs and comments (#11590) 2026-09-23 17:48:31 +09:00
changbaebang
1b24bc303f
docs(react-query): fix undefined userId in dependent query prefetch example (#11504)
The server-side example in the SSR guide checked `user?.userId` and then
referenced an undeclared `userId` variable. Align it with the client-side
example above it (and the Preact guide) by using `user?.id` / `user.id`.
2026-09-23 17:47:53 +09:00
Chris Z
36d8ebb324
docs(vue-query): fix 'loosing' typo in the v5 migration guide (#11580)
docs(vue): fix typo 'loosing' -> 'losing' in v5 migration guide

Correct the spelling of 'losing' in the v5 migration guide for the Vue
adapter. 'Loosing' means 'to release/unfasten', while 'losing' means
'to be deprived of' — the latter is the intended meaning here.

Co-authored-by: haimingZZ <haimingZZ@users.noreply.github.com>
Co-authored-by: Wonsuk Choi <sukvvon@gmail.com>
2026-09-23 17:22:39 +09:00
Wonsuk Choi
7176a1cfa9
docs(svelte-query/{createInfiniteQuery,infiniteQueryOptions}): describe overload selection by whether 'initialData' is known to be defined (#11589)
* docs(svelte-query/{createInfiniteQuery,infiniteQueryOptions}): describe overload selection by whether 'initialData' is known to be defined

* docs(svelte-query): regenerate reference docs
2026-09-23 17:07:05 +09:00
Wonsuk Choi
1b7250b3a0
docs(solid-query): replace the 'advanced-ssr' placeholder with a pointer to the SSR guide (#11588) 2026-09-23 14:58:19 +09:00
Wonsuk Choi
848b42129e
docs({react,preact,solid,vue}-query/useQuery): add 'initialDataUpdatedAt' to the seeding example (#11579) 2026-09-23 13:36:10 +09:00
Wonsuk Choi
10a5afcafb
docs(*): exclude protected members from generated reference docs (#11564) 2026-09-23 13:32:45 +09:00
Wonsuk Choi
04c0fa109f
docs(svelte-query): correct 'initialData'/'select' JSDoc inaccuracy (#11577) 2026-09-23 12:21:07 +09:00
Wonsuk Choi
4cd7f1e35b
docs(solid-query): correct 'initialData'/'select' JSDoc inaccuracy (#11576) 2026-09-23 12:20:45 +09:00
Wonsuk Choi
96919caac5
docs(vue-query): correct 'initialData'/'select' JSDoc inaccuracy (#11575)
* docs(vue-query): correct 'initialData'/'select' JSDoc inaccuracy

* docs(vue-query): fix missed 'select' qualifier on 'DefinedInitialQueryOptions' JSDoc
2026-09-23 12:20:26 +09:00
Wonsuk Choi
d33b407d2a
docs({react,preact}-query): correct 'initialData'/'select' and 'QueriesOptions' fallback JSDoc inaccuracies (#11574)
* docs(react-query): correct inaccurate JSDoc statements

* docs(react-query): split QueriesOptions/SuspenseQueriesOptions JSDoc into paragraphs

* docs(preact-query): correct 'initialData'/'select' and 'QueriesOptions' fallback JSDoc inaccuracies

* docs({react,preact}-query): fix missed 'select' qualifier on 'DefinedInitialDataOptions' JSDoc
2026-09-23 12:19:55 +09:00
Wonsuk Choi
1fd9c6d7a5
docs(solid-query): add SSR guide for SolidStart (#11581)
* docs(solid-query): add SSR guide for SolidStart

* ci: apply automated fixes

* docs(solid-query): fix misleading 'staleTime' comment in SSR guide's 'app.tsx' example

* docs(solid-query): drop inaccurate 'gcTime' aside from the SSR guide's memory note

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-09-23 12:18:39 +09:00
Lachlan Collins
8a5e385f67
ci: update to pnpm v12 (#11584) 2026-09-23 07:35:46 +10:00
Lachlan Collins
6a762c790f
ci: update to changesets v3 (#11583) 2026-09-23 07:12:56 +10:00
Lachlan Collins
248343dee9
ci: update to Nx v23 (#11567) 2026-09-23 06:31:23 +10:00
github-actions[bot]
8884f1a4d9
ci: Version Packages (#11582) release-2026-09-22-1338 @tanstack/svelte-query-devtools@6.2.4 @tanstack/svelte-query-persist-client@6.2.4 @tanstack/svelte-query@6.2.4 @tanstack/vue-query-devtools@6.2.4
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-22 15:35:37 +02:00
Wonsuk Choi
535cd61221
fix(svelte-query-devtools): update the devtools instance when options change after mount (#11009)
* fix(svelte-query-devtools): update the devtools instance when options change after mount

* test(svelte-query-devtools/Devtools): add missing 'setTheme' mock and coverage

---------

Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
2026-09-22 20:46:19 +10:00