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

1,026 commits

Author SHA1 Message Date
github-actions[bot]
5cc606e2e8
ci: Version Packages (#12301)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-26 10:28:34 +01:00
Wonsuk Choi
14cc3302e3
style(packages): write durations in 'count * unit * 1000' order (#12382)
* style(packages): write durations in 'count * unit * 1000' order

* docs(framework/*/reference): regenerate 'Query' reference for the 'isStaleByTime' example
2026-10-26 02:30:25 +09:00
Wonsuk Choi
d7c0418f87
chore(react-query/{useQuery,useInfiniteQuery}): remove the unused '@eslint-react/no-nested-component-definitions' disable and explain the remaining false positive (#12344) 2026-10-25 21:11:06 +09:00
Wonsuk Choi
aa3e26b4f0
chore(react-query/{HydrationBoundary,utils}): explain why 'react-hooks-js/refs' and 'react-hooks-js/set-state-in-effect' are disabled (#12342) 2026-10-25 20:21:53 +09:00
Wonsuk Choi
b2801aa76f
test(react-query/useMutation): assert that the mutation settles in the cache after unmount while the component state stays unchanged (#12339) 2026-10-25 20:18:30 +09:00
Wonsuk Choi
43636c43e7
test(react-query/useMutation): wait for the mutation to settle after unmount and assert that no error is logged (#12334) 2026-10-25 13:39:49 +09:00
Wonsuk Choi
1eed9d9ef5
chore(*): explain why 'vitest-js/valid-expect' is disabled for the 'expectTypeOf<TQueryKey>(ctx.queryKey)' checks in the 'useQueries' type tests (#12332) 2026-10-25 13:28:51 +09:00
Wonsuk Choi
6bdeb13081
test(*/useQuery): rename the 'throwOnError' callback parameter to 'err' to avoid shadowing the returned 'error' (#12295) 2026-10-23 17:09:01 +09:00
Wonsuk Choi
86b9f20912
test(*/useMutationState): rename the built 'mutation' to 'existingMutation' to avoid shadowing the 'select' parameter (#12294) 2026-10-23 15:51:56 +09:00
Wonsuk Choi
d09972b850
test(*): rename the 'queryKey' test helper to 'createKey' since it creates keys for both queries and mutations (#12293)
* test(*): rename the 'queryKey' test helper to 'createKey' since it creates keys for both queries and mutations

* test(query-test-utils/createKey): change the key prefix from 'query_' to 'key-' since it is also used for mutation keys
2026-10-23 15:32:13 +09:00
Wonsuk Choi
84332ded75
chore({react-query,preact-query,query-broadcast-client-experimental}/vite.config): remove the CI-only 'retry' (#12279) 2026-10-22 17:21:04 +09:00
Wonsuk Choi
4b17d51f5c
test(*): remove manual 'mockRestore' calls already handled by 'restoreMocks' (#12277)
* test(*): remove manual 'mockRestore' calls already handled by 'restoreMocks'

* test(vue-query): unwrap the 'try' / 'finally' blocks that only call 'mockRestore'
2026-10-22 16:53:42 +09:00
Wonsuk Choi
bb41f83caa
chore(oxlint.config): add 'eslint-plugin-testing-library' with its DOM rules and query present elements with 'getBy' (#12269)
* chore(oxlint.config): add 'eslint-plugin-testing-library' with its DOM rules and query present elements with 'getBy'

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-10-22 11:37:21 +09:00
Wonsuk Choi
6aaecfd450
test(react-query/transition): remove the redundant 'act' around 'fireEvent.click' (#12270) 2026-10-22 11:37:03 +09:00
Wonsuk Choi
670fc2817f
chore(oxlint.config): add 'eslint-plugin-jest-dom' with its recommended rules and assert DOM presence with 'toBeInTheDocument' (#12268) 2026-10-22 10:56:42 +09:00
Wonsuk Choi
53060948a9
test({preact,react,solid}-query/useMutationState): use a template literal for the 'mutationFn' result (#12264) 2026-10-22 10:08:38 +09:00
Wonsuk Choi
6aaa0cb120
chore(oxlint.config): enable 'vitest-js/padding-around-describe-blocks' and separate describe blocks with a blank line (#12262) 2026-10-22 09:56:46 +09:00
Wonsuk Choi
28a8540176
chore(oxlint.config): enable 'vitest-js/padding-around-before-each-blocks' and separate 'beforeEach' with a blank line (#12260) 2026-10-22 09:54:20 +09:00
Wonsuk Choi
4a6264e8a5
chore(oxlint.config): enable 'vitest-js/padding-around-before-all-blocks' and separate 'beforeAll' with a blank line (#12259) 2026-10-22 09:48:33 +09:00
Wonsuk Choi
7cafffdbbe
chore(oxlint.config): enable 'vitest-js/padding-around-test-blocks' and separate test blocks with a blank line (#12258) 2026-10-22 09:39:09 +09:00
Wonsuk Choi
07bdb6bbec
chore(oxlint.config): enable 'vitest/require-mock-type-parameters' and type the mock functions (#12251) 2026-10-21 21:00:25 +09:00
Wonsuk Choi
5c7b9dbbce
chore(oxlint.config): enable 'vitest/prefer-strict-equal' and assert with 'toStrictEqual' (#12250)
* chore(oxlint.config): enable 'vitest/prefer-strict-equal' and assert with 'toStrictEqual'

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-10-21 20:06:34 +09:00
Wonsuk Choi
1616702eb0
chore(oxlint.config): enable 'vitest/require-hook' and move setup code into hooks or tests (#12249) 2026-10-21 19:47:42 +09:00
Wonsuk Choi
ada9a5eff5
chore(oxlint.config): enable 'vitest/prefer-mock-return-shorthand' and use 'mockReturnValue' or 'vi.fn(implementation)' (#12248) 2026-10-21 19:27:17 +09:00
Wonsuk Choi
5ba86a672f
chore(oxlint.config): enable 'vitest/prefer-to-be' and assert primitive values with 'toBe', 'toBeNull', 'toBeUndefined' and 'toBeDefined' (#12247) 2026-10-21 19:27:02 +09:00
Wonsuk Choi
4dc1af9828
chore(oxlint.config): enable 'vitest/prefer-to-have-length' and assert lengths with 'toHaveLength' (#12246) 2026-10-21 17:38:08 +09:00
Wonsuk Choi
5393cdc265
chore(oxlint.config): enable 'vitest/prefer-mock-promise-shorthand' and use 'mockResolvedValue' and 'mockRejectedValue' (#12242) 2026-10-21 15:20:32 +09:00
Wonsuk Choi
9648f0e3d6
chore(oxlint.config): enable 'vitest/prefer-called-times' and replace 'toHaveBeenCalledOnce' with 'toHaveBeenCalledTimes(1)' (#12240) 2026-10-21 15:15:28 +09:00
Wonsuk Choi
22d9966fba
chore(oxlint.config): enable 'vitest/prefer-called-with' and assert the call arguments with 'toHaveBeenCalledWith' (#12237) 2026-10-21 14:52:07 +09:00
Wonsuk Choi
25ed6ae410
chore(oxlint.config): enable 'vitest/prefer-expect-type-of' and assert the 'staleTime' type with 'toBeTypeOf' (#12236) 2026-10-21 14:50:52 +09:00
Wonsuk Choi
01703ec5d1
test({react,preact}-query/useMutationState): add a test for updating when only the mutation state changes (#12225) 2026-10-21 12:23:08 +09:00
Wonsuk Choi
d28d4d29bd
test({react,preact,solid,svelte,lit}-query,angular-query-experimental): assert the data tag directly in the 'skipToken'-only 'queryOptions' type test (#12218)
* test({react,preact,solid,lit}-query,angular-query-experimental): assert the data tag directly in the 'skipToken'-only 'queryOptions' type test

* test(svelte-query/queryOptions): assert the data tag directly in the 'skipToken'-only type test
2026-10-21 10:45:16 +09:00
github-actions[bot]
a8ecc8d42f
ci: Version Packages (#12128)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-19 18:54:46 +02:00
Dominik Dorfmeister 🔮
1f8d134ea3
fix(react, preact): recompute mutation state snapshots (#12117)
* fix(react-query): recompute mutation state snapshots

* test(react-query): assert visible mutation counts

* fix(react-query): preserve mutation result references across renders

* fix(react-query): cache snapshots for non-plain selector results

* fix(preact-query): recompute mutation state snapshots

* Apply suggestion from @TkDodo

* fix: remove useMemo
2026-10-19 12:57:16 +02:00
github-actions[bot]
12199722dc
ci: Version Packages (#12062)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-17 19:51:17 +02:00
chungyoung kim
1fee0443db
fix(query-core): clear mutations before notifying subscribers (#11470)
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-10-17 19:46:13 +02:00
JeongHoon
c20886163a
fix(react-query): retry queries with falsy errors on mount (#11328)
* fix(react-query): retry queries with falsy errors on mount

* refactor(react-query): keep throwOnError constant

---------

Co-authored-by: TkDodo <office@dorfmeister.cc>
2026-10-17 19:26:30 +02:00
Wonsuk Choi
a10839824c
fix(react-query*): declare '@types/react' as an optional peer dependency (#11728)
* fix(react-query*): declare '@types/react' as a peer dependency like 'react-query-devtools'

* fix(react-query*): mark '@types/react' as an optional peer dependency
2026-10-17 18:07:05 +02:00
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
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
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
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
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
Wonsuk Choi
b42166e557
docs(react-query): add JSDoc to the exported interfaces and type aliases (#11868) 2026-10-04 11:41:22 +09:00
Wonsuk Choi
205d422412
docs(*): add missing JSDoc descriptions and enforce 'jsdoc/require-description' (#11860)
* docs(*): add missing JSDoc descriptions

* chore(eslint.config): enforce 'jsdoc/require-description'
2026-10-04 05:16:10 +09:00