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

5,002 commits

Author SHA1 Message Date
Vlad Kovechenkov
f97d7258a0
docs: mention second parameter for cancelQueries (#9597)
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-09-02 12:08:19 +09:00
Imad Selka
0650eaf116
docs: clarify queryClient refetch behavior for stale queries (#9560)
* docs(queryClient): add example for refetchQueries with stale: true and type: active

* docs(react-native): modify useRefreshOnFocus example

* docs(react-native): add queryKey in useRefreshOnFocus example

* Apply suggestion from @TkDodo

* 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>
2025-09-01 12:53:17 +02:00
Tanner Linsley
b998f68a57 release: v5.85.6 v5.85.6 2025-08-30 12:21:11 +00:00
Dominik Dorfmeister
379670dd0a
fix(core): make sure queries revert synchronously (#9601)
the switch from the callback approach to async/await with catch was necessary to be able to transform errors into revert-state data for imperative query calls; however, this was a change in behavior because catch in async/await doesn't happen immediately - it runs in the next microtask. That opened up an opportunity for a slight race condition if we re-start a fetch in-between. And who does that? Of course, React Strict Mode.

This PR moves the actual state reverting back to a callback (so it happens synchronously), while still keeping the try/catch refactoring merely to transform the promise and the usual error handling
2025-08-30 14:19:17 +02:00
우혁
428c19fa33
docs: update mutation status type (#9595)
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-08-30 14:47:27 +09:00
우혁
2a8ba49919
docs: remove unnecessary trailing comma (#9594)
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-08-30 14:44:30 +09:00
우혁
54efe225b6
docs: fix type definitions in useQuery options (union, parameters, extra parentheses) (#9596)
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-08-30 14:36:19 +09:00
우혁
ad0ca9f37c
docs: fix missing comma in useMutation example to prevent syntax errors (#9593)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-30 14:28:48 +09:00
Wonsuk Choi
a1b1279be3
test(react-query/useMutation): remove '@testing-library/jest-dom/vitest' import (#9569)
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-08-20 12:58:59 +09:00
renovate[bot]
7c464e3ded
chore(deps): update marocchino/sticky-pull-request-comment digest to 9c40848 (#9473)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-19 12:29:46 +02:00
Kier Borromeo
1b0346fca8
docs: Updates examples for invalidation from mutations (#9261)
* Updates examples for invalidation from mutations

* ci: apply automated fixes

* Elaborate promise

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-19 12:23:41 +02:00
Dmytro Borysov
9a3f68373d
docs: Add not-prose class to browser logo images in devtools documentation (#9556) 2025-08-19 11:59:08 +02:00
Tanner Linsley
0a0e01443d release: v5.85.5 v5.85.5 2025-08-19 09:41:34 +00:00
Dominik Dorfmeister
abab082593
fix(core): only reject when promise gets used (#9576)
* fix(core): do not reject promise right away - only when `promise` gets used

* Apply suggestion from @TkDodo

* fix: status check
2025-08-19 11:39:34 +02:00
Tanner Linsley
ef0a9d2c7e release: v5.85.4 v5.85.4 2025-08-19 09:10:56 +00:00
Dominik Dorfmeister
e4f5ce8ec2
fix(core): never revert to undefined data (#9577)
* fix(core): never revert to undefined data

* fix: throw CancelledError for imperative fetches, but keep query reverted to idle state

* chore: improve test
2025-08-19 11:09:11 +02:00
Lee
2989e69dc0
docs(react-query): recommend defaultError = unknown instead of AxiosError (#9575)
* docs(react-query): recommend defaultError = unknown instead of AxiosError

Signed-off-by: leesb971204 <leesb971204@gmail.com>

* docs(react-query): clarify usage of defaultError in global Error type registration

Signed-off-by: leesb971204 <leesb971204@gmail.com>

* ci: apply automated fixes

* docs(solid-query): recommend defaultError = unknown instead of AxiosError

Signed-off-by: leesb971204 <leesb971204@gmail.com>

* docs(angular-query): recommend defaultError = unknown instead of AxiosError

Signed-off-by: leesb971204 <leesb971204@gmail.com>

* docs(vue-query): add example code for Registering a global Error

Signed-off-by: leesb971204 <leesb971204@gmail.com>

---------

Signed-off-by: leesb971204 <leesb971204@gmail.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-18 17:46:32 +02:00
TkDodo
f1e608bcac docs: update community resources 2025-08-18 12:19:08 +02:00
Tanner Linsley
b6516bd25e release: v5.85.3 v5.85.3 2025-08-14 13:05:50 +00:00
Dominik Dorfmeister
51aad7ddf7
fix(query-core): race condition in StrictMode (#9565) 2025-08-14 15:04:05 +02:00
TkDodo
de3626a368 test(core): tests for StrictMode behaviour 2025-08-14 13:49:05 +02:00
Tanner Linsley
e14f39c6ee release: v5.85.2 v5.85.2 2025-08-14 08:51:42 +00:00
Dominik Dorfmeister
0991576781
fix(query-core): query cancellation and reverting (#9293)
* fix: we don't want errors that get reverted internally to throw on imperative methods

to achieve that, we let the retryer's `onError` "transform" the result back to potentially TData, and if so, we'll resolve the promise to that instead; that means calls to `fetchQuery` will be "successful" when a cancellation happens in the meantime, but they will then resolve to the reverted data; also, if the initial fetch is cancelled, we would still throw, as there is no data to revert to.

* refactor: async/await

* minimal test adjustments

* test: fix it

* fix: revertState is now a local variable

* fix: make sure "silent" reverts do not reject ongoing promises

up until now, silent reverts have only stopped the query from going into error state, but the exposed promise was still rejected

now, the promise won't reject because a silent revert indicates another refetch happening, so we'd want to get that promise's result instead

this also means "silent" is an internal thing that shouldn't be used by consumers, because it can lead to never resolving promises instead

* chore: bring back isCancelledError and deprecate it

* test: revert changes

* test: minimal adjustment to timings
2025-08-14 10:49:58 +02:00
Tanner Linsley
31f51b97fa release: v5.85.1 v5.85.1 2025-08-14 07:57:58 +00:00
Dominik Dorfmeister
4806dfaf23
fix(query-core): have revertState capture manual updates (#9558) 2025-08-14 09:56:12 +02:00
TkDodo
9ae770b9d0 chore: update bundle-size badges to react 19.1.1 2025-08-14 09:50:27 +02:00
Tanner Linsley
aab51d9398 release: v5.85.0 v5.85.0 2025-08-12 12:41:10 +00:00
Alem Tuzlak
c63713fc38
feat: add solid devtools panel export to solid devtools (#9551)
* feat: add solid devtools panel export to solid devtools

* ci: apply automated fixes

* fix knip + eslint

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me>
2025-08-12 14:37:39 +02:00
Dmytro Borysov
6402d756b7
chore: update browser icons (#9555) 2025-08-11 18:22:20 +02:00
Dmytro Borysov
d25c0da344
docs: Add Firefox and Edge browser extension support to devtools docs (#9548)
- Add browser logos for Chrome, Firefox, and Edge
- Update devtools documentation across all frameworks to include Firefox and Edge extensions
- Replace Chrome-only messaging with multi-browser support
- Add inline browser icons with links to respective extension stores
2025-08-11 13:08:47 +02:00
Lubos
763cee3e16
Add oRPC to community projects for TanStack Query (Vue) (#9539)
* Add oRPC to community projects for TanStack Query (Vue)

* Update oRPC link to TanStack Query integration

This should make oRPC more relevant when people search for things like "orpc tanstack query"

---------

Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-08-10 03:58:05 +09:00
Lubos
fba477ba2b
Add oRPC to community projects for TanStack Query (React) (#9538)
* Add oRPC to community projects for TanStack Query (React)

* Update oRPC link to TanStack Query integration

This should make oRPC more relevant when people search for things like "orpc tanstack query"

---------

Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-08-10 03:52:50 +09:00
Lubos
3a999ccd9f
Add Hey API to community projects for TanStack Query (Vue) (#9535)
* Add Hey API to community projects for TanStack Query (Vue)

* Update Hey API link to TanStack Query plugin

This should make Hey API more relevant when people search for things like "openapi tanstack query"

---------

Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-08-10 03:48:20 +09:00
Lubos
0455d58bd7
Add Hey API to community projects for TanStack Query (React) (#9534)
* Add Hey API to community projects for TanStack Query (React)

* Update Hey API link to TanStack Query plugin

This should make Hey API more relevant when people search for things like "openapi tanstack query"

---------

Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-08-10 03:44:39 +09:00
Wonsuk Choi
6bf2eb7450
chore(tsconfig.json): add 'test-setup.ts' to 'include' array (#9545)
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-08-10 03:25:04 +09:00
Wonsuk Choi
77e53b0c21
test(react-query/useIsFetching): remove unnecessary 'advanceTimersByTimeAsync', unify to 'rendered', and add detailed 'expect' for custom queryClient and state updates during rendering (#9530) 2025-08-10 03:05:44 +09:00
Arnoud
95db48b81a
chore(angular-query): add infiniteQueryOptions tests from react-query (#9544) 2025-08-09 13:43:11 +02:00
Tanner Linsley
edd1bd08e0 release: v5.84.2 v5.84.2 2025-08-08 14:00:25 +00:00
Arnoud
cd6ea9a7ab
fix(angular-query): align mutation options to most recent react-query types (#9543)
* fix(angular-query): align mutation options to most recent react-query types

* add tests
2025-08-08 15:57:42 +02:00
Wonsuk Choi
34657e5a12
test(react-query/mutationOptions): add tests for without 'mutationKey' in 'mutationOptions' and add 'sleep' to 'mutationFn' (#9510)
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-08-02 00:41:34 +09:00
Tanner Linsley
0db1056fdb release: v5.84.1 v5.84.1 2025-08-01 12:14:43 +00:00
Arnoud
025f080bb3
refactor(angular-query): restructure package type declaration path (#9519)
To support future sub-path exports in apps still using moduleResolution: node type declarations should be located in the same path as the corresponding implementation .mjs file
2025-08-01 14:11:54 +02:00
Wonsuk Choi
711010ce73
test(react-query/QueryResetErrorBoundary): add 'sleep' and simplify 'queryFn', add multiple 'expect' cases (#9523) 2025-08-01 18:10:22 +09:00
Tanner Linsley
6a85584fe1 release: v5.84.0 v5.84.0 2025-07-31 19:52:28 +00:00
JonLuca De Caro
7b19d49e67
feat(devtools): add setting to hide disabled queries (#9500)
* feat(devtools): add setting to hide disabled queries

* chore(name): rename disable queries param

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2025-07-31 21:48:18 +02:00
clover caruso
e07812be21
fix(react-query): HydrationBoundary has strictly typed state (#9520)
* fix(react-query): HydrationBoundary has strictly typed `state`

Only type definition changes, the `state` parameter is now required and
must be `DehydratedState` (or nullish). Every case omitting this prop or
passing a different shape is a bug now caught by `tsc`. Correct code has
no action needed.

Closes #9323

* 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>
2025-07-31 21:48:07 +02:00
Sajad Torkamani
c8322d96b1
docs: add missing period (#9509)
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-07-31 20:35:25 +02:00
Arnoud
250dbd9b6a
chore(angular-query): run publint and attw on tarball (#9518)
using built-in packaging of these tools does not run prepack
2025-07-31 16:17:05 +02:00
Tanner Linsley
8f474ad817 release: v5.83.1 v5.83.1 2025-07-31 12:42:20 +00:00
Arnoud
422f2ecbd6
refactor(angular-query): build package using vite (#9517) 2025-07-31 14:38:33 +02:00