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

293 commits

Author SHA1 Message Date
fuko
8fa82653dd
docs: fix broken internal links in the query docs (#7247)
* wip - 1

* Fix more links

* Fix one more link

* Another one

* Update a link

* Fix the broken links in the Angular docs

* Fix the broken links in the Vue docs

* Fix the Svelte links in the docs

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-04-22 10:38:13 +02:00
Dominik Dorfmeister
24f1d45cbd
feat: scoped mutations (#7312)
* refactor: add scope to mutationCache internally

* refactor: remove unused defaultOptions on mutation

this private field is a leftover from v4

* feat: make sure to not run mutations if there is already one running in the scope of this mutation

* feat: make sure mutations in the same scope can run in serial

* fix: find a _lot_ better way to determine if a mutation can run

* test: widen test scenario to include scopes

* fix: there is a difference between starting and continuing

when starting, we need to check the networkMode differently than when continuing, because of how offlineFirst works (can start, but can't continue)

* refactor: switch to a scope object with `id`

* feat: dehydrate and hydrate mutation scope

* fix: initiate the mutationCache with a random number

since we use the mutationId to create the default scope, and the mutationId is merely incremented, we risk colliding scopes when hydrating mutations into an existing cache. That's because the mutationId itself is never dehydrated. When a mutation gets hydrated, it gets re-built, thus getting a new id. At this point, its id and the scope can differ. That per se isn't a problem. But if a mutation was dehydrated with scope:1, it would put into the same scope with another mutation from the new cache that might also have the scope:1.

To avoid that, we can initialize the mutationId with Date.now(). It will make sure (or at least very likely) that there is no collision

In the future, we should just be able to use `Crypto.randomUUID()` to generate a unique scope, but our promised compatibility doesn't allow for using this function

* test: hydration

* test: those tests actually fail because resumePausedMutations is still wrongly implemented

* fix: simplify and fix resumePausedMutations

we can fire off all mutations at the same time - only the first one in each scope will actually fire, the others have to stay paused until their time has come. mutation.continue handles this internally.

but, we get back all the retryer promises, so resumePausedMutations will wait until the whole chain is done

* test: more tests

* refactor: scopeFor doesn't use anything of the mutationCache class

* docs: scoped mutations
2024-04-22 08:39:11 +02:00
Naveen Yadav
727eb557ed
docs: Update spelling in devtools.md (#7269) 2024-04-15 10:59:05 +02:00
Anthony Gonzales
a9fa5f4e9b
docs: Remove references to React.FC (#7259)
React.FC was removed from the create-react-app template in
facebook/create-react-app#8177 and is no longer recommended.
2024-04-11 11:16:39 +02:00
Christopher Ehrlich
fca5e7df77
docs: correct useQuery status type (#7252) 2024-04-09 18:07:17 +02:00
Nick S. Khan
565a241bb6
docs: Fix typos in render-optimizations.md (#7246) 2024-04-08 22:02:20 +02:00
Chris J. Lee
26e1a95a4a
docs: Update render-optimizations.md - (#7235)
Typo
2024-04-06 08:16:17 +02:00
Dominik Dorfmeister
e707c13ce3
docs: render optimizations (#7234)
* docs: render optimizations

* docs: further reading
2024-04-05 20:06:06 +02:00
Dominik Dorfmeister
3c31124ddb
feat(core): memoize result of combine (#7233)
* feat(core): memoize result of combine

this PR makes sure to only re-run the combine function if the function itself changed referentially or any of the inputs changed

* docs: combine memoization

* Update docs/framework/react/reference/useQueries.md
2024-04-05 19:56:40 +02:00
Tanner Linsley
0b9f971e41 docs: fix quickstart 2024-04-02 23:21:55 -06:00
Tanner Linsley
754640a3e5
docs: migrate docs to use path-based navigation instead of route-based (#7211)
TanStack Router uses path-based navigation instead of route-based navigation, so many of the relative documentation links will be invalid after migration. This fixes that.
2024-04-02 16:46:31 -06:00
Gioele Vuaran
0123c8094d
docs: gcTime max value (#7190) 2024-04-02 17:15:08 +02:00
Mohamed Yamani
c4729dfee4
docs: corrected contraction to possession (#7170) 2024-03-24 14:04:42 +01:00
Dominik Dorfmeister
2ddf803636 chore: fix prettier 2024-03-21 16:45:16 +01:00
Todor Andonov
e0ead7fffb
docs: add a note for mutations in the dev tools (#7136) 2024-03-21 16:40:22 +01:00
Minkyu Kim
2b337a75f6
docs: Update docs/framework/guides (#7140)
* docs: Update missing declaration keyword

* docs: Update missing declaration keyword

* docs: partial restoration
2024-03-21 16:18:12 +01:00
Damian Osipiuk
392d352926
fix(vue-query): respect throwOnError in suspense (#7143)
* fix(vue-query): respect `throwOnError` in `suspense`

* docs: fix formatting
2024-03-21 00:25:56 +01:00
jjangga0214
8d5ce72245
docs(guides/disabling-queries): typo (#7132)
* fix(guides/disabling-queries): typo

* fix(guides/disabling-queries): another typo
2024-03-18 09:27:19 +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
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
Dominik Dorfmeister
661ddd3bfd
docs: fix link in typescript.md 2024-03-09 16:06:46 +01: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
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
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
Ekam Ahuja
d83aa272fb
docs: Updated installation commands with bun package manger (#6971) 2024-02-25 10:15:32 +01:00
Seunghyun Min
26d8980c1f
docs(react-query): fix typo whan -> when (#6929) 2024-02-19 08:01:42 +01: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
Niels Bosman
847a99696e
docs(react-query): fix typo in useMutation data attribute (#6921) 2024-02-17 22:51:58 +01:00
Don Denton
ac0d05c1d8
feat(query-devtools): Add btn position relative support (#6576)
In addition to adding support for relative positioning of the button,
I've added in opacity changes for all in/out animations.
2024-02-16 14:23:41 -05:00
austin johnson
b842e72b7a
docs: Update devtools.md (#6893)
Add note about external React Query dev tools that will work for React Native
2024-02-13 16:41:47 +01:00
Dominik Dorfmeister
aad40787e4
fix(types): type structural sharing as unknown (#6888) 2024-02-13 13:46:31 +01:00
Lachlan Collins
e1059300e9
chore: Replace @ts-ignore with @ts-expect-error (#6866) 2024-02-10 18:51:05 +11:00
Arnoud
c2dc9bb05a
feat(angular-query): injectInfiniteQuery (#6808) 2024-02-04 22:42:16 +01:00
Jeong-Sik Yun
58b3de8680
doc: Change the onMutate optional description to capitalize. (#6773) 2024-01-27 14:05:42 +01:00
Lachlan Collins
c22ca89cf3
docs: Move eslint docs to core (#6779) 2024-01-27 07:53:47 +11:00
Lachlan Collins
5a5b61b19b
docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
Lachlan Collins
86b8a1df6b
docs: Fix broken links, share reference docs (#6777) 2024-01-26 19:30:21 +11:00
Lachlan Collins
0cdbd5a198
docs: Re-organise for new docs layout (#6763)
* docs: Re-organise for v2 docs layout

* Add $schema
2024-01-26 07:57:22 +11:00