0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
Commit graph

590 commits

Author SHA1 Message Date
github-actions[bot]
fe053bf8e9
ci: Version Packages (#11612)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-26 10:13:58 +10:00
Lachlan Collins
f00aad602e
chore(deps): update dev dependencies (#11640)
chore(deps): update many dev dependencies
2026-09-26 07:30:31 +10:00
Wonsuk Choi
2443290fb5
test(*): rename 'console.error' spies to 'consoleErrorMock' (#11646) 2026-09-26 00:45:05 +09:00
Wonsuk Choi
e8dacbee8b
docs({react-query,preact-query,solid-query,svelte-query}/README): point the CI badge at the 'release.yml' workflow on 'main' (#11633)
* 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
2026-09-25 17:14:12 +09:00
Wonsuk Choi
dfc3d9abed
docs(svelte-query/useMutationState): align the JSDoc description with the other adapters (#11624)
* docs(svelte-query/useMutationState): replace 'hook instance' with 'createMutation' call in JSDoc

* docs(svelte-query/useMutationState): align the JSDoc description with the other adapters
2026-09-25 14:27:22 +09:00
Lachlan Collins
57f40eb05b
chore(deps): update non-major dependencies (#11625)
* chore(deps): update non-major dependencies

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-09-25 15:15:46 +10:00
changbaebang
1e90d389e5
docs(svelte-query): add package 'README.md' (#11604)
* 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>
2026-09-25 14:12:34 +09:00
Wonsuk Choi
d03806572a
fix(svelte-query/{createQuery,queryOptions}): correct the overload selected for 'initialData' (#11592)
* 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
2026-09-24 20:01:04 +10:00
Wonsuk Choi
f6036d75f2
test(svelte-query/createMutation): rename per-call 'onSuccess' mocks to 'onSuccessMutate' to align with react-query (#11601) 2026-09-24 14:11:29 +09:00
Wonsuk Choi
7176a1cfa9
docs(svelte-query/{createInfiniteQuery,infiniteQueryOptions}): describe overload selection by whether 'initialData' is known to be defined (#11589)
* docs(svelte-query/{createInfiniteQuery,infiniteQueryOptions}): describe overload selection by whether 'initialData' is known to be defined

* docs(svelte-query): regenerate reference docs
2026-09-23 17:07:05 +09:00
Wonsuk Choi
04c0fa109f
docs(svelte-query): correct 'initialData'/'select' JSDoc inaccuracy (#11577) 2026-09-23 12:21:07 +09:00
github-actions[bot]
8884f1a4d9
ci: Version Packages (#11582)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-22 15:35:37 +02:00
Wonsuk Choi
9b14786c6a
test({react,preact,svelte}-query/queryOptions): remove dead 'QueriesObserver' type tests duplicated by 'query-core' (#11572) 2026-09-22 14:06:16 +09:00
github-actions[bot]
413ba6e30b
ci: Version Packages (#11566)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-21 20:28:35 +10:00
Simon H
1490a4b2ae
fix: support async Svelte (#9810)
* 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>
2026-09-21 20:10:05 +10:00
github-actions[bot]
e0f6c5542f
ci: Version Packages (#11525)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-21 11:29:33 +02:00
Wonsuk Choi
94de9b4e31
docs(svelte-query): call 'useIsMutating' a function instead of a hook (#11559) 2026-09-21 10:16:49 +09:00
Wonsuk Choi
47f27a4824
docs(svelte-query): add summaries to reference pages that render without a description (#11553) 2026-09-21 02:05:42 +09:00
github-actions[bot]
c08f5766dd
ci: Version Packages (#11511)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-16 16:56:55 +02:00
github-actions[bot]
19ccf2794b
ci: Version Packages (#11339)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-16 09:03:53 +02:00
Wonsuk Choi
2da46cd137
chore(*): use eslint description syntax for grandfathered 'no-restricted-syntax' disables (#11508) 2026-09-16 10:43:43 +09:00
Dominik Dorfmeister 🔮
58ad3e2f08
fix: isolate TypeScript test output (#11503) 2026-09-15 20:56:41 +02:00
Ciarán Curley
d63afc715c
Simplifed query methods/internal tests new lint (#11347)
* 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
2026-09-15 20:25:08 +02:00
Wonsuk Choi
2a18d24e8a
test(svelte-query/createQuery): move type assertions from the runtime test to 'test-d' (#11474) 2026-09-13 00:37:10 +09:00
Wonsuk Choi
7452ef68a2
test({vue,svelte}-query): add type tests for inferring the result type from a generic 'queryFn' (#11464)
* 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'
2026-09-10 09:26:52 +09:00
Wonsuk Choi
f7c6be35c8
test(svelte-query/createMutation): group 'mutateAsync' callback tests with the 'mutate' ones (#11454) 2026-09-09 15:25:44 +09:00
Wonsuk Choi
b823eb06f7
test(svelte-query/createMutation): add tests for per-call callbacks when 'createMutation' has no callbacks (#11453) 2026-09-09 14:40:53 +09:00
Wonsuk Choi
df75cb054c
test(svelte-query/createMutation): add tests for 'onSuccess'/'onError'/'onSettled' callbacks and result timing after 'mutateAsync' (#11452)
* 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
2026-09-09 12:45:31 +09:00
Wonsuk Choi
cdbe8cb002
test(svelte-query/createMutation): add tests for parallel 'mutateAsync' calls and concurrent 'mutate' calls (#11450)
* test(svelte-query/createMutation): add tests for parallel 'mutateAsync' calls and concurrent 'mutate' calls

* test(svelte-query/createMutation): assert rendered 'data'/'status' alongside per-call 'onSuccess' mock
2026-09-09 10:54:07 +09:00
Wonsuk Choi
50680b98c4
test({react,preact,solid,svelte}-query,angular-query-experimental): rename 'mutationFn' param to '_variables' in 'MutationFunctionContext' tests (#11448) 2026-09-08 21:22:31 +09:00
Wonsuk Choi
813bf33afa
test(svelte-query/createMutation): add tests for 'MutationFunctionContext' passed to mutationFn and callbacks (#11442) 2026-09-08 19:39:46 +09:00
Wonsuk Choi
e57f8163b1
docs(query-core): add JSDoc across the package and expose it in generated reference docs (#11438)
* docs(query-core): add JSDoc across the package and expose it in generated reference docs

* docs(config.json): add sidebar entries for newly generated query-core reference docs

* docs(query-core): migrate remaining prose from the legacy 'docs/reference' pages into JSDoc

* docs(query-core): remove legacy 'docs/reference' pages superseded by the generated reference

* docs(query-core): regenerate reference docs after merging main

* docs(query-core): document missing default values for MutationOptions, combine, and QueryFilters.type

* fix(query-devtools): drop unnecessary 'query-core' project reference

* docs(query-core): document missing default values and normalize 'Defaults to' spacing

* docs(query-core): fix 'environmentManager' JSDoc example
2026-09-07 18:22:38 +02:00
Wonsuk Choi
1a51bb80bf
docs(*): clarify 'Promise.all' only waits for all mutateAsync calls when they succeed (#11435) 2026-09-07 00:31:27 +09:00
Wonsuk Choi
e12e5bee52
test(svelte-query/createMutation): add tests for optimistic update rollback and success paths using cache-based 'onMutateResult' (#11425) 2026-09-06 23:31:18 +09:00
Wonsuk Choi
f4fbf2e858
test(svelte-query/createQuery): add test for 'initialData' with a failed refetch (#11424) 2026-09-06 23:28:46 +09:00
Wonsuk Choi
f6ae1ccdf7
feat(svelte-query): add 'DefinedInitialDataInfiniteOptions' overload for 'createInfiniteQuery'/'infiniteQueryOptions' (#11356)
* feat(svelte-query): add 'DefinedInitialDataInfiniteOptions' overload for 'createInfiniteQuery'/'infiniteQueryOptions'

* chore(.changeset): use conventional commits pattern for changeset entry

* ci: apply automated fixes

* docs(svelte-query): regenerate reference docs for infinite-query initialData overload and update changeset entry

* docs(svelte-query): regenerate reference docs after merging main's JSDoc examples

* docs(svelte-query): revert unrelated line-number-only doc diffs

* docs(svelte-query): drop generated reference doc changes from this type-only PR

* chore(.changeset): match changeset entry to the PR title/commit subject

* docs(svelte-query): regenerate reference docs for the new infinite-query overloads

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-09-01 21:59:20 +09:00
Wonsuk Choi
dd9216c92a
docs(svelte-query): add JSDoc '@example's across hooks and options factories (#11352)
* docs(svelte-query): add JSDoc '@example's across hooks and options factories

* docs(svelte-query): add missing 'isPending' idiom and 'mutateAsync' examples

* docs(svelte-query): address CodeRabbit review feedback on JSDoc examples

* docs(svelte-query): correct 'pending' status description in createQuery's @returns

* docs(svelte-query): add missing 'initialData' example to infiniteQueryOptions
2026-09-01 21:07:52 +09:00
Ciarán Curley
6f31ef6c8b
test: replace 'prefetchQuery'/'fetchQuery'/'ensureQueryData' with 'query' (#11340)
chore: move internal tests to queryClient.query
2026-08-31 09:00:15 +02:00
github-actions[bot]
2969edf32f
ci: Version Packages (#11316) 2026-08-28 01:03:02 +09:00
github-actions[bot]
2eb3c7c76f
ci: Version Packages (#11313)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-27 17:28:48 +09:00
github-actions[bot]
714df67ab1
ci: Version Packages (#11306)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-26 20:32:28 +02:00
github-actions[bot]
1836e61b8c
ci: Version Packages (#11303)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-26 10:56:25 +02:00
github-actions[bot]
51f12db919
ci: Version Packages (#11294)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-25 23:24:07 +02:00
github-actions[bot]
730b3aa06c
ci: Version Packages (#11276) 2026-08-25 04:21:47 +09:00
github-actions[bot]
96f2da6353
ci: Version Packages (#11271)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-24 15:20:40 +02:00
Ben Younes
cafd540c02
fix(svelte-query): handle shrinking createRawRef array by multiple entries (#10341) (#10892)
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>
2026-08-24 15:12:37 +02:00
renechoi
320ed25cac
fix(svelte-query): activate createQueries initialized with an empty array (#11127)
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>
2026-08-24 15:03:01 +02:00
alex-js-ltd
250050d863
fix(svelte-query): shrink useMutationState results (#11153)
* test(svelte-query/useMutationState): add coverage for shrinking filtered results

* fix(svelte-query): shrink useMutationState results

* chore: add changeset for useMutationState fix

---------

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-08-24 14:41:56 +02:00
github-actions[bot]
388bbaf181
ci: Version Packages (#11265)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-23 19:57:36 +02:00
github-actions[bot]
bc423b37ef
ci: Version Packages (#11261)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-23 12:57:01 +02:00