diff --git a/.changeset/fix-filter-expression-compile.md b/.changeset/fix-filter-expression-compile.md deleted file mode 100644 index 8d637937e..000000000 --- a/.changeset/fix-filter-expression-compile.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@tanstack/db": patch ---- - -fix(db): compile filter expression once in createFilterFunctionFromExpression - -Fixed a performance issue in `createFilterFunctionFromExpression` where the expression was being recompiled on every filter call. This only affected realtime change event filtering for pushed-down predicates at the collection level when using orderBy + limit. The core query engine was not affected as it already compiled predicates once. diff --git a/.changeset/fix-isready-disabled-queries.md b/.changeset/fix-isready-disabled-queries.md deleted file mode 100644 index 132902238..000000000 --- a/.changeset/fix-isready-disabled-queries.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -"@tanstack/react-db": patch -"@tanstack/solid-db": patch -"@tanstack/vue-db": patch -"@tanstack/svelte-db": patch -"@tanstack/angular-db": patch ---- - -Fixed `isReady` to return `true` for disabled queries in `useLiveQuery`/`injectLiveQuery` across all framework packages. When a query function returns `null` or `undefined` (disabling the query), there's no async operation to wait for, so the hook should be considered "ready" immediately. - -Additionally, all frameworks now have proper TypeScript overloads that explicitly support returning `undefined | null` from query functions, making the disabled query pattern type-safe. - -This fixes the common pattern where users conditionally enable queries and don't want to show loading states when the query is disabled. diff --git a/.changeset/fix-object-field-update-rollback.md b/.changeset/fix-object-field-update-rollback.md deleted file mode 100644 index ef2f3eb5c..000000000 --- a/.changeset/fix-object-field-update-rollback.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@tanstack/query-db-collection": patch -"@tanstack/db": patch ---- - -fix(query-db-collection): use deep equality for object field comparison in query observer - -Fixed an issue where updating object fields (non-primitives) with `refetch: false` in `onUpdate` handlers would cause the value to rollback to the previous state every other update. The query observer was using shallow equality (`===`) to compare items, which compares object properties by reference rather than by value. This caused the observer to incorrectly detect differences and write stale data back to syncedData. Now uses `deepEquals` for proper value comparison. diff --git a/.changeset/fix-tanstack-db-peerdeps.md b/.changeset/fix-tanstack-db-peerdeps.md deleted file mode 100644 index 26b0248bb..000000000 --- a/.changeset/fix-tanstack-db-peerdeps.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@tanstack/query-db-collection": patch -"@tanstack/offline-transactions": patch ---- - -Use regular dependency for @tanstack/db instead of peerDependency to match the standard pattern used by other TanStack DB packages and prevent duplicate installations diff --git a/examples/react/offline-transactions/package.json b/examples/react/offline-transactions/package.json index 81c85c2ef..8d4cbfd08 100644 --- a/examples/react/offline-transactions/package.json +++ b/examples/react/offline-transactions/package.json @@ -9,9 +9,9 @@ "start": "node .output/server/index.mjs" }, "dependencies": { - "@tanstack/offline-transactions": ">=1.0.0", - "@tanstack/query-db-collection": ">=1.0.5", - "@tanstack/react-db": ">=0.1.54", + "@tanstack/offline-transactions": ">=1.0.1", + "@tanstack/query-db-collection": ">=1.0.6", + "@tanstack/react-db": ">=0.1.55", "@tanstack/react-query": "^5.90.11", "@tanstack/react-router": "^1.139.12", "@tanstack/react-router-devtools": "^1.139.12", diff --git a/examples/react/projects/package.json b/examples/react/projects/package.json index 8fb7374a4..e395d8a9f 100644 --- a/examples/react/projects/package.json +++ b/examples/react/projects/package.json @@ -17,8 +17,8 @@ "dependencies": { "@tailwindcss/vite": "^4.1.17", "@tanstack/query-core": "^5.90.11", - "@tanstack/query-db-collection": ">=1.0.5", - "@tanstack/react-db": ">=0.1.54", + "@tanstack/query-db-collection": ">=1.0.6", + "@tanstack/react-db": ">=0.1.55", "@tanstack/react-router": "^1.139.12", "@tanstack/react-router-devtools": "^1.139.12", "@tanstack/react-router-with-query": "^1.130.17", diff --git a/packages/angular-db/CHANGELOG.md b/packages/angular-db/CHANGELOG.md index 34feccfeb..12bf38dec 100644 --- a/packages/angular-db/CHANGELOG.md +++ b/packages/angular-db/CHANGELOG.md @@ -1,5 +1,18 @@ # @tanstack/angular-db +## 0.1.37 + +### Patch Changes + +- Fixed `isReady` to return `true` for disabled queries in `useLiveQuery`/`injectLiveQuery` across all framework packages. When a query function returns `null` or `undefined` (disabling the query), there's no async operation to wait for, so the hook should be considered "ready" immediately. ([#886](https://github.com/TanStack/db/pull/886)) + + Additionally, all frameworks now have proper TypeScript overloads that explicitly support returning `undefined | null` from query functions, making the disabled query pattern type-safe. + + This fixes the common pattern where users conditionally enable queries and don't want to show loading states when the query is disabled. + +- Updated dependencies [[`c4b9399`](https://github.com/TanStack/db/commit/c4b93997432743d974749683059bf68a082d3e5b), [`a1a484e`](https://github.com/TanStack/db/commit/a1a484ec4d2331d702ab9c4b7e5b02622c76b3dd)]: + - @tanstack/db@0.5.11 + ## 0.1.36 ### Patch Changes diff --git a/packages/angular-db/package.json b/packages/angular-db/package.json index d5e7f24dd..671de4367 100644 --- a/packages/angular-db/package.json +++ b/packages/angular-db/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/angular-db", "description": "Angular integration for @tanstack/db", - "version": "0.1.36", + "version": "0.1.37", "author": "Ethan McDaniel", "license": "MIT", "repository": { diff --git a/packages/db-collection-e2e/CHANGELOG.md b/packages/db-collection-e2e/CHANGELOG.md index 00ff7f4a7..d30a8bf19 100644 --- a/packages/db-collection-e2e/CHANGELOG.md +++ b/packages/db-collection-e2e/CHANGELOG.md @@ -1,5 +1,14 @@ # @tanstack/db-collection-e2e +## 0.0.14 + +### Patch Changes + +- Updated dependencies [[`c4b9399`](https://github.com/TanStack/db/commit/c4b93997432743d974749683059bf68a082d3e5b), [`a1a484e`](https://github.com/TanStack/db/commit/a1a484ec4d2331d702ab9c4b7e5b02622c76b3dd), [`f458e05`](https://github.com/TanStack/db/commit/f458e05bb6f5b577ba1d1032a48b46cf860f3c9d)]: + - @tanstack/db@0.5.11 + - @tanstack/query-db-collection@1.0.6 + - @tanstack/electric-db-collection@0.2.12 + ## 0.0.13 ### Patch Changes diff --git a/packages/db-collection-e2e/package.json b/packages/db-collection-e2e/package.json index 7137b5910..a658c1cfe 100644 --- a/packages/db-collection-e2e/package.json +++ b/packages/db-collection-e2e/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/db-collection-e2e", - "version": "0.0.13", + "version": "0.0.14", "private": true, "description": "End-to-end test suite for TanStack DB collections", "type": "module", diff --git a/packages/db/CHANGELOG.md b/packages/db/CHANGELOG.md index 437efe2b7..111e5c57d 100644 --- a/packages/db/CHANGELOG.md +++ b/packages/db/CHANGELOG.md @@ -1,5 +1,17 @@ # @tanstack/db +## 0.5.11 + +### Patch Changes + +- fix(db): compile filter expression once in createFilterFunctionFromExpression ([#954](https://github.com/TanStack/db/pull/954)) + + Fixed a performance issue in `createFilterFunctionFromExpression` where the expression was being recompiled on every filter call. This only affected realtime change event filtering for pushed-down predicates at the collection level when using orderBy + limit. The core query engine was not affected as it already compiled predicates once. + +- fix(query-db-collection): use deep equality for object field comparison in query observer ([#967](https://github.com/TanStack/db/pull/967)) + + Fixed an issue where updating object fields (non-primitives) with `refetch: false` in `onUpdate` handlers would cause the value to rollback to the previous state every other update. The query observer was using shallow equality (`===`) to compare items, which compares object properties by reference rather than by value. This caused the observer to incorrectly detect differences and write stale data back to syncedData. Now uses `deepEquals` for proper value comparison. + ## 0.5.10 ### Patch Changes diff --git a/packages/db/package.json b/packages/db/package.json index a9cf4d7fb..b8d569f65 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/db", "description": "A reactive client store for building super fast apps on sync", - "version": "0.5.10", + "version": "0.5.11", "dependencies": { "@standard-schema/spec": "^1.0.0", "@tanstack/db-ivm": "workspace:*", diff --git a/packages/electric-db-collection/CHANGELOG.md b/packages/electric-db-collection/CHANGELOG.md index 3dbbb8924..63bea6055 100644 --- a/packages/electric-db-collection/CHANGELOG.md +++ b/packages/electric-db-collection/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/electric-db-collection +## 0.2.12 + +### Patch Changes + +- Updated dependencies [[`c4b9399`](https://github.com/TanStack/db/commit/c4b93997432743d974749683059bf68a082d3e5b), [`a1a484e`](https://github.com/TanStack/db/commit/a1a484ec4d2331d702ab9c4b7e5b02622c76b3dd)]: + - @tanstack/db@0.5.11 + ## 0.2.11 ### Patch Changes diff --git a/packages/electric-db-collection/package.json b/packages/electric-db-collection/package.json index 7a4b7af9c..d07debd17 100644 --- a/packages/electric-db-collection/package.json +++ b/packages/electric-db-collection/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/electric-db-collection", "description": "ElectricSQL collection for TanStack DB", - "version": "0.2.11", + "version": "0.2.12", "dependencies": { "@electric-sql/client": "^1.2.0", "@standard-schema/spec": "^1.0.0", diff --git a/packages/offline-transactions/CHANGELOG.md b/packages/offline-transactions/CHANGELOG.md index 0c12f3ce2..dacc07563 100644 --- a/packages/offline-transactions/CHANGELOG.md +++ b/packages/offline-transactions/CHANGELOG.md @@ -1,5 +1,14 @@ # @tanstack/offline-transactions +## 1.0.1 + +### Patch Changes + +- Use regular dependency for @tanstack/db instead of peerDependency to match the standard pattern used by other TanStack DB packages and prevent duplicate installations ([#952](https://github.com/TanStack/db/pull/952)) + +- Updated dependencies [[`c4b9399`](https://github.com/TanStack/db/commit/c4b93997432743d974749683059bf68a082d3e5b), [`a1a484e`](https://github.com/TanStack/db/commit/a1a484ec4d2331d702ab9c4b7e5b02622c76b3dd)]: + - @tanstack/db@0.5.11 + ## 1.0.0 ### Patch Changes diff --git a/packages/offline-transactions/package.json b/packages/offline-transactions/package.json index 23b3619a4..c5701d406 100644 --- a/packages/offline-transactions/package.json +++ b/packages/offline-transactions/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/offline-transactions", - "version": "1.0.0", + "version": "1.0.1", "description": "Offline-first transaction capabilities for TanStack DB", "author": "TanStack", "license": "MIT", diff --git a/packages/powersync-db-collection/CHANGELOG.md b/packages/powersync-db-collection/CHANGELOG.md index 64392d49a..ec84ad2bf 100644 --- a/packages/powersync-db-collection/CHANGELOG.md +++ b/packages/powersync-db-collection/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/powersync-db-collection +## 0.1.15 + +### Patch Changes + +- Updated dependencies [[`c4b9399`](https://github.com/TanStack/db/commit/c4b93997432743d974749683059bf68a082d3e5b), [`a1a484e`](https://github.com/TanStack/db/commit/a1a484ec4d2331d702ab9c4b7e5b02622c76b3dd)]: + - @tanstack/db@0.5.11 + ## 0.1.14 ### Patch Changes diff --git a/packages/powersync-db-collection/package.json b/packages/powersync-db-collection/package.json index 3fa99e04e..87444212b 100644 --- a/packages/powersync-db-collection/package.json +++ b/packages/powersync-db-collection/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/powersync-db-collection", "description": "PowerSync collection for TanStack DB", - "version": "0.1.14", + "version": "0.1.15", "dependencies": { "@standard-schema/spec": "^1.0.0", "@tanstack/db": "workspace:*", diff --git a/packages/query-db-collection/CHANGELOG.md b/packages/query-db-collection/CHANGELOG.md index c5f50f8f1..280ea645c 100644 --- a/packages/query-db-collection/CHANGELOG.md +++ b/packages/query-db-collection/CHANGELOG.md @@ -1,5 +1,18 @@ # @tanstack/query-db-collection +## 1.0.6 + +### Patch Changes + +- fix(query-db-collection): use deep equality for object field comparison in query observer ([#967](https://github.com/TanStack/db/pull/967)) + + Fixed an issue where updating object fields (non-primitives) with `refetch: false` in `onUpdate` handlers would cause the value to rollback to the previous state every other update. The query observer was using shallow equality (`===`) to compare items, which compares object properties by reference rather than by value. This caused the observer to incorrectly detect differences and write stale data back to syncedData. Now uses `deepEquals` for proper value comparison. + +- Use regular dependency for @tanstack/db instead of peerDependency to match the standard pattern used by other TanStack DB packages and prevent duplicate installations ([#952](https://github.com/TanStack/db/pull/952)) + +- Updated dependencies [[`c4b9399`](https://github.com/TanStack/db/commit/c4b93997432743d974749683059bf68a082d3e5b), [`a1a484e`](https://github.com/TanStack/db/commit/a1a484ec4d2331d702ab9c4b7e5b02622c76b3dd)]: + - @tanstack/db@0.5.11 + ## 1.0.5 ### Patch Changes diff --git a/packages/query-db-collection/package.json b/packages/query-db-collection/package.json index 43124de0a..aa0bdb7ea 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": "1.0.5", + "version": "1.0.6", "dependencies": { "@standard-schema/spec": "^1.0.0", "@tanstack/db": "workspace:*" diff --git a/packages/react-db/CHANGELOG.md b/packages/react-db/CHANGELOG.md index 9e71ef76d..0ce029709 100644 --- a/packages/react-db/CHANGELOG.md +++ b/packages/react-db/CHANGELOG.md @@ -1,5 +1,18 @@ # @tanstack/react-db +## 0.1.55 + +### Patch Changes + +- Fixed `isReady` to return `true` for disabled queries in `useLiveQuery`/`injectLiveQuery` across all framework packages. When a query function returns `null` or `undefined` (disabling the query), there's no async operation to wait for, so the hook should be considered "ready" immediately. ([#886](https://github.com/TanStack/db/pull/886)) + + Additionally, all frameworks now have proper TypeScript overloads that explicitly support returning `undefined | null` from query functions, making the disabled query pattern type-safe. + + This fixes the common pattern where users conditionally enable queries and don't want to show loading states when the query is disabled. + +- Updated dependencies [[`c4b9399`](https://github.com/TanStack/db/commit/c4b93997432743d974749683059bf68a082d3e5b), [`a1a484e`](https://github.com/TanStack/db/commit/a1a484ec4d2331d702ab9c4b7e5b02622c76b3dd)]: + - @tanstack/db@0.5.11 + ## 0.1.54 ### Patch Changes diff --git a/packages/react-db/package.json b/packages/react-db/package.json index 5bf8272c8..92c37b7f3 100644 --- a/packages/react-db/package.json +++ b/packages/react-db/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/react-db", "description": "React integration for @tanstack/db", - "version": "0.1.54", + "version": "0.1.55", "author": "Kyle Mathews", "license": "MIT", "repository": { diff --git a/packages/rxdb-db-collection/CHANGELOG.md b/packages/rxdb-db-collection/CHANGELOG.md index ec41bb803..7df583aa3 100644 --- a/packages/rxdb-db-collection/CHANGELOG.md +++ b/packages/rxdb-db-collection/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/rxdb-db-collection +## 0.1.43 + +### Patch Changes + +- Updated dependencies [[`c4b9399`](https://github.com/TanStack/db/commit/c4b93997432743d974749683059bf68a082d3e5b), [`a1a484e`](https://github.com/TanStack/db/commit/a1a484ec4d2331d702ab9c4b7e5b02622c76b3dd)]: + - @tanstack/db@0.5.11 + ## 0.1.42 ### Patch Changes diff --git a/packages/rxdb-db-collection/package.json b/packages/rxdb-db-collection/package.json index 56b2504c2..25d6b129e 100644 --- a/packages/rxdb-db-collection/package.json +++ b/packages/rxdb-db-collection/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/rxdb-db-collection", "description": "RxDB collection for TanStack DB", - "version": "0.1.42", + "version": "0.1.43", "dependencies": { "rxdb": "16.21.0", "@standard-schema/spec": "^1.0.0", diff --git a/packages/solid-db/CHANGELOG.md b/packages/solid-db/CHANGELOG.md index ecacfad5f..507ca1942 100644 --- a/packages/solid-db/CHANGELOG.md +++ b/packages/solid-db/CHANGELOG.md @@ -1,5 +1,18 @@ # @tanstack/react-db +## 0.1.54 + +### Patch Changes + +- Fixed `isReady` to return `true` for disabled queries in `useLiveQuery`/`injectLiveQuery` across all framework packages. When a query function returns `null` or `undefined` (disabling the query), there's no async operation to wait for, so the hook should be considered "ready" immediately. ([#886](https://github.com/TanStack/db/pull/886)) + + Additionally, all frameworks now have proper TypeScript overloads that explicitly support returning `undefined | null` from query functions, making the disabled query pattern type-safe. + + This fixes the common pattern where users conditionally enable queries and don't want to show loading states when the query is disabled. + +- Updated dependencies [[`c4b9399`](https://github.com/TanStack/db/commit/c4b93997432743d974749683059bf68a082d3e5b), [`a1a484e`](https://github.com/TanStack/db/commit/a1a484ec4d2331d702ab9c4b7e5b02622c76b3dd)]: + - @tanstack/db@0.5.11 + ## 0.1.53 ### Patch Changes diff --git a/packages/solid-db/package.json b/packages/solid-db/package.json index 84b027be8..c8cb39cee 100644 --- a/packages/solid-db/package.json +++ b/packages/solid-db/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/solid-db", "description": "Solid integration for @tanstack/db", - "version": "0.1.53", + "version": "0.1.54", "author": "Kyle Mathews", "license": "MIT", "repository": { diff --git a/packages/svelte-db/CHANGELOG.md b/packages/svelte-db/CHANGELOG.md index 846f70554..facfc25c5 100644 --- a/packages/svelte-db/CHANGELOG.md +++ b/packages/svelte-db/CHANGELOG.md @@ -1,5 +1,18 @@ # @tanstack/svelte-db +## 0.1.54 + +### Patch Changes + +- Fixed `isReady` to return `true` for disabled queries in `useLiveQuery`/`injectLiveQuery` across all framework packages. When a query function returns `null` or `undefined` (disabling the query), there's no async operation to wait for, so the hook should be considered "ready" immediately. ([#886](https://github.com/TanStack/db/pull/886)) + + Additionally, all frameworks now have proper TypeScript overloads that explicitly support returning `undefined | null` from query functions, making the disabled query pattern type-safe. + + This fixes the common pattern where users conditionally enable queries and don't want to show loading states when the query is disabled. + +- Updated dependencies [[`c4b9399`](https://github.com/TanStack/db/commit/c4b93997432743d974749683059bf68a082d3e5b), [`a1a484e`](https://github.com/TanStack/db/commit/a1a484ec4d2331d702ab9c4b7e5b02622c76b3dd)]: + - @tanstack/db@0.5.11 + ## 0.1.53 ### Patch Changes diff --git a/packages/svelte-db/package.json b/packages/svelte-db/package.json index 9a1bea95c..cfdd52669 100644 --- a/packages/svelte-db/package.json +++ b/packages/svelte-db/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/svelte-db", "description": "Svelte integration for @tanstack/db", - "version": "0.1.53", + "version": "0.1.54", "dependencies": { "@tanstack/db": "workspace:*" }, diff --git a/packages/trailbase-db-collection/CHANGELOG.md b/packages/trailbase-db-collection/CHANGELOG.md index 0a3f128d1..0f3f4f256 100644 --- a/packages/trailbase-db-collection/CHANGELOG.md +++ b/packages/trailbase-db-collection/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/trailbase-db-collection +## 0.1.55 + +### Patch Changes + +- Updated dependencies [[`c4b9399`](https://github.com/TanStack/db/commit/c4b93997432743d974749683059bf68a082d3e5b), [`a1a484e`](https://github.com/TanStack/db/commit/a1a484ec4d2331d702ab9c4b7e5b02622c76b3dd)]: + - @tanstack/db@0.5.11 + ## 0.1.54 ### Patch Changes diff --git a/packages/trailbase-db-collection/package.json b/packages/trailbase-db-collection/package.json index b227f99d4..9cc1f080a 100644 --- a/packages/trailbase-db-collection/package.json +++ b/packages/trailbase-db-collection/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/trailbase-db-collection", "description": "TrailBase collection for TanStack DB", - "version": "0.1.54", + "version": "0.1.55", "dependencies": { "@standard-schema/spec": "^1.0.0", "@tanstack/db": "workspace:*", diff --git a/packages/vue-db/CHANGELOG.md b/packages/vue-db/CHANGELOG.md index 63cc10379..2596b2115 100644 --- a/packages/vue-db/CHANGELOG.md +++ b/packages/vue-db/CHANGELOG.md @@ -1,5 +1,18 @@ # @tanstack/vue-db +## 0.0.87 + +### Patch Changes + +- Fixed `isReady` to return `true` for disabled queries in `useLiveQuery`/`injectLiveQuery` across all framework packages. When a query function returns `null` or `undefined` (disabling the query), there's no async operation to wait for, so the hook should be considered "ready" immediately. ([#886](https://github.com/TanStack/db/pull/886)) + + Additionally, all frameworks now have proper TypeScript overloads that explicitly support returning `undefined | null` from query functions, making the disabled query pattern type-safe. + + This fixes the common pattern where users conditionally enable queries and don't want to show loading states when the query is disabled. + +- Updated dependencies [[`c4b9399`](https://github.com/TanStack/db/commit/c4b93997432743d974749683059bf68a082d3e5b), [`a1a484e`](https://github.com/TanStack/db/commit/a1a484ec4d2331d702ab9c4b7e5b02622c76b3dd)]: + - @tanstack/db@0.5.11 + ## 0.0.86 ### Patch Changes diff --git a/packages/vue-db/package.json b/packages/vue-db/package.json index df2283445..a7bb974a3 100644 --- a/packages/vue-db/package.json +++ b/packages/vue-db/package.json @@ -1,7 +1,7 @@ { "name": "@tanstack/vue-db", "description": "Vue integration for @tanstack/db", - "version": "0.0.86", + "version": "0.0.87", "author": "Kyle Mathews", "license": "MIT", "repository": {