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

5,194 commits

Author SHA1 Message Date
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
Aryan Deora
d5722798b4
feat(query-devtools): Persist picture-in-picture mode through reloads (#6942)
This feature allows the picture-in-picture mode of the devtools to persists through page reloads.

The popup will remain open and will be re-used between page refreshes.
2024-02-19 14:24:27 -05:00
Tanner Linsley
63dcb08038 release: v5.23.0 v5.23.0 2024-02-19 14:11:34 +00:00
Aryan Deora
f419daf365
feat(query-devtools): Add picture-in-picture mode (#6931)
* feat(query-devtools): Adds picture-in-picture mode

This allows the devtools to be detached from the main page and open inside a popup. The components are mounted through a portal onto the new window and all interactions work as expected


---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-02-19 09:06:05 -05:00
Tanner Linsley
5ab1d25c15 release: v5.22.2 v5.22.2 2024-02-19 12:54:20 +00:00
Dominik Dorfmeister
35fa47dd58
fix(query-core): notify queryCache after updateQuery() (#6936)
so that it's never undefined
2024-02-19 13:45:29 +01:00
Seunghyun Min
26d8980c1f
docs(react-query): fix typo whan -> when (#6929) 2024-02-19 08:01:42 +01:00
Tanner Linsley
ae0b995a04 release: v5.22.1 v5.22.1 2024-02-19 01:33:38 +00:00
Arnoud
7bd671fb1a
fix(angular-query): support required input signal (#6928) 2024-02-19 02:30:16 +01:00
Arnoud
75b9c57362
fix(angular-query): Fix StackBlitz examples by downgrading piscina (#6926) 2024-02-18 18:32:40 +01:00
Tanner Linsley
99bfbc5da6 release: v5.22.0 v5.22.0 2024-02-18 13:48:39 +00:00
Arnoud
ef1f7c1e37
feat(angular-query): injectMutationState (#6925)
* feat(angular-query): inject mutation state

* add type tests
2024-02-18 14:43:53 +01:00
Tanner Linsley
2ccc89ce99 release: v5.21.7 v5.21.7 2024-02-18 08:54:14 +00:00
SebKranz
14aa69f3a1
refactor(core): use queryCache.get instead of find({ queryKey }) for better perf (#6918)
Methods that access a query by its `queryKey` can bypass `find` to avoid performance issues in large caches.

Co-authored-by: Sebastian Kranz <sebastian.kranz@nubix.de>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-02-18 09:48:21 +01:00
Tanner Linsley
054eed5c63 release: v5.21.6 v5.21.6 2024-02-18 08:31:25 +00:00
Max Greenwald
a1d12ab610
fix(react-query-next-experimental): fix unnecessary suspensions (#6753)
* Update HydrationStreamProvider + advanced SSR docs

* Implement PR feedback

* refactor: no need for refs if we don't have effects

cleanup ts-expect-error by re-using `win`, which is already `any`

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-02-18 09:27:41 +01:00
Dominik Dorfmeister
ee4fa28840
docs: remove outdated section
closes #6824
2024-02-18 09:24:55 +01:00
Tanner Linsley
43b41c53bb release: v5.21.5 v5.21.5 2024-02-18 01:32:44 +00:00
Aryan Deora
c62fd14f23
fix(query-devtools): Include class name to devtools button component (#6923) 2024-02-17 20:28:36 -05:00
Aryan Deora
928d41a592
patch(query-devtools): Default font-family to Inter (#6922) 2024-02-17 19:50:36 -05:00
Niels Bosman
847a99696e
docs(react-query): fix typo in useMutation data attribute (#6921) 2024-02-17 22:51:58 +01:00