* fix(core): make sure to call setResult before the early bail-out
The initial fix for #6369 (#6431) introduced a regression where we'd always call combine with an empty array initially.
Turns out it was actually on purpose that we didn't call combine in the constructor, but delayed that until the `setQueries` call - because there, we already have complete query result structures available
However, there is an optimization that bails out early without calling this.#setResult if "nothing changed"; however, if we call useQueries with an empty array, that means nothing every changes, and the #combinedResult is actually never set, leading to structural sharing never having anything to share with, thus yielding a new reference every time (this is the root issue for #6369).
This fix reverts those changes (to avoid calling combine with an empty array every time, thus fixing #6612) and makes sure #setResult is always invoked before bailing out, so that #combinedResult is set correctly even for this case
* fix: add a special length check to the bail-out case
we only want to stop bailing out if we have no queries; moving the #setResult call unconditionally before the bail-out leads to more re-renders for other useQueries calls
now, we only stop the bail-out when the special empty case sets in, which is what fixes#6612
* fix(react): don't set options before suspending
setting options right before suspending is a side effect, and it has repercussions if used in transitions where the component stays mounted
to fix#6392 in a different way, we can't rely on `observer.getCurrentQuery()` when reading for error boundaries / suspense, because it can lag behind; instead, we can just read from the queryCache directly to get the latest values
* chore: fix prettier
* chore: test for 6486
* Update types and eslint
* Update more patch/minor deps
* Bump node and pnpm
* Undo next and node changes
* More updates
* Seems to work now
* Lock TS 5.2.2
* Bump ky
* Final bumps
* Remove duplicated type
* Update react-native example
* Remove @callstack/eslint-config
* fix(mutationCache): export MutationCacheNotifyEvent type
Export MutationCacheNotifyEvent type to make it consistent with QueryCacheNotifyEvent (which is exported) and make it easier to write listener functions.
* fix(mutationCache): export MutationCacheNotifyEvent type
---------
Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com>
* fix(query-core): fix context type error in `onSuccess`
* docs(query-core): update `useMutation` documentations
* fix(query-core): the `context` should not be inferred as `undefined` when `TContext` is defined
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
this allows key-ing of mutations without having to re-mount components using mutations; the mutationKey basically defines the identity of the mutation - it doesn't make much sense to keep data of a different mutationKey around at observer level if the key changes