From f9eb664412db701f44ccbd4b3fb329f74043bf62 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Oct 2025 13:40:01 +0000 Subject: [PATCH] ci: Version Packages --- .../fix-query-collection-default-options.md | 29 -------------- .changeset/fix-write-delete-in-handlers.md | 11 ------ examples/react/projects/package.json | 2 +- examples/react/todo/CHANGELOG.md | 7 ++++ examples/react/todo/package.json | 2 +- packages/query-db-collection/CHANGELOG.md | 38 +++++++++++++++++++ packages/query-db-collection/package.json | 2 +- pnpm-lock.yaml | 2 +- 8 files changed, 49 insertions(+), 44 deletions(-) delete mode 100644 .changeset/fix-query-collection-default-options.md delete mode 100644 .changeset/fix-write-delete-in-handlers.md diff --git a/.changeset/fix-query-collection-default-options.md b/.changeset/fix-query-collection-default-options.md deleted file mode 100644 index 70edd58f2..000000000 --- a/.changeset/fix-query-collection-default-options.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -"@tanstack/query-db-collection": patch ---- - -Fix queryCollectionOptions to respect QueryClient defaultOptions when not overridden - -Previously, when creating a QueryClient with defaultOptions (e.g., staleTime, retry, refetchOnWindowFocus), these options were ignored by queryCollectionOptions unless explicitly specified again in the collection config. This required duplicating configuration and prevented users from setting global defaults. - -Now, queryCollectionOptions properly respects the QueryClient's defaultOptions as fallbacks. Options explicitly provided in queryCollectionOptions will still override the defaults. - -Example - this now works as expected: - -```typescript -const dbQueryClient = new QueryClient({ - defaultOptions: { - queries: { - refetchOnWindowFocus: false, - staleTime: Infinity, - }, - }, -}) - -queryCollectionOptions({ - id: "wallet-accounts", - queryKey: ["wallet-accounts"], - queryClient: dbQueryClient, - // staleTime: Infinity is now inherited from defaultOptions -}) -``` diff --git a/.changeset/fix-write-delete-in-handlers.md b/.changeset/fix-write-delete-in-handlers.md deleted file mode 100644 index fa4a38980..000000000 --- a/.changeset/fix-write-delete-in-handlers.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"@tanstack/query-db-collection": patch ---- - -Fix writeDelete/writeUpdate validation to check synced store only - -Fixed issue where calling `writeDelete()` or `writeUpdate()` inside mutation handlers (like `onDelete`) would throw errors when optimistic updates were active. These write operations now correctly validate against the synced store only, not the combined view (synced + optimistic). - -This allows patterns like calling `writeDelete()` inside an `onDelete` handler to work correctly, enabling users to write directly to the synced store while the mutation is being persisted to the backend. - -Fixes #706 diff --git a/examples/react/projects/package.json b/examples/react/projects/package.json index efb99ae3a..f3ca8fdbc 100644 --- a/examples/react/projects/package.json +++ b/examples/react/projects/package.json @@ -17,7 +17,7 @@ "dependencies": { "@tailwindcss/vite": "^4.1.14", "@tanstack/query-core": "^5.90.5", - "@tanstack/query-db-collection": "^0.2.33", + "@tanstack/query-db-collection": "^0.2.34", "@tanstack/react-db": "^0.1.34", "@tanstack/react-router": "^1.133.15", "@tanstack/react-router-devtools": "^1.133.15", diff --git a/examples/react/todo/CHANGELOG.md b/examples/react/todo/CHANGELOG.md index 929e0de98..5efeceb1e 100644 --- a/examples/react/todo/CHANGELOG.md +++ b/examples/react/todo/CHANGELOG.md @@ -1,5 +1,12 @@ # examples/react/todo +## 0.1.13 + +### Patch Changes + +- Updated dependencies [[`16dbfe3`](https://github.com/TanStack/db/commit/16dbfe34d5a5c075211453566f3a0453aa0ee76f), [`5950583`](https://github.com/TanStack/db/commit/595058384c88730f325ac23415bdb0643eea89fa)]: + - @tanstack/query-db-collection@0.2.34 + ## 0.1.12 ### Patch Changes diff --git a/examples/react/todo/package.json b/examples/react/todo/package.json index 0b23519b4..475856fd7 100644 --- a/examples/react/todo/package.json +++ b/examples/react/todo/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/db-example-react-todo", "private": true, - "version": "0.1.12", + "version": "0.1.13", "dependencies": { "@tanstack/electric-db-collection": "workspace:^", "@tanstack/query-core": "^5.90.5", diff --git a/packages/query-db-collection/CHANGELOG.md b/packages/query-db-collection/CHANGELOG.md index 1a7a17208..b472a5705 100644 --- a/packages/query-db-collection/CHANGELOG.md +++ b/packages/query-db-collection/CHANGELOG.md @@ -1,5 +1,43 @@ # @tanstack/query-db-collection +## 0.2.34 + +### Patch Changes + +- Fix queryCollectionOptions to respect QueryClient defaultOptions when not overridden ([#707](https://github.com/TanStack/db/pull/707)) + + Previously, when creating a QueryClient with defaultOptions (e.g., staleTime, retry, refetchOnWindowFocus), these options were ignored by queryCollectionOptions unless explicitly specified again in the collection config. This required duplicating configuration and prevented users from setting global defaults. + + Now, queryCollectionOptions properly respects the QueryClient's defaultOptions as fallbacks. Options explicitly provided in queryCollectionOptions will still override the defaults. + + Example - this now works as expected: + + ```typescript + const dbQueryClient = new QueryClient({ + defaultOptions: { + queries: { + refetchOnWindowFocus: false, + staleTime: Infinity, + }, + }, + }) + + queryCollectionOptions({ + id: "wallet-accounts", + queryKey: ["wallet-accounts"], + queryClient: dbQueryClient, + // staleTime: Infinity is now inherited from defaultOptions + }) + ``` + +- Fix writeDelete/writeUpdate validation to check synced store only ([#708](https://github.com/TanStack/db/pull/708)) + + Fixed issue where calling `writeDelete()` or `writeUpdate()` inside mutation handlers (like `onDelete`) would throw errors when optimistic updates were active. These write operations now correctly validate against the synced store only, not the combined view (synced + optimistic). + + This allows patterns like calling `writeDelete()` inside an `onDelete` handler to work correctly, enabling users to write directly to the synced store while the mutation is being persisted to the backend. + + Fixes #706 + ## 0.2.33 ### Patch Changes diff --git a/packages/query-db-collection/package.json b/packages/query-db-collection/package.json index 59ed1efcf..7c681b873 100644 --- a/packages/query-db-collection/package.json +++ b/packages/query-db-collection/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/query-db-collection", "description": "TanStack Query collection for TanStack DB", - "version": "0.2.33", + "version": "0.2.34", "dependencies": { "@standard-schema/spec": "^1.0.0", "@tanstack/db": "workspace:*" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 43841c6f1..eacd703ee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -196,7 +196,7 @@ importers: specifier: ^5.90.5 version: 5.90.5 '@tanstack/query-db-collection': - specifier: ^0.2.33 + specifier: ^0.2.34 version: link:../../../packages/query-db-collection '@tanstack/react-db': specifier: ^0.1.34