* 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>
* 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
* 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
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.
* 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>
* 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>
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
* 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>