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

4,997 commits

Author SHA1 Message Date
Lachlan Collins
1865f0db1b
test(react-query): better query-persist-client-core import (#8212) 2024-10-24 14:21:58 +11:00
Uğurcan Emre Ataş
caf6556fce
chore(docs): update useQueryFocusAware docs (#8205)
* chore(docs): update react native useQueryFocusAware docs

* 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>
2024-10-23 15:29:30 +02:00
Tanner Linsley
820bb81ba8 release: v5.59.16 v5.59.16 2024-10-23 12:53:17 +00:00
Dominik Dorfmeister
df49fbdd63
fix(react-query): make sure promises are always finalized (#8211)
otherwise, there can be cases with multiple observers where we have listeners already, but still need to finalize
2024-10-23 14:51:27 +02:00
Haeun Nam
4fceb260d5
chore(query-core): define queryCache notify method's return type (#8191)
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-10-23 12:52:04 +02:00
Jonghyeon Ko
d3e2a8ad7a
chore(react-query): remove unnecessary test file (__test__/suspense.tsx, suspense.test-d.tsx) (#8208)
* refactor(react-query): remove unnecessary test file

* chore: update
2024-10-23 11:44:17 +02:00
Ollie Chick
9d99fcb950
docs: Update disabling-queries.md (#8201) 2024-10-21 10:28:33 +02:00
Qiushi Yan
a2ea754e54
docs(react-query): fix prefetch with suspense example (#8193)
* docs: react prefetch with suspense example

* remove notifyOnChangeProps from usePrefetchQuery
2024-10-20 19:10:59 +02:00
Ariel-Moroshko
1980a11f91
docs: 'hydrate' to 'dehydrate' in documentation (#8190) 2024-10-16 14:50:54 +02:00
Tanner Linsley
0c720e1a92 release: v5.59.15 v5.59.15 2024-10-15 17:12:43 +00:00
Gwansik Kim
6c067817d9
fix(react-query): resolve overload matches error with exactOptionalPropertyTypes in queryOptions (#8186) 2024-10-15 19:09:18 +02:00
Tanner Linsley
1adaf3ff86 release: v5.59.14 v5.59.14 2024-10-15 07:20:28 +00:00
Julius Marminge
a085c92a53
fix(react-query): make queryFn optional again (#8176)
* make queryFn optional again

* more fix
2024-10-15 09:16:41 +02:00
Dominik Dorfmeister
d40985401e
fix(react-query): do not overwrite staleTime with the suspense default value if it's a function (#8174)
* fix(react-query): do not overwrite staleTime with the suspense default value if it's a function

* test: improve

* chore: fix test
2024-10-13 11:21:25 +02:00
Tanner Linsley
2649e52df5 release: v5.59.13 v5.59.13 2024-10-12 09:38:41 +00:00
Dominik Dorfmeister
5d69ad773a
fix(query-core): don't finalizeThenable of different queries (#8171)
* fix(query-core): don't finalizeThenable of different queries

if we have multiple promises in-flight, once they resolve, we need to make sure to not finalize with data / error from a different key; otherwise, we might see intermediate data of non-matching keys

* chore: extract promise tests to their own file

* test: add a test case for not resolving with intermediate data

* fix: only stop finalizing if we were previously in pending state

this makes sure we can read stale data from entries when switching to them immediately

* chore: add another test for background updates
2024-10-12 11:36:30 +02:00
Tanner Linsley
8e805fb186 release: v5.59.12 v5.59.12 2024-10-12 07:40:50 +00:00
Dominik Dorfmeister
4758303dd9
fix(query-core): move thenable-recreation into createResult (#8169)
* fix: move thenable-recreation into createResult

`updateResult` will only be called after a fetch, but when we switch between caches without a fetch, we will only call `createResult`; this fix stops `data` from the queryResult and the `thenable` to go out-of-sync; it's backwards compatible because `updateResult` also invokes `createResult`

* oops

* test: I'm sick of this flaky test

* chore: eslint reports an unused type assertion here
2024-10-12 09:36:47 +02:00
Ciarán Curley
4dfb0fc0e6
types(react-query): export QueryErrorResetBoundaryFunction (#8089)
* feat(react-query): export QueryErrorResetBoundaryFunction

Export the QueryErrorResetBoundaryFunction render prop function
signature so users don't have to write wierd types of there own

* fix: add extra functions

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-10-12 09:36:24 +02:00
Tanner Linsley
babf66f2b9 release: v5.59.11 v5.59.11 2024-10-11 18:36:13 +00:00
Gwansik Kim
a991d922e8
refactor(types): throw type error when skipToken is present in suspense query (#8082)
* refactor: handle type error when skipToken is present in suspense query

* test(react-query): add skipToken test for query hooks

* fix: merge form main

* ci: apply automated fixes

* feat(react-query): display “skipToken is not allowed” message in suspense hooks

* feat(react-query): display “skipToken is not allowed” message in suspense hooks

* feat(react-query): display “skipToken is not allowed” message in suspense hooks

* fix(react-query): update error message in useSuspenseInfiniteQuery

* test(react-query): add test case

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-10-11 20:30:05 +02:00
Tanner Linsley
c6351949d1 release: v5.59.10 v5.59.10 2024-10-11 18:24:41 +00:00
Dominik Dorfmeister
5edd617eac
fix(core): correctly gc query when suspense is used when query unmounts while it's still fetching (#8168)
* fix(core): correctly gc query when suspense is used when query unmounts while it's still fetching

the `isFetchingOptimistic` workaround was added to make sure some "thing" I don't remember anymore works in suspense; we added tests for that;

however, in the meantime, we added a minimum gcTime for suspense queries, which also solves that problem (tests still work); this makes the `isFetchingOptimistic` workaround unnecessary, and this workaround is actually what causes the unmount issue

* chore: try to stabilize a flaky test
2024-10-11 20:21:58 +02:00
Sunghoon
931d98d5ab
fix(react-query): Allow optional initialData object in queryOptions (#8162)
* fix(react-query): Allow optional initialData in infiniteQueryoptions

* fix(react-query): Allow optional initialData object in queryOptions

* refactor(react-query): removed unnecessary lines in infiniteQueryOptions test

---------

Co-authored-by: chosunghoon <shcho@team-everywhere.com>
2024-10-11 07:27:02 +02:00
Tanner Linsley
6469385c8b release: v5.59.9 v5.59.9 2024-10-10 18:57:09 +00:00
Dominik Dorfmeister
5228e5170c
fix(core): don't consider queries as enabled if they have no observers and have never fetched (successfully or erroneously) (#8161)
it's very likely that this used to be a disabled observer; one other case would be canceling a query while you were initially fetching it, but this is a weird corner case that brings all sorts of troubles

additionally, we can check for the queryFn being a skipToken; even if we have data in the cache, when the queryFn is currently set to skipToken, this is means we never want to see this query fetch
2024-10-10 20:55:29 +02:00
Gwansik Kim
e3aca98134
test(react-query): update describe in infiniteQueryOptions.test-d.tsx (#8081) 2024-10-10 10:30:06 +02:00
Tanner Linsley
0f7baef16c release: v5.59.8 v5.59.8 2024-10-09 19:10:22 +00:00
Jimmy Callin
329b5f8241
fix: allow optional initialData object (#8157)
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-10-09 21:06:53 +02:00
Tanner Linsley
eb341fcdac release: v5.59.7 v5.59.7 2024-10-09 16:21:25 +00:00
Manuel Schiller
81e443caed
fix(eslint-plugin-query): ignore all non-identifier properties in rule infinite-query-property-order (#8158)
fixes #8156
2024-10-09 18:14:17 +02:00
Tanner Linsley
dcffe899fa release: v5.59.6 v5.59.6 2024-10-09 14:34:18 +00:00
David
54995777af
fix(perf): improve long running task performance in query core (#8107)
* fix: improve long running task performance in query core

This addresses two hot spots we have noticed
on a large scale enterprise app when profiling
with chrome. These changes help to cut down
on long running tasks when there are many query
calls on the page

* refactor: remove two more arrays to be more efficient

* refactor: remove queryObserver improvement from PR

* refactor: packages/query-core/src/queryObserver.ts remove

---------

Co-authored-by: davidaghassi <davidaghassi@robinhood.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-10-09 16:11:57 +02:00
Tanner Linsley
44b70f1200 release: v5.59.5 v5.59.5 2024-10-09 14:00:16 +00:00
Sunghoon
8d03029fa1
fix(react-query): Allow optional initialData in infiniteQueryOptions (#8154)
* fix(react-query): Allow optional initialData in infiniteQueryoptions

* fixup! fix(react-query): Allow optional initialData in infiniteQueryoptions

---------

Co-authored-by: chosunghoon <shcho@team-everywhere.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-10-09 15:54:50 +02:00
Tanner Linsley
6c13d01799 release: v5.59.4 v5.59.4 2024-10-09 13:02:22 +00:00
Sol Lee
85a525a309
chore(eslint-plugin-query): expect-expect warning for expectArrayEqualIgnoreOrder (#8143)
* fix: `expect-expect` warning for `expectArrayEqualIgnoreOrder`

* fix: lint error could not find plugin `vitest`
2024-10-09 14:59:14 +02:00
Sol Lee
78b086bd38
chore: no-shadow lint warning in insertAtPositions() (#8142)
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-10-09 14:58:36 +02:00
Dominik Dorfmeister
cae25241b9
fix(core): do not inform QueriesObserver subscribers if combined result hasn't changed (#8153) 2024-10-09 14:57:36 +02:00
Dominik Dorfmeister
05ccd65795 test: hydration test case for overwriting with promise 2024-10-09 14:36:25 +02:00
pawel-twardziak
eb2f9d3498
fix(eslint-plugin-query): handle callable params within exaustive-deps rule (#8150)
Closes #8093

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-10-09 14:31:00 +02:00
Tanner Linsley
f1f25291db release: v5.59.3 v5.59.3 2024-10-09 05:48:28 +00:00
jxom
e419ab1502
fix(query-core): new cache entry check (#8151)
* fix: queryKeyHashFn

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-09 07:45:01 +02:00
Tanner Linsley
332c5263e4 release: v5.59.2 v5.59.2 2024-10-08 12:32:41 +00:00
Eliya Cohen
c232a6fdec
fix(eslint-plugin-query): handle nullish coalescing operator in exhaustive-deps rule (#8146)
* fix: handle nullish coalescing operator in exhaustive-deps rule

Ensure that the exhaustive-deps rule correctly handles cases where the nullish coalescing operator (??) is used in query functions.

Example test case:

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-08 14:30:13 +02:00
Sol Lee
495b0867e1
chore(eslint-plugin-query): change naming for text variables (#8135) 2024-10-07 11:05:25 +02:00
renovate[bot]
2fe16e5588 chore(deps): update dependency svelte to v4.2.19 [security] 2024-10-04 18:02:03 +00:00
renovate[bot]
08a568dbbc chore(deps): update dependency vite to v5.3.6 [security] 2024-10-04 16:48:29 +00:00
Tanner Linsley
8cec02a106 release: v5.59.1 v5.59.1 2024-10-04 12:03:48 +00:00
Sol Lee
bb8278d4c5
fix(eslint-plugin-query): update deprecated getSourceCode() method (#8117)
* fix(eslint-plugin-query): update deprecated `getSourceCode()` method

* chore: add eslint-disable

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-10-04 14:01:04 +02:00