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
github-actions[bot]
b699b52d60
ci: Version Packages (#11849) release-2026-10-11-1936 @tanstack/react-query@5.104.2 @tanstack/query-async-storage-persister@5.104.2 @tanstack/query-devtools@5.104.2 @tanstack/query-sync-storage-persister@5.104.2 @tanstack/query-core@5.104.2 @tanstack/vue-query@5.104.2 @tanstack/vue-query-devtools@6.3.2 @tanstack/svelte-query@6.3.2 @tanstack/react-query-devtools@5.104.2 @tanstack/svelte-query-persist-client@6.3.2 @tanstack/angular-query-experimental@5.104.2 @tanstack/svelte-query-devtools@6.3.2 @tanstack/eslint-plugin-query@5.104.2 @tanstack/solid-query@5.104.2 @tanstack/lit-query@0.2.27 @tanstack/solid-query-persist-client@5.104.2 @tanstack/preact-query-devtools@5.104.2 @tanstack/solid-query-devtools@5.104.2 @tanstack/preact-query-persist-client@5.104.2 @tanstack/query-persist-client-core@5.104.2 @tanstack/preact-query@5.104.2 @tanstack/react-query-persist-client@5.104.2 @tanstack/query-broadcast-client-experimental@5.104.2 @tanstack/react-query-next-experimental@5.104.2
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
Wonsuk Choi
98fd5936f0
chore(examples/react): add '@types/node' to the Next.js examples that relied on the root copy (#11977) 2026-10-12 03:40:40 +09:00
Wonsuk Choi
3a0e92744d
chore(examples/react): add '.stackblitzrc' so StackBlitz runs the 'dev' script in the Next.js examples (#11976) 2026-10-12 03:35:35 +09:00
Wonsuk Choi
1dc168007b
fix(examples/solid/offline): type the movie query and mutation with 'queryOptions' and 'mutationOptions' (#11975) 2026-10-12 02:52:35 +09:00
Wonsuk Choi
fd820ed30d
fix(examples/{react,solid}/offline): regenerate the msw worker and render after it starts (#11974) 2026-10-12 02:35:05 +09:00
Wonsuk Choi
d81b4e41d6
fix(examples/react/offline): type the movie query and mutation with 'queryOptions' and 'mutationOptions' (#11973)
* fix(examples/react/offline): type the movie query and mutation with 'queryOptions' and 'mutationOptions'

* fix(examples/react/offline): type the movie list response with only 'id' and 'title'
2026-10-12 02:34:19 +09:00
Wonsuk Choi
a6a46a2eab
fix(examples/react/react-native): type the movie list items as 'Movie' (#11971) 2026-10-12 02:26:02 +09: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
Wonsuk Choi
d2d3e064a0
chore(examples/react): raise 'target' from 'ES5' to 'ES2017' in the Next app examples (#11969) 2026-10-12 01:53:40 +09:00
Wonsuk Choi
3ae9fb0c3c
fix(examples/react/algolia): compute the next page from 'lastPageParam' and the optional 'nbPages' (#11967) 2026-10-11 23:41:43 +09:00
Wonsuk Choi
70194b8a7c
chore(examples/react): add 'vite-env.d.ts' so CSS imports type-check under TS 6 (#11968) 2026-10-11 23:41:19 +09:00
Wonsuk Choi
008b750034
fix(examples/react/prefetching): subscribe to prefetched characters instead of forcing a rerender (#11966) 2026-10-11 23:35:03 +09:00
Wonsuk Choi
11ad4e012a
fix(examples/react/infinite-query-with-max-pages): extract a typed 'fetchProjects' for 'queryFn' (#11965) 2026-10-11 23:34:39 +09:00
Wonsuk Choi
4e21da774f
fix(examples/react): narrow 'req.query' values in the Next API routes (#11963)
* fix(examples/react): narrow 'req.query' values in the Next API routes

* fix(examples/react): skip empty 'add' values and keep 'parseInt' for 'req.query' in the Next API routes
2026-10-11 23:09:43 +09:00
Wonsuk Choi
dee1679bf4
chore(examples/react): remove unused 'React' imports (#11962) 2026-10-11 11:42:04 +09:00
Wonsuk Choi
3a66faac11
fix(examples/react): remove the 'exact' prop that react-router v6 no longer supports (#11961) 2026-10-11 11:41:31 +09:00
Wonsuk Choi
fb65258385
chore(examples/react): add '@types/react' to the examples that relied on the root one (#11960) 2026-10-11 10:45:38 +09:00
Wonsuk Choi
30a3b73767
chore(examples/solid): replace the legacy '.eslintrc.cjs' with a flat config and run 'test:eslint' (#11959)
* chore(examples/solid): replace the legacy '.eslintrc.cjs' with a flat config and run 'test:eslint'

* refactor(examples/solid): fix 'no-shadow' and 'solid/reactivity' warnings
2026-10-11 02:18:06 +09:00
Wonsuk Choi
d3fcbe5d67
chore(examples/lit): add a flat ESLint config and run 'test:eslint' (#11954)
* chore(examples/lit): add a flat ESLint config and run 'test:eslint'

* fix(examples/lit/ssr): include 'apiBaseUrl' in the 'queryKey'
2026-10-11 02:00:11 +09:00
Wonsuk Choi
effc358729
chore(examples/preact/simple): use 'eslint-config-preact' through a flat config and run 'test:eslint' (#11953) 2026-10-11 01:55:45 +09:00
Wonsuk Choi
bbc8e95edf
chore(examples/angular): replace the legacy '.eslintrc.cjs' with a flat config and run 'test:eslint' (#11952)
* chore(examples/angular): replace the legacy '.eslintrc.cjs' with a flat config and run 'test:eslint'

* refactor(examples/angular/{auto-refetching,optimistic-updates}): wrap the 'POST' case in a block
2026-10-11 01:32:52 +09:00
Wonsuk Choi
0f6a80510e
refactor(examples/solid/solid-start-streaming): wrap 'userInfoQueryOpts' with 'queryOptions' (#11957) 2026-10-11 01:31:42 +09:00
Wonsuk Choi
647e3fe661
fix(examples/solid/default-query-function): match the cached post key in 'getQueryData' (#11958) 2026-10-11 01:30:56 +09:00
Wonsuk Choi
0401256bc8
fix(examples/solid/solid-start-streaming): include 'sleep' and 'simulateError' in the query keys (#11956) 2026-10-11 01:17:30 +09:00
Wonsuk Choi
51e68b6b69
fix(examples/solid/{basic,offline}): pass accessors instead of values to query hooks (#11955) 2026-10-11 01:17:10 +09:00
Wonsuk Choi
22621e773c
chore(examples/react): enable 'allowJs' so typed linting covers 'eslint.config.js' (#11950) 2026-10-11 00:51:13 +09:00
Wonsuk Choi
69d9f7c217
chore(examples/solid/simple): replace the legacy '.eslintrc.cjs' with a flat config and run 'test:eslint' (#11949)
* chore(examples/solid/simple): replace the legacy '.eslintrc.cjs' with a flat config and run 'test:eslint'

* chore(examples/solid/simple): build the dependencies before 'test:eslint'

* chore(examples/solid/simple): remove the 'test:eslint' nx override now set in 'nx.json'

* chore(examples/solid/simple): enable 'allowJs' so typed linting covers 'eslint.config.js'
2026-10-11 00:29:24 +09:00
Wonsuk Choi
42745443cf
chore(nx.json): build the dependencies before 'test:eslint' (#11951) 2026-10-10 23:58:26 +09: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
bef879eb56
chore(examples/react): run 'test:eslint' in 'algolia', 'basic-graphql-request' and 'shadow-dom' (#11948)
* chore(examples/react): run 'test:eslint' in 'algolia', 'basic-graphql-request' and 'shadow-dom'

* refactor(examples/react/algolia): derive 'hits' with 'select' instead of spreading the query result
2026-10-10 23:03:54 +09:00
Wonsuk Choi
e3ef138705
chore(oxlint.config): load the jsdoc and vitest JS plugins only in the overrides that use them (#11946) 2026-10-10 13:23:56 +09:00
Wonsuk Choi
a2e0eb2e51
chore(oxfmt.config): replace '.oxfmtrc.json' with 'oxfmt.config.ts' (#11944) 2026-10-10 10:08:39 +09:00
Wonsuk Choi
a8163e00b7
chore(oxlint.config): remove the unused '$schema' (#11943) 2026-10-10 01:56:49 +09:00
Wonsuk Choi
f4600cdf79
chore(oxlint.config): spread the vitest recommended rules instead of listing them (#11942) 2026-10-10 01:46:04 +09: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
autofix-ci[bot]
6a9a04f9bb
ci: apply automated fixes 2026-10-09 15:50:46 +00: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
autofix-ci[bot]
817bd02659
ci: apply automated fixes 2026-10-09 11:19:04 +00: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
d169ee8778
docs(*): add property tables and overload overviews to reference pages and keep declared alias names (#11758)
* docs(*): add parameter and result property tables to reference function pages and an overview to overloaded ones

* docs(*): link to the base type's properties when a parameter or result type has no property table

* docs(framework/*/reference): regenerate reference docs

* docs(framework/*/reference): regenerate reference docs

* chore(scripts/generate-docs): restore the 'dirname' import that the merge dropped

* docs(framework/*/reference): regenerate reference docs

* docs(scripts/generate-docs): label overloads in the overview with their declared parameter and return types

* docs(framework/*/reference): regenerate reference docs

* docs(scripts/generate-docs): convert declared intersection types from the source so signatures keep their alias names

* docs(framework/*/reference): regenerate reference docs

* docs(scripts/generate-docs): reword a comment to avoid the unknown word 'inlines'

* docs(scripts/generate-docs): skip a parameter table on overloaded pages when its heading is missing
2026-10-06 02:38:27 +09:00
Wonsuk Choi
1d2cf91305
chore(*): update '@tanstack/typedoc-config' to v0.3.4 (#11817)
* chore(*): update '@tanstack/typedoc-config' to v0.3.4 and load its custom settings plugin by package export

* docs(framework/*/reference): regenerate reference docs with '@tanstack/typedoc-config' v0.3.4

* docs(framework/*/reference): regenerate reference docs

* docs(framework/*/reference): regenerate reference docs
2026-10-05 12:41:28 +09:00