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

261 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
b4212cc9f8
test(preact-query/useMutation): assert that the mutation settles in the cache after unmount while the component state stays unchanged (#12340) 2026-10-25 20:18:48 +09:00
Wonsuk Choi
a6211e3b2f
test(preact-query/useMutation): wait for the mutation to settle after unmount and assert that no error is logged (#12335) 2026-10-25 13:40:14 +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
715574d87b
test(preact-query/ErrorBoundary): name the 'react/no-did-update-set-state' rule in the bare 'oxlint-disable-next-line' comment (#12323) 2026-10-25 12:13:05 +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
2de1d1e15c
chore(preact-query/utils): disable 'react/exhaustive-deps' for the stable '_instance' to keep the upstream 'useSyncExternalStore' (#12289) 2026-10-23 10:02:50 +09:00
Wonsuk Choi
67a8784445
docs(preact-query/utils): pin the preact and React 'useSyncExternalStore' source links to the copied commits (#12288) 2026-10-23 10:00:30 +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
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
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
Jooyoung Shin
0addcd2a9a
fix(preact-query): retry on mount for falsy errors when throwOnError returns false (#11375)
* fix(preact-query): retry on mount for falsy errors when throwOnError returns false

`ensurePreventErrorBoundaryRetry` only evaluated a function-valued
`throwOnError` when `query.state.error` was truthy. For a query that
rejected with a falsy value (e.g. `undefined`), the callback was skipped
and the function itself was treated as truthy, so `retryOnMount` was
disabled even though `throwOnError` would have returned `false`.

Check `query.state.status === 'error'` instead so the callback runs for
every failed query. Ports #11328 to preact-query.

* refactor(preact-query): keep throwOnError constant

---------

Co-authored-by: TkDodo <office@dorfmeister.cc>
2026-10-17 19:23:55 +02:00
Wonsuk Choi
fc3a3848f2
fix({preact,solid,svelte,angular-query-experimental}): switch to 'export type *' for type-only re-exports (#11251)
* fix({preact,solid,svelte,angular-query-experimental}): switch to 'export type *' for type-only re-exports

* chore(.changeset/export-type-star-adapters): trim redundant PR cross-reference from changeset body
2026-10-17 18:51:10 +02:00
Paul Nguyen
2ce51902de
fix(preact-query): do not go into optimistic fetching state when not subscribed (#11259)
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-10-17 17:42:13 +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
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
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
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
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