* fix(preact-query): retry on mount for falsy errors when throwOnError returns false
`ensurePreventErrorBoundaryRetry` only evaluated a function-valued
`throwOnError` when `query.state.error` was truthy. For a query that
rejected with a falsy value (e.g. `undefined`), the callback was skipped
and the function itself was treated as truthy, so `retryOnMount` was
disabled even though `throwOnError` would have returned `false`.
Check `query.state.status === 'error'` instead so the callback runs for
every failed query. Ports #11328 to preact-query.
* refactor(preact-query): keep throwOnError constant
---------
Co-authored-by: TkDodo <office@dorfmeister.cc>
* fix({preact,solid,svelte,angular-query-experimental}): switch to 'export type *' for type-only re-exports
* chore(.changeset/export-type-star-adapters): trim redundant PR cross-reference from changeset body
* fix(react-query*): declare '@types/react' as a peer dependency like 'react-query-devtools'
* fix(react-query*): mark '@types/react' as an optional peer dependency
* feat(preact-query*): support Preact v11
* fix(preact-query*): pass an initial value to 'useRef' and flush deferred unmount effect cleanups in tests for Preact v11
* chore(preact-query*): develop and test against Preact 11
Bump the preact catalog and the preact example to ^11.0.1, and
preact-render-to-string to ^6.8.0 (Preact 11 peers on >=6.7.0).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Kevin Van Cott <kevinvandy656@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
`UseMutationReturnType` uses `MutationResult` as the default for its
`TResult` parameter, but the alias was not exported. Projects that emit
declarations could not name the inferred return type of a `useMutation`
wrapper and failed with TS2883. Export it from the package root.
Fixes#11769
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Ciarán Curley <ciaran.curley.11.11@gmail.com>
fix(query-core): start queued scoped mutations while the window is not focused
A mutation queued behind another one in the same scope is started later
through retryer.continue(), which only resumes when canContinue() is true.
canContinue() requires the window to be focused, so with an unfocused tab
the next mutation stayed paused until the window got focus again.
Resume the initial start pause with canStart() instead, which is the same
check used to start the retryer right away. Retry pauses still use
canContinue().
Fixes#11642
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
* fix(svelte-query/{createQuery,queryOptions}): correct the overload selected for 'initialData'
* test(svelte-query/queryOptions): use a non-literal condition instead of a wrapper function in the optional 'initialData' object test
* fix(svelte-query-devtools): update the devtools instance when options change after mount
* test(svelte-query-devtools/Devtools): add missing 'setTheme' mock and coverage
---------
Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
* fix: support async Svelte
Svelte 5 now supports async await in components. One behavior there is that when a component is created as part of a boundary that has pending async work, its `$effect`s will not run until that async work is done.
The way the code is written right now means you can end up in an infinite pending state: If you do `await someQuery.promise`, the `$effect` for the subscription will never run, and therefore the `await` will never resolve. This PR fixes it.
* lint
* fix
---------
Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
* fix(broadcast-client): don't overwrite an existing query's data on an incoming 'added' message
* test(query-broadcast-client-experimental): drop test that duplicates existing 'added' build coverage