* docs({react-query,preact-query,solid-query,svelte-query}/README): point the CI badge at the 'release.yml' workflow on 'main'
* docs({react-query,preact-query,solid-query,svelte-query}/README): add alt text to the release badge
* docs(svelte-query/useMutationState): replace 'hook instance' with 'createMutation' call in JSDoc
* docs(svelte-query/useMutationState): align the JSDoc description with the other adapters
* docs(svelte-query): add package README
Every other adapter (react, preact, solid, vue, lit, angular) ships a
README; svelte-query did not, so its npm page is empty. Copied from
solid-query, which uses the ci badge that still resolves.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* docs(svelte-query): fix the CI link encoding and point the downloads badge at this package
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* docs(svelte-query/README): replace 'Primitives' with 'Functions' in the description
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Wonsuk Choi <sukvvon@gmail.com>
* 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
* docs(svelte-query/{createInfiniteQuery,infiniteQueryOptions}): describe overload selection by whether 'initialData' is known to be defined
* docs(svelte-query): regenerate reference docs
* 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>
* chore: update type tests to use new query methods, types
* chore: disallow future calls to deprecated methods
* fix(eslint): detect computed query method calls
- Match bracket notation for deprecated query client methods
* test(vue-query/useQuery): add type test for inferring the result type from a generic 'queryFn'
* test(svelte-query/createQuery): add type test for inferring the result type from a generic 'queryFn'
* test(svelte-query/createMutation): add tests for 'onSuccess'/'onError'/'onSettled' callbacks and result timing after 'mutateAsync'
* test(svelte-query/createMutation): use 'noop' instead of an empty callback for the ignored rejection
* test(svelte-query/createMutation): assert 'mutateAsync' awaits the hook-level callback's returned promise
* test(svelte-query/createMutation): assert 'onSettled' also awaits the hook-level callback's returned promise
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>