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

5,014 commits

Author SHA1 Message Date
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
Jonghyeon Ko
c2946fc78b
ci(*): add actions/labeler to label automatically to recognize scope of Pull Request easily (#6917)
* ci(*): add actions/labeler to label automatically to recognize scope of Pull Request

* chore: update

* ci(.github/labeler): update label names for each packages and documentation

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-03-04 16:02:46 +01:00
Tanner Linsley
bc82909cd6 release: v5.24.8 v5.24.8 2024-03-04 08:53:41 +00:00
Dominik Dorfmeister
bdd2b552d3
fix(query-core): do not call resumePausedMutations while we are offline (#7019)
when mutations are resumed after they have been restored from an external storage, there is no retryer that can pick up the mutation where it left off, so we need to re-execute it from scratch. However, this doesn't really happen if we are offline - the promise will be pending until we go online again; only "continue" from the retryer can immediately resolve a Promise here - execute needs to wait until it's really finished. But since mutations run in serial when resumed, this will lead to a forever hanging promise.

With this fix, `queryClient.resumePausedMutations` will only resume them if we are currently online to avoid this state.
2024-03-04 09:50:42 +01:00
Lachlan Collins
aa9a789d36
docs: Fix formatting, run CI on docs changes (#7018) 2024-03-04 19:25:02 +11:00
LeeJaeSang
663afdc6ca
docs: fix-useQueries-syntax-error (#7017) 2024-03-04 07:43:41 +01:00
Tanner Linsley
962cf852ec release: v5.24.7 v5.24.7 2024-03-03 21:26:06 +00:00
Dominik Dorfmeister
5e64873752
fix(query-core): make sure accessing one property on a query result in useQueries tracks properties across all observers (#7014)
* fix(query-core): make sure accessing one property on a query result in useQueries tracks properties across all observers

In useQueries, property tracking is still performed on each individual observer. However, not all invocations will access the property on all observers. For example:

```
results.some((result) => result.isLoading)
```

will only track the `isLoading` property of the first query in the array if `isLoading` is true, because the loop will eagerly abort, and thus the property isn't accessed at all on other observer, which can lead to missing re-renders.

This fix adds a callback to `trackProperties`, which will be invoked when we start to track a property on an observer. Then, in useQueries, we can use this callback to trigger the accessor manually for all other observers.

That makes sure that if a property like `isLoading` is accessed on one observer, it is tracked for all of them.

* refactor: expose trackProp function
2024-03-03 22:23:10 +01:00
Jonghyeon Ko
b311a0a204
test(solid-query): use vitest typecheck correctly with *.test-d.ts (#6986) 2024-03-03 10:43:37 +01:00
Mahmud Zaman Bali
add26cef1b
docs(react-query): fix typo supsends -> suspends (#6998) 2024-03-03 10:43:06 +01:00
HyunJick Lee
ec90029388
docs: modify typo (#7011)
* docs: modify typo

* docs: modify typo
2024-03-03 10:42:51 +01:00
Tanner Linsley
1352663f47 release: v5.24.6 v5.24.6 2024-03-02 20:32:11 +00:00
Dominik Dorfmeister
3191ae88be
fix(core): do not rely on dataUpdatedAt truthiness (#7008)
* fix(core): do not rely on dataUpdatedAt truthiness

if we want to check for "hasData", we should rather look at state.data and check it against undefined, because it's not possible to have a successful query with data being undefined (since v4)

* chore: fix test that relied on dataUpdatedAt to be set to zero for a query to show up as non-stale
2024-03-02 21:29:07 +01:00
Tanner Linsley
48b5ab1ba9 release: v5.24.5 v5.24.5 2024-03-02 20:19:11 +00:00
Dominik Dorfmeister
93d442cdbc
fix(types): make getQueryState types work with queryOptions (#7010) 2024-03-02 21:14:09 +01:00
Tanner Linsley
0f10b2623b release: v5.24.4 v5.24.4 2024-03-02 20:00:55 +00:00
Aryan Deora
f1676dcaa2
fix(solid-query): Prevent infinite refetch with Astro when initialData is provided (#7009) 2024-03-02 14:57:23 -05:00
Tanner Linsley
62e8eb24b8 release: v5.24.3 v5.24.3 2024-03-02 17:16:30 +00:00
Aryan Deora
a680dba61e
fix(solid-query): Defer observer unsubscription untill resource resolves (#6982) 2024-03-02 12:07:49 -05:00
Tanner Linsley
bcfe218cb2 release: v5.24.2 v5.24.2 2024-03-02 13:11:46 +00:00
Dominik Dorfmeister
11e9650f10
refactor: switch typeof undefined checks with strict comparison of the value undefined (#7006)
* refactor: switch typeof undefined checks with strict comparison of the value undefined

* refactor: simplify check
2024-03-02 14:08:16 +01:00
Aryan Deora
c69a18a232
fix(solid-query): Persist client implementation (#6993)
Co-authored-by: Brendonovich  <brendonovich@outlook.com>
2024-02-28 16:28:57 -05:00
Sol Lee
b7b5096ee5
refactor(*): Import noop function from utils (#6964)
* refactor(*): Import noop function from utils

* Revert "refactor(*): Import noop function from utils"

This reverts commit c76f36fe94.

* refactor(*): Add noop function in each package

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-02-28 12:56:49 +01:00
Jonghyeon Ko
18c2caedda
test(react-query): use vitest typecheck correctly with *.test-d.ts (#6978) 2024-02-28 08:20:33 +01:00
Jonghyeon Ko
6b9673692b
ci(react-query): resolve test:lib error (#6979)
* ci(react-query): resolve error

* test(react-query): update useMutation.test.tsx

* chore: format
2024-02-27 21:47:19 +01:00
Jonghyeon Ko
be2bf30718
test(react-query-devtools): add test case for not in process.env.NODE_ENV='development' (#6940)
* test(react-query-devtools): add test case for production mode

* chore: update

* chore: update

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-02-27 13:50:37 +01:00
HJZzzzz
d82c83e590
fix(react-query): remove placeholderData from suspense query (#6973)
Co-authored-by: Huang Jingzhan <huangjz@sea.com>
2024-02-27 11:04:22 +01:00
Dominik Dorfmeister
55782aebbb chore: fix lint 2024-02-26 08:53:01 +01:00
Ekam Ahuja
d83aa272fb
docs: Updated installation commands with bun package manger (#6971) 2024-02-25 10:15:32 +01:00
Arnoud
ef3a0df0b1
chore(angular-query): disable cache in Angular examples (#6970) 2024-02-25 02:34:43 +01:00
Tanner Linsley
97b013a53d release: v5.24.1 v5.24.1 2024-02-25 00:53:25 +00:00
Riccardo Perra
3de4859b3a
fix(angular-query): fix NG0602 error (#6966)
* fix(angular-query): fix NG0602 error

* chore: run prettier on PR

---------

Co-authored-by: Arnoud de Vries <6420061+arnoud-dv@users.noreply.github.com>
2024-02-25 01:48:15 +01:00
SebKranz
747aa78149
test(queryClient): Remove flaky perfomance tests (#6946) 2024-02-24 13:54:00 +01:00
Tanner Linsley
8104a407cc release: v5.24.0 v5.24.0 2024-02-19 19:28:50 +00:00