From fb775f85c13e535a8dc5135d81ef7f96363538f0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 26 Jun 2025 18:09:28 +0000 Subject: [PATCH] ci: Version Packages --- .changeset/collection-lifecycle-management.md | 30 ------- .changeset/gold-friends-pull.md | 5 -- .changeset/solid-pandas-draw.md | 55 ------------- examples/react/todo/CHANGELOG.md | 8 ++ examples/react/todo/package.json | 6 +- packages/db-collections/CHANGELOG.md | 31 +++++++ packages/db-collections/package.json | 2 +- packages/db/CHANGELOG.md | 80 ++++++++++++++++++ packages/db/package.json | 2 +- packages/react-db/CHANGELOG.md | 81 +++++++++++++++++++ packages/react-db/package.json | 2 +- packages/vue-db/CHANGELOG.md | 81 +++++++++++++++++++ packages/vue-db/package.json | 2 +- pnpm-lock.yaml | 4 +- 14 files changed, 290 insertions(+), 99 deletions(-) delete mode 100644 .changeset/collection-lifecycle-management.md delete mode 100644 .changeset/gold-friends-pull.md delete mode 100644 .changeset/solid-pandas-draw.md diff --git a/.changeset/collection-lifecycle-management.md b/.changeset/collection-lifecycle-management.md deleted file mode 100644 index e4318c701..000000000 --- a/.changeset/collection-lifecycle-management.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -"@tanstack/db": patch -"@tanstack/vue-db": patch -"@tanstack/react-db": patch -"@tanstack/db-collections": patch ---- - -feat: implement Collection Lifecycle Management - -Adds automatic lifecycle management for collections to optimize resource usage. - -**New Features:** - -- Added `startSync` option (defaults to `false`, set to `true` to start syncing immediately) -- Automatic garbage collection after `gcTime` (default 5 minutes) of inactivity -- Collection status tracking: "idle" | "loading" | "ready" | "error" | "cleaned-up" -- Manual `preload()` and `cleanup()` methods for lifecycle control - -**Usage:** - -```typescript -const collection = createCollection({ - startSync: false, // Enable lazy loading - gcTime: 300000, // Cleanup timeout (default: 5 minutes) -}) - -console.log(collection.status) // Current state -await collection.preload() // Ensure ready -await collection.cleanup() // Manual cleanup -``` diff --git a/.changeset/gold-friends-pull.md b/.changeset/gold-friends-pull.md deleted file mode 100644 index 6a4ca921f..000000000 --- a/.changeset/gold-friends-pull.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@tanstack/db": patch ---- - -Refactored the way we compute change events over the synced state and the optimistic changes. This fixes a couple of issues where the change events were not being emitted correctly. diff --git a/.changeset/solid-pandas-draw.md b/.changeset/solid-pandas-draw.md deleted file mode 100644 index d7a90addd..000000000 --- a/.changeset/solid-pandas-draw.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -"@tanstack/react-db": patch -"@tanstack/vue-db": patch -"@tanstack/db": patch ---- - -Add createOptimisticAction helper that replaces useOptimisticMutation - -An example of converting a `useOptimisticMutation` hook to `createOptimisticAction`. Now all optimistic & server mutation logic are consolidated. - -```diff --import { useOptimisticMutation } from '@tanstack/react-db' -+import { createOptimisticAction } from '@tanstack/react-db' -+ -+// Create the `addTodo` action, passing in your `mutationFn` and `onMutate`. -+const addTodo = createOptimisticAction({ -+ onMutate: (text) => { -+ // Instantly applies the local optimistic state. -+ todoCollection.insert({ -+ id: uuid(), -+ text, -+ completed: false -+ }) -+ }, -+ mutationFn: async (text) => { -+ // Persist the todo to your backend -+ const response = await fetch('/api/todos', { -+ method: 'POST', -+ body: JSON.stringify({ text, completed: false }), -+ }) -+ return response.json() -+ } -+}) - - const Todo = () => { -- // Create the `addTodo` mutator, passing in your `mutationFn`. -- const addTodo = useOptimisticMutation({ mutationFn }) -- - const handleClick = () => { -- // Triggers the mutationFn -- addTodo.mutate(() => -- // Instantly applies the local optimistic state. -- todoCollection.insert({ -- id: uuid(), -- text: '🔥 Make app faster', -- completed: false -- }) -- ) -+ // Triggers the onMutate and then the mutationFn -+ addTodo('🔥 Make app faster') - } - - return