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

743 commits

Author SHA1 Message Date
github-actions[bot]
b699b52d60
ci: Version Packages (#11849)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-11 21:32:27 +02:00
Dominik Dorfmeister 🔮
e22e7c4a27
chore: test TypeScript 7.1 preview and drop 5.6 (#11947)
* chore: test TypeScript 7.1 preview and drop 5.6

* chore: use a mature TypeScript 7.1 preview
2026-10-10 16:26:58 +02:00
Wonsuk Choi
df78a9d137
chore(*): pass the root 'settings' to the package oxlint configs, which 'extends' does not inherit (#11941) 2026-10-10 01:39:06 +09:00
Ciarán Curley
833062c2fc
chore: replace prettier with oxfmt (#11939)
Replace prettier with oxfmt

The options and ignores have been ported to the `.oxfmtrc.json` file (oxfmt `printWidth` default is 100 characters, so preserving 80 for now). While the configuration with Prettier is the same, oxfmt seems to modify some things slightly differently, apparently due to the use of a pre-3.9 Prettier layout for union types that break onto their own line so we still end up with about 30 files changed. 

Files with actual changes are:

- `.prettierignore`.`prettier.config.js`: Deleted. Replaced with `.oxfmtrc.json`
- `package.json`: `format` script changed to `oxfmt`. Added `oxfmt` and `svelte` as `devDependencies`; removed `prettier` and `prettier-plugin-svelte`.
- `pnpm-lock.yaml`: Lockfile update for the dependency changes above.
- `scripts/generate-labeler-config.ts`: Formats with oxfmt's `format()` API instead of Prettier's. It reads `.oxfmtrc.json` itself, because the API doesn't find config files on its own, and throws if formatting reports errors. Its output is identical to what Prettier produced.


Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 16:47:26 +01:00
Ciarán Curley
d0cfa6a4a8
chore: replace eslint with oxlint (#11938)
* chore: replace eslint with oxlint

Migrates to oxlint as the replacement linter for eslint.

Keeps the existing ruleset, runs js plugins for non-native oxlint rules and the local no-restricted-syntax plugin

Svelte packages keep a slim ESLint config for the svelte/* rules, which need the component template.
React examples that use the query eslint plugin also still use eslint for now.

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

* chore: use oxlint disable directives

ESLint no longer lints these files, so switch eslint-disable comments to
oxlint-disable and the @typescript-eslint/ prefix to typescript/. Remove
directives that oxlint reports as unused, and name the rule in the
cspell oxlint-enable comments, which oxlint does not match to a
rule-specific disable otherwise.

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

* chore: lint expectTypeOf with vitest valid-expect

Oxlint's native vitest/valid-expect only checks `expect` calls, so load
@vitest/eslint-plugin as a JS plugin for this rule to keep flagging
`expectTypeOf` calls without a matcher, and restore the directives for
the intentional ones.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 16:35:33 +01:00
Wonsuk Choi
71536972b5
docs(vue-query/useMutation): add JSDoc to 'MutationResult' (#11937)
* docs(vue-query/useMutation): add JSDoc to 'MutationResult'

* docs(vue-query): regenerate reference docs for 'MutationResult'
2026-10-10 00:05:13 +09:00
Kirby
69e114aecf
fix(vue-query): export MutationResult type (#11796)
`UseMutationReturnType` uses `MutationResult` as the default for its
`TResult` parameter, but the alias was not exported. Projects that emit
declarations could not name the inferred return type of a `useMutation`
wrapper and failed with TS2883. Export it from the package root.

Fixes #11769

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Ciarán Curley <ciaran.curley.11.11@gmail.com>
2026-10-09 12:17:10 +01:00
Wonsuk Choi
866d5429f0
refactor(vue-query): add the 'override' modifier to members that override a base class member (#11905) 2026-10-05 03:21:02 +09:00
Wonsuk Choi
25c1e6c1ad
docs(vue-query): add JSDoc to the properties of the exported interfaces and type aliases (#11896)
* docs(vue-query): add JSDoc to the properties of the exported interfaces and type aliases

* docs(vue-query/types): mention mutations in the 'hydrate' default options description
2026-10-05 01:51:28 +09:00
Wonsuk Choi
27a8a89d8c
docs(vue-query): add JSDoc to the exported interfaces and type aliases (#11871)
* docs(vue-query): add JSDoc to the exported interfaces and type aliases

* docs(vue-query/useInfiniteQuery): exclude 'shallow' from the options that can be a 'ref'
2026-10-04 11:45:07 +09:00
Wonsuk Choi
cbdb21468a
docs(*): replace JSDoc descriptions that only repeat the names and enforce 'jsdoc/informative-docs' (#11859)
* docs(*): replace JSDoc descriptions that only repeat the names

* chore(eslint.config): enforce 'jsdoc/informative-docs'
2026-10-04 05:08:09 +09:00
Wonsuk Choi
0b9949acb9
docs(*): sort JSDoc tags and enforce 'jsdoc/sort-tags' (#11858)
* docs(*): sort JSDoc tags

* chore(eslint.config): enforce 'jsdoc/sort-tags'
2026-10-04 05:03:01 +09:00
Wonsuk Choi
7163033731
docs(vue-query): add missing JSDoc and move '@internal' after the descriptions (#11839) 2026-10-04 04:11:02 +09:00
Wonsuk Choi
57db962344
docs(*): fix JSDoc '@param' names that don't match the parameters and enforce 'jsdoc/check-param-names' (#11828)
* docs(*): fix JSDoc '@param' names that don't match the parameters

* chore(eslint.config): raise 'jsdoc/check-param-names' to error without requiring destructured properties
2026-10-04 01:57:41 +09:00
Wonsuk Choi
9dd8afef53
docs(*): remove blank lines between JSDoc descriptions and tags and enforce 'jsdoc/tag-lines' (#11827)
* docs(*): remove blank lines between JSDoc descriptions and tags

* chore(eslint.config): raise 'jsdoc/tag-lines' from warning to error
2026-10-04 01:34:16 +09:00
Wonsuk Choi
5ab1aaeddf
chore(eslint.config): use 'defineConfig' from 'eslint/config' (#11819) 2026-10-03 23:17:10 +09:00
Wonsuk Choi
f4c174b24b
test(*): start test titles with 'should' (#11816)
* test(*): start test titles with 'should'

* test(*): start the remaining test titles with 'should'

* test(eslint-plugin-query): start 'it.each' titles with 'should'

* test({react,preact}-query/useSuspenseQueries): fix title to match the assertion that 'TData' excludes 'undefined'
2026-10-03 20:58:09 +09:00
github-actions[bot]
29859ae60c
ci: Version Packages (#11806)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-02 12:02:10 +02:00
Wonsuk Choi
5d14b15480
chore(*): manage 'vue' eslint plugin with pnpm 'catalog' (#11784) 2026-10-01 04:51:44 +09:00
Wonsuk Choi
8d321c57fe
chore(vue-query*): manage 'vue' packages with pnpm 'catalog' (#11716) 2026-09-29 01:47:36 +09:00
Wonsuk Choi
2e1ad64b52
chore(*): declare 'npm-run-all2' once in the root 'package.json' like other shared tools (#11710) 2026-09-28 13:13:48 +09:00
Wonsuk Choi
38909aa233
chore(vue-query/package.json): run 'test:types:tscurrent' by using 'npm-run-all' like other packages (#11707) 2026-09-28 10:57:59 +09:00
Wonsuk Choi
c1de23a80e
chore(*): manage 'typescript' with pnpm 'catalog' and declare it in each package so 'tsc' runs the default version (#11705) 2026-09-28 10:04:50 +09:00
Wonsuk Choi
862b89e283
test(vue-query): keep each action, wait and assertion together and separate setup calls and new user actions (#11659)
* test(vue-query): keep each assertion and the following wait together and separate setup calls and new user actions

* test(vue-query): add blank lines after composables called directly in a test

* test(vue-query/useMutation): remove blank line between the awaited 'Promise.all' wait and its assertion

* test(vue-query/{useMutation,useQuery}): keep awaited promises and value retrievals together with their waits and assertions
2026-09-27 01:41:50 +09:00
Wonsuk Choi
bc132e7910
test(vue-query): remove blank lines between actions, waits and their assertions (#11656) 2026-09-26 17:45:16 +09:00
Wonsuk Choi
303779f1b4
test(vue-query/useQuery): use 'initial' and 'data' in the 'initialData' tests like the other adapters (#11653) 2026-09-26 14:45:15 +09:00
Wonsuk Choi
cd1d1327f8
test(vue-query): add tests for 'initialData' with a failed refetch and an infinite query waiting on 'skipToken' (#11426)
* test(vue-query): add tests for 'initialData' with a failed refetch and 'skipToken' dependent query

* test(vue-query/useInfiniteQuery): assert 'queryFn' call count in skipToken test
2026-09-26 14:38:39 +09:00
github-actions[bot]
d4033eb1e5
ci: Version Packages (#11651)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-26 13:53:37 +10:00
Lachlan Collins
5279b05211
chore(deps): update Vite from v6 to v8 (#11650)
* chore(deps): update Vite from v6 to v8

* Fix angular, vue-devtools

* Fix vue-devtools

* Fix knip, remove @tanstack/vite-config

* Update eslint config

* Disable false eslint errors

* Fix remaining errors

* Fix knip, dedupe esbuild

* Add changeset
2026-09-26 12:23:02 +10:00
github-actions[bot]
fe053bf8e9
ci: Version Packages (#11612)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-26 10:13:58 +10:00
Lachlan Collins
d86ac36663
chore(query-devtools): update dependencies (#11648)
* chore(query-devtools): update dependencies

* Add changeset

* Fix build
2026-09-26 08:45:38 +10:00
Lachlan Collins
f00aad602e
chore(deps): update dev dependencies (#11640)
chore(deps): update many dev dependencies
2026-09-26 07:30:31 +10:00
Wonsuk Choi
2443290fb5
test(*): rename 'console.error' spies to 'consoleErrorMock' (#11646) 2026-09-26 00:45:05 +09:00
Wonsuk Choi
fd64c13e68
test(*): rename 'console.warn' spies to 'consoleWarnMock' (#11645) 2026-09-26 00:28:28 +09:00
Wonsuk Choi
9ff2ee3bbd
docs(vue-query): document how 'suspense()' resolves and handles errors, and fix the 'suspense' SSR examples (#11629)
* docs(vue-query): document how 'suspense()' resolves, including the disabled query caveat on the server

* docs(vue-query/suspense): add error handling with 'throwOnError' and 'onErrorCaptured'

* docs(vue-query/ssr): fix the Nuxt examples that call 'suspense' without destructuring it and destructure a nonexistent 'data2'

* docs(vue-query/suspense): note that 'suspense()' can resolve before the query function finishes

* docs(vue-query/{ssr,suspense}): scope the disabled 'suspense()' caveat to queries that stay disabled

* docs(vue-query/{ssr,suspense}): scope the SSR caveat heading to queries that stay disabled

* docs(vue-query/ssr): use 'vue' code blocks for the SFC examples
2026-09-25 23:34:07 +09:00
Wonsuk Choi
ea2da8f631
test(vue-query/vueQueryPlugin): add test for not mounting the client on the server (#11631) 2026-09-25 17:01:37 +09:00
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
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
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
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
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