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
Tanner Linsley
d07fc32e6e release: v5.28.2 v5.28.2 2024-03-14 16:54:54 +00:00
Gaute Meek Olsen
75131d6447
fix(core): do not update completed mutations (#7104)
* fix(core): do not update completed mutations

* test(core): verify mutations meta in cache with multiple mutations

* style(core): prettier formatting

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-03-14 17:47:59 +01:00
Tanner Linsley
ee2112cc2f release: v5.28.1 v5.28.1 2024-03-14 14:20:21 +00:00
Andre de Waard
cdd4093478
fix(vue-query): add correct type to ensureQueryData (#7107) 2024-03-14 15:15:02 +01:00
Tanner Linsley
fe7dca6955 release: v5.28.0 v5.28.0 2024-03-13 12:22:53 +00:00
Andre de Waard
e34bf4d03a
feat(ensureQueryData): add 'revalidateIfStale' option (#6996)
* feat(fetchQuery): add 'prefetchWhenStale' option

* Revert "feat(fetchQuery): add 'prefetchWhenStale' option"

This reverts commit 76cd6a7719.

* fetch(ensureQueryData): Add revalidateIfStale option

* fetch(ensureQueryData): Add revalidateIfStale option

* fetch(ensureQueryData): Add revalidateIfStale option

* test(ensureQueryClient) implemented test for new option 'revalidateIfStale'

* Update packages/query-core/src/queryClient.ts

* feat(fetchQuery): formatted file

* Update docs/reference/QueryClient.md

* chore: prettier

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-03-13 13:15:28 +01:00
Tanner Linsley
be20804388 release: v5.27.8 v5.27.8 2024-03-12 17:31:18 +00:00
Aryan Deora
93674fe566
fix(query-devtools): Preserve offline status after minimize (#7096) 2024-03-12 13:26:57 -04:00
Tanner Linsley
ecfac38716 release: v5.27.7 v5.27.7 2024-03-12 14:57:32 +00:00
Eliya Cohen
da3c4de1e1
fix(eslint-plugin-query): query key with nullish coalescing operator (#7092) 2024-03-12 15:55:27 +01:00
Tanner Linsley
11783b5566 release: v5.27.6 v5.27.6 2024-03-12 14:19:17 +00:00
Michelle Johnson
74fbe64360
fix(query-devtools): Apply styles to explorer component in Shadow DOM (#7090) 2024-03-12 10:14:29 -04:00
Lachlan Collins
bf92176c08
docs: Update docs/config.json (#7087)
* docs: Update docs/config.json

* Update schema
2024-03-12 20:43:28 +11:00
Tanner Linsley
3a4e1efdca release: v5.27.5 v5.27.5 2024-03-12 09:30:06 +00:00
Dominik Dorfmeister
61f5507cd3
fix(core): resumed mutations should not be interrupted by refetches (#7085)
* fix(core): resumed mutations should not be interrupted by refetches

it's important that we don't run a refetch while we're resuming paused mutations, because that could lead to UI flicker. With this fix, we're awaiting until the resume has finished before triggering a refetchOnReconnect or refetchOnWindowFocus

* test: function is async now
2024-03-12 10:26:17 +01:00
Tanner Linsley
7e4d772f3c release: v5.27.4 v5.27.4 2024-03-12 08:57:39 +00:00
Dominik Dorfmeister
549862e34d
refactor(core): remove reference to internal promise field (#7086)
because it's always a 1:1 mapping to the promise of the retryer
2024-03-12 09:54:40 +01:00
Tanner Linsley
26a6f2a1ab release: v5.27.3 v5.27.3 2024-03-12 07:56:49 +00:00
Dominik Dorfmeister
c55f609ffe
fix(core): do not count disabled observers as stale (#7059)
* fix: do not notify the cache of `observerOptionsUpdated` if the prevOptions weren't defaulted

non-defaulted prev options indicate a "mount" event, in which case we don't want to fire an "update" event

* fix: react-query tests

with the new assumption that disabled observers are not stale

* fix: solid-query tests

with the new assumption that disabled observers are not stale

* fix: re-add check

accidentally removed to test a failing test

* fix: prefer the stale value of observers if one exists

that check looks for data not undefined anyways, but it also returns "fresh" for disabled observers now
2024-03-12 08:48:06 +01:00
austin johnson
a437f6d8f9
docs: Typo fix in url for react query native dev tools link (#7024)
* Update devtools.md

Add note about new dev tools created in react native

* Update devtools.md

* Update docs/framework/react/devtools.md

* chore: prettier

* Update devtools.md

Fixed a typo making the link not accessible

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-03-12 08:39:16 +01:00
Dominik Dorfmeister
605b8e957b
fix(core): make sure all options of a query are reactive (#7081)
* fix: make sure all options of a query are reactive

currently, only observer based options are updated between renders (like staleTime), but query level ones are not (like retryDelay). This makes no sense, so trying to streamline here

The deleted test checked for multiple useQuery calls in the tree with different options, which I don't think happens a lot in practice.

As a side-effect, the queryFn is also updated, so it will see values from a closure. This shouldn't matter because everything used in the queryFn must be part of the queryKey

* test: solid adapter
2024-03-12 08:37:14 +01:00
Tanner Linsley
990758b5d8 release: v5.27.1 v5.27.1 2024-03-12 07:25:17 +00:00
Sol Lee
78ace08a6c
fix(query-core): Replace the deprecated 'window' with 'globalThis' for Deno (#7029)
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-03-12 07:33:39 +01:00
Tanner Linsley
7f27e253ce release: v5.27.0 v5.27.0 2024-03-12 02:25:21 +00:00
Michelle Johnson
d4def6ba7e
feat(query-devtools): Add shadowDOMTarget property to react-query-devtool (#7005)
* feat(devtools): add shadowDOMTarget prop to vue, svelte, angular and solid
2024-03-11 22:19:54 -04:00
Dominik Dorfmeister
97f274e161
docs: Update react-native.md
closes #7065
2024-03-11 20:22:57 +01:00
Jonghyeon Ko
4254b62750
chore(vue-query): add vite.config.ts as tsconfig's include field (#7063)
* chore(vue-query): ad vite.config.ts as tsconfig include

* chore: update
2024-03-11 12:58:59 +01:00
Tanner Linsley
ea66e94c47 release: v5.26.3 v5.26.3 2024-03-11 11:33:15 +00:00
Dominik Dorfmeister
2819dcda57
fix(core): pass isFocused boolean to focusManager callback (#7066) 2024-03-11 12:30:07 +01:00
Jonghyeon Ko
181e9d2e59
test(solid-query): update vitest type test correctly (#7031)
* test(solid-query): update vitest type test code correctly (expectTypeOf)

* chore: update

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-03-09 23:53:34 +01:00
Dominik Dorfmeister
914876fd7d
chore: Revert "test(vue-query): use vitest typecheck correctly with *.test-d.ts (#6988)" (#7068)
This reverts commit 9da12e2b97.
2024-03-09 19:05:52 +01:00
Jonghyeon Ko
7e4b45c1c7
ci(eslint): add vue-demi as cspell words (#7064)
* ci(eslint): add vue-demi as cspell words

* chore: update
2024-03-09 18:57:59 +01:00
Jonghyeon Ko
9da12e2b97
test(vue-query): use vitest typecheck correctly with *.test-d.ts (#6988)
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-03-09 18:28:41 +01:00
Dominik Dorfmeister
9c07aae7eb test: simplify a flaky test 2024-03-09 18:19:47 +01:00
Dominik Dorfmeister
9cb77a764b
test: try to fix flakiness around offline mocks (#7061)
* fix(query-core): allow for unconditional resuming of paused mutations if we get an online event

and try to stabilize flaky test

* test: do not rely on dispatching events in tests

that could influence other tests

* test: don't use getAll
2024-03-09 17:45:40 +01:00
Dominik Dorfmeister
661ddd3bfd
docs: fix link in typescript.md 2024-03-09 16:06:46 +01:00
Jonghyeon Ko
25623e2a58
test(query-core): update vitest type test correctly (#7039)
* test(query-core): update vitest type test code correctly

* chore: update

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-03-09 15:41:23 +01:00
Jonghyeon Ko
770f0817b9
ci(eslint): add typecheck for cspell words (#6939)
* ci(eslint): add `typecheck` for cspell words

* chore: update
2024-03-09 15:35:01 +01:00
Dominik Dorfmeister
5f35da21b2
test: setup global mock restore (#7060)
* test: setup global mock restore

* chore: revert changes for vue-query
2024-03-09 15:33:23 +01:00
Jonghyeon Ko
f9ecde2ee5
test(react-query): update vitest type test correctly (#6990)
* test(react-query): update vitest type test code correctly (expectTypeOf)

* chore: update

* chore(react-query): remove optional chaining

* chore: update

* chore: update
2024-03-09 11:12:41 +01:00
Tanner Linsley
4e340a2bd0 release: v5.26.2 v5.26.2 2024-03-07 21:57:13 +00:00
Arnoud
59dbe58d52
fix(angular-query): support throwOnError (#7052) 2024-03-07 22:52:39 +01:00
Tanner Linsley
b16761abc9 release: v5.26.1 v5.26.1 2024-03-07 01:18:20 +00:00
Arnoud
e5e03048e3
fix(angular-query): run observer listeners in angular zone (#7040) 2024-03-07 02:14:11 +01:00
Tanner Linsley
1e1bbcf21c release: v5.26.0 v5.26.0 2024-03-05 22:15:19 +00:00
Riccardo Perra
a00dc08152
feat(angular-query): support required input signal on injectMutation (#7016)
* test(angular-query): add set signal input test utils

* test(angular-query): add some missing test for required input signal to inject query

* feat(angular-query): add required input signal support to inject mutation

* feat(angular-query): add inject mutation test

* feat(angular-query): add lazy signal initializer

* feat(angular-query): add required input signal support for injectMutationState

* feat(angular-query): lazy signal initializer test

* feat(angular-query): lazyInit test and init without reactive context

---------

Co-authored-by: Arnoud <6420061+arnoud-dv@users.noreply.github.com>
2024-03-05 23:10:29 +01:00
Tanner Linsley
f366cae2d3 release: v5.25.0 v5.25.0 2024-03-05 15:12:10 +00:00
Jaaneek
77d5b2eaec
feat: add typesafe query disabling via skipToken (#6999)
* feat: add typesafe react-query disabling via skipToken

* feat: add unique identifier to skip token

* feat(query-core): implement skipToken

* chore(query-core): refactor logic of skipToken

* feat(react-query): do not allow skipToken in useSuspenseQuery

* feat(react-query): handle skip token in suspense react queries, add tests

* refactor(query-core): remove check for queryFn === skipToken, enabled is set to false instead

* refactor(query-core): remove check for queryFn === skipToken, enabled is set to false instead

* chore(react-query): remove unused imports

* fix(react-query): update test to display error message in error boundary

* fix(query-core): reduce bundle size by using Symbol() instead of Symbol.for

* fix(query-core): move check for skipToken into already existing if statement

* refactor(query-core): remove no longer needed check for skipToken

* refactor(query-core): make sure enabled===true takes precendence over skipToken

* refactor(react-query): remove unnecesary check for skipToken

* feat: bring back logging in dev mode

* docs: use `skipToken` in TypeScript examples

* refactor: remove checks that shouldn't be necessary because we now assign `enabled` in `defaultQueryOptions`

* types: adjust useQueries types in non-react adapters

* fix: infiniteQueryBehavior needs to _create_ a function that rejects if we have a skipToken, not reject right away

* refactor: flip condition

* try to fix query options

* fix: make core compilable

* fix: allow skipToken on type level for useSuspenseQuery and warn at runtime

it won't work anyways

* test: dataTag + skipToken

* chore: remove a test that doesn't make much sense

* chore: solid tests

* chore: stabilize test

* rewrite test

* test(react-query): remove not needed doNotExecute from test, test-d.tsx files are not executed anyway

* docs(react-query): add example of skipToken into react-query disabling-queries docs

* docs: update disabling queries examples in Angular, React, and Vue guides

* docs: add description of skipToken to typescript.md

* test(react-query): add unique queryKey to should respect skipToken test

* test(react-query): use helper function instead of string in should respect skipToken test

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-03-05 15:55:01 +01:00
Oluwaseun Raphael Afolayan
5e7b273761
docs: Update React Native Example code to Match React Native syntax. (#7028)
The React Native example previously used `<div> </div>` tags and as we all know, divs are a react thing.

This PR fixes that by using the intended (I believe) `<Text> </Text>` tags
2024-03-05 08:22:27 +01:00
austin johnson
eec3786020
docs: 📲React Query Dev Tools for React Native readme update⚡ (#6943)
* Update devtools.md

Add note about new dev tools created in react native

* Update devtools.md

* Update docs/framework/react/devtools.md

* chore: prettier

---------

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