0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-18 19:33:22 +00:00
Commit graph

2,925 commits

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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-15 09:50:17 +02:00
Sviat Barbutsa
0f15bc925d
fix(query-core): preserve union narrowing in setQueryData updaters (#11935)
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-10-15 09:36:14 +02:00
Dami Oyeniyi
67705fd6ad
fix(vue-query-devtools): update client when prop changes (#11413) 2026-10-12 21:59:13 +02:00
Max Freedom Pollard
ed4d849731
fix(query-persist-client-core/createPersister): await 'storage.setItem' when persisting a query (#11410) 2026-10-12 21:54:43 +02:00
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
okxint
a16e71c7a8
fix(mutation-observer): snapshot mutateOptions before dispatching callbacks (#11945)
* fix(mutation-observer): snapshot mutateOptions before dispatching callbacks

When mutate() is called inside an onSuccess handler, this.#mutateOptions
is overwritten before the subsequent onSettled call in #notify(). This
causes onSettled to fire with the next mutation's callbacks but the
current mutation's data and variables.

Fix by snapshotting mutateOptions at the top of #notify() before any
callbacks execute, so all three callbacks (onSuccess/onError/onSettled)
see the same consistent options for the mutation that settled.

Fixes #11451

* ci: apply automated fixes

---------

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-10-11 21:24:46 +02:00
Jovi De Croock
a94c7caeec
feat(preact-query*): support Preact v11 (#11711)
* feat(preact-query*): support Preact v11

* fix(preact-query*): pass an initial value to 'useRef' and flush deferred unmount effect cleanups in tests for Preact v11

* chore(preact-query*): develop and test against Preact 11

Bump the preact catalog and the preact example to ^11.0.1, and
preact-render-to-string to ^6.8.0 (Preact 11 peers on >=6.7.0).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Kevin Van Cott <kevinvandy656@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 18:17:07 +01: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
aab352876a
chore(solid-query*): add 'eslint-plugin-solid' (#11929)
* chore(solid-query*): add 'eslint-plugin-solid'

* chore(solid-query*): explain why 'solid/reactivity' is off and keep it on in 'solid-query-persist-client'
2026-10-08 18:59:06 +09:00
Wonsuk Choi
01a7ebdd02
chore(preact-query*): clarify why the base rules from 'eslint-config-preact' are turned off (#11928) 2026-10-08 16:47:07 +09:00
Wonsuk Choi
79e2e4244e
chore(preact-query*): enable '@typescript-eslint/no-unnecessary-condition' outside tests (#11927) 2026-10-08 16:40:49 +09:00
Wonsuk Choi
24569675b6
chore(preact-query*): remove '@typescript-eslint/no-redeclare' (#11926) 2026-10-08 16:32:38 +09:00
Wonsuk Choi
c7a22584ea
chore(preact-query*): enable '@typescript-eslint/array-type' and '@typescript-eslint/no-unnecessary-type-assertion' (#11925) 2026-10-08 16:20:59 +09:00
Wonsuk Choi
93cb9cf6e4
chore(preact-query*): enable 'import/order' and 'sort-imports' (#11924) 2026-10-08 16:17:10 +09:00
Wonsuk Choi
271a4ed77e
refactor(lit-query): add the 'override' modifier to the implementations of the abstract controller hooks and document the hooks (#11913)
* refactor(lit-query): add the 'override' modifier to the implementations of the abstract controller hooks

* docs(lit-query/BaseController): note that 'onQueryClientChanged' also runs when no client is found

* docs(lit-query/BaseController): note that 'onConnected' may run without a client
2026-10-05 12:30:08 +09:00
Wonsuk Choi
4e1476cb69
test(solid-query): add the 'override' modifier to test classes that override a base class member (#11911) 2026-10-05 03:42:52 +09:00
Wonsuk Choi
7f0e7e2e36
test(preact-query): add the 'override' modifier to test classes that override a base class member (#11910) 2026-10-05 03:42:45 +09:00
Wonsuk Choi
ec66fc317b
test(lit-query): add the 'override' modifier to test classes that override a base class member (#11909) 2026-10-05 03:42:37 +09:00
Wonsuk Choi
d11907b937
test(query-core): add the 'override' modifier to test classes that override a base class member (#11908) 2026-10-05 03:42:29 +09:00
Wonsuk Choi
ec8c6de884
refactor(lit-query): add the 'override' modifier to members that override a base class member (#11906) 2026-10-05 03:21:20 +09: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
65f762e292
refactor(query-core): add the 'override' modifier to members that override a base class member (#11904) 2026-10-05 03:20:52 +09:00
Wonsuk Choi
688f6e0722
docs(*): describe 'shadowDOMTarget' as the shadow DOM the devtools styles are applied within (#11902) 2026-10-05 02:17:04 +09:00
Wonsuk Choi
9dd4d7d506
docs(query-core/types): add JSDoc to the properties of the exported interfaces and type aliases (#11891)
* docs(query-core/types): add JSDoc to the properties of the exported interfaces and type aliases

* docs(query-core/types): mention mutations in the 'hydrate' default options description
2026-10-05 01:55:45 +09:00
Wonsuk Choi
e3415e0149
docs(eslint-plugin-query): add JSDoc to the properties of the exported interfaces and type aliases (#11900) 2026-10-05 01:55:10 +09:00
Wonsuk Choi
30e03ad077
docs(query-devtools): add JSDoc to the properties of the exported interfaces and type aliases (#11899) 2026-10-05 01:53:12 +09:00
Wonsuk Choi
1fd8ecea49
docs(angular-query-experimental): add JSDoc to the properties of the exported interfaces and type aliases (#11898) 2026-10-05 01:52:37 +09:00
Wonsuk Choi
1e6b56187f
docs(svelte-query): add JSDoc to the properties of the exported interfaces and type aliases (#11897) 2026-10-05 01:52: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
b18e7ab6f4
docs(solid-query): add JSDoc to the properties of the exported interfaces and type aliases (#11895) 2026-10-05 01:50:30 +09:00
Wonsuk Choi
0012ec14c3
docs(react-query): add JSDoc to the properties of the exported interfaces and type aliases (#11894) 2026-10-05 01:49:55 +09:00
Wonsuk Choi
0aa83a0188
docs(*): add JSDoc to the properties of the exported interfaces and type aliases of the persisters and the broadcast client (#11893) 2026-10-05 01:49:21 +09:00
Wonsuk Choi
9962ee1fe2
docs(query-core): add JSDoc to the properties of the exported interfaces and type aliases outside 'types.ts' (#11892) 2026-10-05 01:48:47 +09:00
Wonsuk Choi
f9fe54c960
docs(eslint-plugin-query): add JSDoc to the exported classes, methods, and arrow functions (#11888) 2026-10-04 13:06:11 +09:00
Wonsuk Choi
7933146d9a
docs(query-test-utils): add JSDoc to the exported classes, methods, and arrow functions (#11887) 2026-10-04 13:05:36 +09:00
Wonsuk Choi
0e8090514c
docs(query-devtools): add JSDoc to the exported classes, methods, and arrow functions (#11886) 2026-10-04 13:05:03 +09:00
Wonsuk Choi
fa539fee3b
docs(lit-query): add JSDoc to the exported classes, methods, and arrow functions (#11885) 2026-10-04 13:04:30 +09:00
Wonsuk Choi
51b43f8599
docs(angular-query-experimental): add JSDoc to the exported classes, methods, and arrow functions (#11884) 2026-10-04 12:36:48 +09:00
Wonsuk Choi
71c663576d
docs(svelte-query): add JSDoc to the exported classes, methods, and arrow functions (#11883)
* docs(svelte-query): add JSDoc to the exported classes, methods, and arrow functions

* docs(svelte-query/utils): describe that 'watchChanges' runs on every change of the state its sources read
2026-10-04 12:36:12 +09:00
Wonsuk Choi
2c39f03b44
docs(solid-query): add JSDoc to the exported classes, methods, and arrow functions (#11882)
* docs(solid-query): add JSDoc to the exported classes, methods, and arrow functions

* docs(solid-query-persist-client/PersistQueryClientProvider): describe what is deferred while restoring and when the callbacks run
2026-10-04 12:34:40 +09:00
Wonsuk Choi
fce806b53f
docs(preact-query): add JSDoc to the exported classes, methods, and arrow functions (#11881)
* docs(preact-query): add JSDoc to the exported classes, methods, and arrow functions

* docs(preact-query-persist-client/PersistQueryClientProvider): describe what is deferred while restoring and when the callbacks run
2026-10-04 12:33:32 +09:00
Wonsuk Choi
b5e8e7b697
docs(react-query): add JSDoc to the exported classes, methods, and arrow functions (#11880)
* docs(react-query): add JSDoc to the exported classes, methods, and arrow functions

* docs(react-query-persist-client/PersistQueryClientProvider): describe what is deferred while restoring and when the callbacks run
2026-10-04 12:32:24 +09:00
Wonsuk Choi
72c68cc353
docs(*): add JSDoc to the exported classes, methods, and arrow functions of the persisters (#11879) 2026-10-04 12:30:39 +09:00
Wonsuk Choi
c0f20a8259
docs(query-core): add JSDoc to the base methods of the exported classes (#11878) 2026-10-04 12:30:05 +09:00
Wonsuk Choi
01abab33f8
docs(*): note that 'throwOnError' makes the hook rethrow the errors of 'mutate' (#11877)
* docs(*): note that 'throwOnError' makes the hook rethrow the errors of 'mutate'

* docs(angular-query-experimental/types): mention that 'injectMutation' emits the error on 'ngZone.onError' before rethrowing it
2026-10-04 12:29:23 +09:00