* docs(preact-query): wrap bare 'QueryClient' type name in backticks in JSDoc
* docs(preact-query): backtick 'QueryClient' in 'children' prop doc and 'suspense'/'throwOnError' in QueryErrorResetBoundary
* docs(preact-query): document type parameters with '@template' and add 'useQueryClient' throws note
* docs(preact-query): fix TQueryData select direction and TResults/TDepth phrasing flagged by CodeRabbit
* docs(preact-query): document interfaces and type aliases with JSDoc for generated reference docs
* docs(preact-query): fix finite/infinite mix-ups and opaque-array fallback claims flagged by CodeRabbit
* docs(preact-query): document functions and components with JSDoc for generated reference docs
* docs(preact-query): replace concrete API calls with abstract fetcher names in JSDoc examples
* docs(preact-query): rename mutation example fetcher to be CRUD-neutral
* docs(preact-query): rename mutation example fetcher to 'createPosts'
* docs(preact-query): add examples for Suspense, prefetch, and options-builder functions
* docs(preact-query): add optimistic update, dependent query, and SSR hydration examples
* docs(preact-query): add parameterized factory and mutationKey lookup examples to queryOptions/mutationOptions
* docs(preact-query): add infiniteQueryOptions factory example and restore useMutationState's third example
* docs(preact-query): add TkDodo-inspired multi-API reuse, initialData, and per-call mutate callback examples
* docs(preact-query): document useIsRestoring, initialData, mutateAsync, and skipToken-excluded queryFn fields
* docs(preact-query): fill in empty Returns sections for hooks and options builders
* docs(preact-query): systematic sweep of generated pages for missing field descriptions and fix mismatched mutationOptions example
* docs(preact-query): split mutationOptions' mutationKey overload into basic usage and lookup examples
* docs(preact-query): fix overloads whose example didn't match their initialData-required type
* docs(preact-query): fill overloads missing examples and useSuspenseQueries' queryClient param description
* docs(preact-query): remove duplicated overload example and fix examples that failed type-checking
* docs(preact-query): describe every documented parameter and restore reverted overload example
* docs(preact-query): describe children props and low-level context exports
* fix(preact-query): remove inaccurate 'queryFn is optional' claim from infiniteQueryOptions overload
* docs(preact-query): add missing @returns to mutationOptions overloads and provider components
* docs(preact-query): describe QueryErrorResetBoundary children and its render-function parameter
* docs(preact-query): fix prose-accuracy issues found by multi-agent audit
Corrects useQuery's first overload @returns to match its actual return
type, moves the useSuspenseQuery/useSuspenseInfiniteQuery cancellation
caveat out of the @returns block, softens overstated skipToken/queryFn
claims, merges a duplicated useMutationState description, and adds
missing JSDoc to QueryErrorResetBoundary's function-type aliases and
UseMutateFunction/UseMutateAsyncFunction.
* docs(preact-query): soften remaining overstated queryFn requirement in Suspense options
* docs(preact-query): fix inaccurate prose in hydration, queryFn, and useQueries docs
* docs(preact-query): correct hydration freshness gate, placeholderData arity, and deprecated 'fetchInfiniteQuery' reference
* docs(preact-query): remove leftover 'data is never undefined' claim in 'useInfiniteQuery' overload docs
* docs(preact-query): replace deprecated 'prefetchQuery'/'prefetchInfiniteQuery' calls in examples with 'query'/'infiniteQuery'
* docs(preact-query): point 'usePrefetchQuery' JSDoc at 'queryClient.query' to match its actual option type
The `createRawRef` Proxy used by `createQueries` crashed with
`TypeError: 'deleteProperty' on proxy: trap returned falsish for property 'N'`
whenever the reactive query list was shrunk by two or more items in one update.
Two compounding causes:
1. `update()` iterated `keysToRemove` in ascending index order. The trap
decrements `target.length` after every deletion, so the next stale index
was no longer `in target` and the trap returned `false`, which throws in
strict mode (ES modules).
2. The trap returned `false` for missing props instead of treating delete on
a nonexistent prop as a spec-compliant no-op.
Fix: sort `keysToRemove` descending for arrays so each delete acts on the
current tail, and return `true` from `deleteProperty` when the prop is
already absent.
Generated by Ora Studio
Vibe coded by ousamabenyounes
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
fix(svelte-query): track keys added to an empty createRawRef
createQueries stayed permanently inactive when it was initialized with an
empty queries array. Reads of an absent index have no $state.raw field to
subscribe to, and length is a plain array property, so a consumer that
observed the result while it was empty registered no reactive dependency
and never re-ran once queries were added.
Track those reads through a key version that update() bumps whenever the
key set changes.
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
The type narrowing example wraps useQuery() in reactive() without saying
why, so destructuring the result directly and then checking isSuccess
looks like it should work (#9244). Spell out that reactive() is what
flattens the refs into one discriminated union, and show the
data.value !== undefined check as the alternative when reactive() is not
an option.
Pin both shapes with type tests: the non-reactive result exposes
Ref<T> | Ref<undefined>, and narrowing on data.value refines the ref
itself.
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
* fix(broadcast-client): recover from errors thrown while applying an incoming cross-tab message
If applying an incoming cross-tab message (query.setState/queryCache.build,
which notifies observers) throws, the internal `tx()` helper's `transaction`
flag was never reset. This silently disabled all future outgoing broadcasts
from this tab for the rest of the session. Guard with try/finally so a single
failed message can't permanently break cross-tab sync.
* test(broadcast-client): also cover the query.setState throw path
The existing regression test only exercised queryCache.build (a brand-new
remote query hash). Add a case where the incoming message targets an
existing query, so an exception during query.setState is exercised too.
Addresses CodeRabbit review feedback on #11242.
* feat(vue-query): add new methods to vue-query
* docs(vue-query): docs for new impertive methods for Vue
* fix(vue-query): remove getter options from impertive methods
There is no evidence that the () => queryOptions getter type is
properly used by `fetchQuery` et al, as while it accepts a getter in the
types, it doens't resolve the function at runtime (as opposed to
`useQuery`). Removing the type from `query` and `fetchQuery` and
documenting calling getters impertivly as a workaround.
* Update packages/vue-query/src/queryClient.ts
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
* Update packages/vue-query/src/usePrefetchQuery.ts
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
---------
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
* docs(example): dataloader
* use tanstack pacer instead of dataloader
* add staleTime
* switch to useAsyncBatchedCallback
* Revert "switch to useAsyncBatchedCallback"
This reverts commit 4d408daa63.
* fix: use PromiseWithResolvers
* add batching example to docs