Open History to see the last commit
1# @tanstack/react-db
2
3## 0.1.83
4
5### Patch Changes
6
7- Updated dependencies [[`232f228`](https://github.com/TanStack/db/commit/232f22845ddfe179a803a241f95a3375ae63a1fb), [`232f228`](https://github.com/TanStack/db/commit/232f22845ddfe179a803a241f95a3375ae63a1fb)]:
8 - @tanstack/db@0.6.5
9
10## 0.1.82
11
12### Patch Changes
13
14- Add includes (hierarchical data) documentation to all framework SKILL.md files and fix inaccurate toArray scalar select constraint in db-core/live-queries skill. ([#1361](https://github.com/TanStack/db/pull/1361))
15
16- Updated dependencies [[`1e69dd6`](https://github.com/TanStack/db/commit/1e69dd6fac7c9d8d7314af5ce18c33f2006c96b4)]:
17 - @tanstack/db@0.6.4
18
19## 0.1.81
20
21### Patch Changes
22
23- Updated dependencies [[`e29aab3`](https://github.com/TanStack/db/commit/e29aab3ece4420c6959202294777daa606c4b9e4), [`f4a9bd2`](https://github.com/TanStack/db/commit/f4a9bd28c613dc4757f279f292c9276f6a8e012e)]:
24 - @tanstack/db@0.6.3
25
26## 0.1.80
27
28### Patch Changes
29
30- Fix stale status mismatch in useLiveSuspenseQuery causing infinite suspense fallback. ([#1427](https://github.com/TanStack/db/pull/1427))
31
32- Updated dependencies [[`3fe689a`](https://github.com/TanStack/db/commit/3fe689a4444d53a075a0dbe6e2649f8852137fc8), [`c314c36`](https://github.com/TanStack/db/commit/c314c36b8bd02f8be86865c13f31f817ce21dc66)]:
33 - @tanstack/db@0.6.2
34
35## 0.1.79
36
37### Patch Changes
38
39- Update all SKILL.md files to v0.6.0 with new documentation for persistence, virtual properties, queryOnce, createEffect, includes, indexing, and sync metadata. Add tanstack-intent keyword to all packages with skills. ([#1421](https://github.com/TanStack/db/pull/1421))
40
41- Updated dependencies [[`8b7fb1a`](https://github.com/TanStack/db/commit/8b7fb1a18522b8d1c2adb46f5917305c7d99fc4a)]:
42 - @tanstack/db@0.6.1
43
44## 0.1.78
45
46### Patch Changes
47
48- Update dependencies across workspace to resolve version mismatches: `@electric-sql/client` ^1.5.13, `@tanstack/store` ^0.9.2, `pg` ^8.20.0. Adapt subscription cleanup to `@tanstack/store` 0.9.x API which returns `Subscription` objects instead of unsubscribe functions. ([#1381](https://github.com/TanStack/db/pull/1381))
49
50- Updated dependencies [[`f60384b`](https://github.com/TanStack/db/commit/f60384b0fbde019865cbac5a7af341ff8a46d483), [`b8abc02`](https://github.com/TanStack/db/commit/b8abc0230096900746f92c51496489460b4d75e1), [`09c7afc`](https://github.com/TanStack/db/commit/09c7afc47a5ef3f3415ae601b6b00155ab64650b), [`bb09eb1`](https://github.com/TanStack/db/commit/bb09eb1eecbf680bb95a0bb08639f337e9982043), [`179d666`](https://github.com/TanStack/db/commit/179d66685449bcdf9f785c8765bc57cc19c2f7bd), [`43ecbfa`](https://github.com/TanStack/db/commit/43ecbfae5be5e59ffdce6c545d90ca5a810159e6), [`055fd94`](https://github.com/TanStack/db/commit/055fd94bd4654d27d5366af12a90da4c0e670fc0), [`055fd94`](https://github.com/TanStack/db/commit/055fd94bd4654d27d5366af12a90da4c0e670fc0), [`055fd94`](https://github.com/TanStack/db/commit/055fd94bd4654d27d5366af12a90da4c0e670fc0), [`055fd94`](https://github.com/TanStack/db/commit/055fd94bd4654d27d5366af12a90da4c0e670fc0), [`85f5435`](https://github.com/TanStack/db/commit/85f54355a426baefc88ccc55179e0cfcb4dac168), [`b65d8f7`](https://github.com/TanStack/db/commit/b65d8f767dafb1aeede26766c644f9ef0694f20c), [`e0df07e`](https://github.com/TanStack/db/commit/e0df07e1eb2eefbc829407f337cee1d443a7e9b6), [`9952921`](https://github.com/TanStack/db/commit/9952921e02ed8bca5653f0afa64862fc22ffbf9d), [`d351c67`](https://github.com/TanStack/db/commit/d351c677d687e667450138f66ab3bd0e11e7e347)]:
51 - @tanstack/db@0.6.0
52
53## 0.1.77
54
55### Patch Changes
56
57- Add `createEffect` API for reactive delta-driven effects and `useLiveQueryEffect` React hook. ([#1221](https://github.com/TanStack/db/pull/1221))
58
59 `createEffect` attaches callbacks to a live query's delta stream — firing `onEnter`, `onExit`, and `onUpdate` for row-level query-result transitions and `onBatch` for the full delta batch from each graph run — without materialising the full result set. Supports `skipInitial`, `orderBy` + `limit` (top-K window), joins, lazy loading, transaction coalescing, async disposal with `AbortSignal`, and `onSourceError` / `onError` callbacks.
60
61 `useLiveQueryEffect` is the React hook wrapper that manages the effect lifecycle (create on mount, dispose on unmount, recreate on dependency change).
62
63- Updated dependencies [[`c3e6a96`](https://github.com/TanStack/db/commit/c3e6a9654004ce53d429e0ec995738078ab93870)]:
64 - @tanstack/db@0.5.33
65
66## 0.1.76
67
68### Patch Changes
69
70- Updated dependencies [[`eeb5321`](https://github.com/TanStack/db/commit/eeb5321c578ffa2fbdfb7b0b3d64f579d1933522), [`495abc2`](https://github.com/TanStack/db/commit/495abc29fe8c088783b43402c7eeed35566d8524), [`a55e2bf`](https://github.com/TanStack/db/commit/a55e2bf54dbe78128adf5ce26d524a13dedf8145), [`41c0ea2`](https://github.com/TanStack/db/commit/41c0ea2d956f9de37d0216af371f58a461be6f1f)]:
71 - @tanstack/db@0.5.32
72
73## 0.1.75
74
75### Patch Changes
76
77- Add Intent agent skills (SKILL.md files) to guide AI coding agents. Include skills for core DB concepts, all 5 framework bindings, meta-framework integration, and offline transactions. Also add `export * from '@tanstack/db'` to angular-db for consistency with other framework packages. ([#1330](https://github.com/TanStack/db/pull/1330))
78
79- fix(react-db): make getNextPageParam optional in useLiveInfiniteQuery ([#1268](https://github.com/TanStack/db/pull/1268))
80
81- fix(react-db): handle rejected/stale setWindow promises in useLiveInfiniteQuery ([#1269](https://github.com/TanStack/db/pull/1269))
82
83- Updated dependencies [[`bf1d078`](https://github.com/TanStack/db/commit/bf1d078627de150bfca02e2ae2ad8b0289c19b37)]:
84 - @tanstack/db@0.5.31
85
86## 0.1.74
87
88### Patch Changes
89
90- Updated dependencies [[`e9d0fd8`](https://github.com/TanStack/db/commit/e9d0fd8f0db18a7dc8a0f2b3eacd50a94f6258f7)]:
91 - @tanstack/db@0.5.30
92
93## 0.1.73
94
95### Patch Changes
96
97- Updated dependencies [[`77b815e`](https://github.com/TanStack/db/commit/77b815ee52e91ca8d03110a551a4cb8bab4f2daa), [`ac4ce67`](https://github.com/TanStack/db/commit/ac4ce6790e906f5cfb086b063c8d7daa7681ceb9)]:
98 - @tanstack/db@0.5.29
99
100## 0.1.72
101
102### Patch Changes
103
104- Updated dependencies [[`46450e7`](https://github.com/TanStack/db/commit/46450e73bf78dbdcbef1fb46cb90c6a86b10f6c8)]:
105 - @tanstack/db@0.5.28
106
107## 0.1.71
108
109### Patch Changes
110
111- Updated dependencies [[`802550f`](https://github.com/TanStack/db/commit/802550f3c517b8decac273edf9a4a6074fb3526b), [`dc41d7d`](https://github.com/TanStack/db/commit/dc41d7dacc4a70cb62462633a375de823f01b280), [`4ff3da5`](https://github.com/TanStack/db/commit/4ff3da57e095dc17d8585585d7678b9538cf7602), [`2223cd6`](https://github.com/TanStack/db/commit/2223cd6b51ce37f21983302804a75af28b47f2fe)]:
112 - @tanstack/db@0.5.27
113
114## 0.1.70
115
116### Patch Changes
117
118- Fix `useLiveInfiniteQuery` peek-ahead detection for `hasNextPage`. The initial query now correctly requests `pageSize + 1` items to detect whether additional pages exist, matching the behavior of subsequent page loads. ([#1209](https://github.com/TanStack/db/pull/1209))
119
120 Fix async on-demand pagination by ensuring the graph callback fires at least once even when there is no pending graph work, so that `loadMoreIfNeeded` is triggered after `setWindow()` increases the limit.
121
122- Updated dependencies [[`85c373e`](https://github.com/TanStack/db/commit/85c373ef892e4080fe86b26e2fcb762181545e3c), [`9184dcc`](https://github.com/TanStack/db/commit/9184dcce62019ea870f968f4a4a5c2428291214d), [`83d5ac8`](https://github.com/TanStack/db/commit/83d5ac82983fb6c244c53d349c83845969473a9b)]:
123 - @tanstack/db@0.5.26
124
125## 0.1.69
126
127### Patch Changes
128
129- Updated dependencies [[`43c7c9d`](https://github.com/TanStack/db/commit/43c7c9d5f2b47366a58f87470ac5dca95020ac57), [`284ebcc`](https://github.com/TanStack/db/commit/284ebcc8346bd237c3381de766995b8bda35009a)]:
130 - @tanstack/db@0.5.25
131
132## 0.1.68
133
134### Patch Changes
135
136- Updated dependencies [[`7099459`](https://github.com/TanStack/db/commit/7099459291810b237a9fb24bbfe6e543852a2ab2)]:
137 - @tanstack/db@0.5.24
138
139## 0.1.67
140
141### Patch Changes
142
143- Updated dependencies [[`05130f2`](https://github.com/TanStack/db/commit/05130f2420eb682f11f099310a0af87afa3f35fe)]:
144 - @tanstack/db@0.5.23
145
146## 0.1.66
147
148### Patch Changes
149
150- Updated dependencies [[`f9b741e`](https://github.com/TanStack/db/commit/f9b741e9fb636be1c9f1502b7e28fe691bae2480)]:
151 - @tanstack/db@0.5.22
152
153## 0.1.65
154
155### Patch Changes
156
157- Updated dependencies [[`6745ed0`](https://github.com/TanStack/db/commit/6745ed003dc25cfd6fa0f7e60f708205a6069ff2), [`1b22e40`](https://github.com/TanStack/db/commit/1b22e40c56323cfa5e7f759272fed53320aa32f7), [`7a2cacd`](https://github.com/TanStack/db/commit/7a2cacd7a426530cb77844a8c2680f6b06e9ce2f), [`bdf9405`](https://github.com/TanStack/db/commit/bdf94059e7ab98b5181e0df7d8d25cd1dbb5ae58)]:
158 - @tanstack/db@0.5.21
159
160## 0.1.64
161
162### Patch Changes
163
164- Updated dependencies []:
165 - @tanstack/db@0.5.20
166
167## 0.1.63
168
169### Patch Changes
170
171- Updated dependencies [[`29033b8`](https://github.com/TanStack/db/commit/29033b8f55b0ba5721371ad761037ec813440aa7), [`888ad6a`](https://github.com/TanStack/db/commit/888ad6afe5932b0467320c04fbd4583469cb9c47)]:
172 - @tanstack/db@0.5.19
173
174## 0.1.62
175
176### Patch Changes
177
178- Updated dependencies [[`c1247e8`](https://github.com/TanStack/db/commit/c1247e816950314da6d201613481577834c1d97a)]:
179 - @tanstack/db@0.5.18
180
181## 0.1.61
182
183### Patch Changes
184
185- Improve runtime error message and documentation when `useLiveSuspenseQuery` receives `undefined` from query callback. ([#860](https://github.com/TanStack/db/pull/860))
186
187 Following TanStack Query's `useSuspenseQuery` design, `useLiveSuspenseQuery` intentionally does not support disabled queries (when callback returns `undefined` or `null`). This maintains the type guarantee that `data` is always `T` (not `T | undefined`), which is a core benefit of using Suspense.
188
189 **What changed:**
190 1. **Improved runtime error message** with clear guidance:
191
192 ```
193 useLiveSuspenseQuery does not support disabled queries (callback returned undefined/null).
194 The Suspense pattern requires data to always be defined (T, not T | undefined).
195 Solutions:
196 1) Use conditional rendering - don't render the component until the condition is met.
197 2) Use useLiveQuery instead, which supports disabled queries with the 'isEnabled' flag.
198 ```
199
200 2. **Enhanced JSDoc documentation** with detailed `@remarks` section explaining the design decision, showing both incorrect (❌) and correct (✅) patterns
201
202 **Why this matters:**
203
204 ```typescript
205 // ❌ This pattern doesn't work with Suspense queries:
206 const { data } = useLiveSuspenseQuery(
207 (q) => userId
208 ? q.from({ users }).where(({ users }) => eq(users.id, userId)).findOne()
209 : undefined,
210 [userId]
211 )
212
213 // ✅ Instead, use conditional rendering:
214 function UserProfile({ userId }: { userId: string }) {
215 const { data } = useLiveSuspenseQuery(
216 (q) => q.from({ users }).where(({ users }) => eq(users.id, userId)).findOne(),
217 [userId]
218 )
219 return <div>{data.name}</div> // data is guaranteed non-undefined
220 }
221
222 function App({ userId }: { userId?: string }) {
223 if (!userId) return <div>No user selected</div>
224 return <UserProfile userId={userId} />
225 }
226
227 // ✅ Or use useLiveQuery for conditional queries:
228 const { data, isEnabled } = useLiveQuery(
229 (q) => userId
230 ? q.from({ users }).where(({ users }) => eq(users.id, userId)).findOne()
231 : undefined,
232 [userId]
233 )
234 ```
235
236 This aligns with TanStack Query's philosophy where Suspense queries prioritize type safety and proper component composition over flexibility.
237
238- Updated dependencies [[`f795a67`](https://github.com/TanStack/db/commit/f795a674f21659ef46ff370d4f3b9903a596bcaf), [`d542667`](https://github.com/TanStack/db/commit/d542667a3440415d8e6cbb449b20abd3cbd6855c), [`6503c09`](https://github.com/TanStack/db/commit/6503c091a259208331f471dca29abf086e881147), [`b1cc4a7`](https://github.com/TanStack/db/commit/b1cc4a7e018ffb6804ae7f1c99e9c6eb4bb22812)]:
239 - @tanstack/db@0.5.17
240
241## 0.1.60
242
243### Patch Changes
244
245- Updated dependencies [[`41308b8`](https://github.com/TanStack/db/commit/41308b8ee914aa467e22842cd454f06d1a60032e)]:
246 - @tanstack/db@0.5.16
247
248## 0.1.59
249
250### Patch Changes
251
252- Updated dependencies [[`32ec4d8`](https://github.com/TanStack/db/commit/32ec4d8478cca96f76f3a49efc259c95b85baa40)]:
253 - @tanstack/db@0.5.15
254
255## 0.1.58
256
257### Patch Changes
258
259- Updated dependencies [[`26ed0aa`](https://github.com/TanStack/db/commit/26ed0aad2def60e652508a99b2e980e73f70148e)]:
260 - @tanstack/db@0.5.14
261
262## 0.1.57
263
264### Patch Changes
265
266- Updated dependencies [[`8ed7725`](https://github.com/TanStack/db/commit/8ed7725514a6a501482a391162f7792aa8b371e5), [`01452bf`](https://github.com/TanStack/db/commit/01452bfd0d00da8bd52941a4954af73749473651)]:
267 - @tanstack/db@0.5.13
268
269## 0.1.56
270
271### Patch Changes
272
273- Updated dependencies [[`b3b1940`](https://github.com/TanStack/db/commit/b3b194000d8efcc2c6cc45a663029dadc26f13f0), [`09da081`](https://github.com/TanStack/db/commit/09da081b420fc915d7f0dc566c6cdbbc78582435), [`86ad40c`](https://github.com/TanStack/db/commit/86ad40c6bc37b2f5d4ad24d06f72168ca4b96161)]:
274 - @tanstack/db@0.5.12
275
276## 0.1.55
277
278### Patch Changes
279
280- 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))
281
282 Additionally, all frameworks now have proper TypeScript overloads that explicitly support returning `undefined | null` from query functions, making the disabled query pattern type-safe.
283
284 This fixes the common pattern where users conditionally enable queries and don't want to show loading states when the query is disabled.
285
286- Updated dependencies [[`c4b9399`](https://github.com/TanStack/db/commit/c4b93997432743d974749683059bf68a082d3e5b), [`a1a484e`](https://github.com/TanStack/db/commit/a1a484ec4d2331d702ab9c4b7e5b02622c76b3dd)]:
287 - @tanstack/db@0.5.11
288
289## 0.1.54
290
291### Patch Changes
292
293- Updated dependencies [[`1d19d22`](https://github.com/TanStack/db/commit/1d19d2219cbbaef6483845df1c3b078077e4e3bd), [`b3e4e80`](https://github.com/TanStack/db/commit/b3e4e80c4b73d96c15391ac25efb518c7ae7ccbb)]:
294 - @tanstack/db@0.5.10
295
296## 0.1.53
297
298### Patch Changes
299
300- Updated dependencies [[`5f474f1`](https://github.com/TanStack/db/commit/5f474f1eabd57e144ba05b0f33d848f7efc8fb07)]:
301 - @tanstack/db@0.5.9
302
303## 0.1.52
304
305### Patch Changes
306
307- Updated dependencies [[`954c8fe`](https://github.com/TanStack/db/commit/954c8fed5ed92a348ac8b6d8333bc69c955f4f60), [`51c73aa`](https://github.com/TanStack/db/commit/51c73aaa2b27b27966edb98fb6664beb44eac1ac)]:
308 - @tanstack/db@0.5.8
309
310## 0.1.51
311
312### Patch Changes
313
314- Updated dependencies [[`295cb45`](https://github.com/TanStack/db/commit/295cb45797572b232650eddd3d62ffa937fa2fd7)]:
315 - @tanstack/db@0.5.7
316
317## 0.1.50
318
319### Patch Changes
320
321- Updated dependencies [[`c8a2c16`](https://github.com/TanStack/db/commit/c8a2c16aa528427d5ddd55cda4ee59a5cb369b5f)]:
322 - @tanstack/db@0.5.6
323
324## 0.1.49
325
326### Patch Changes
327
328- Updated dependencies [[`077fc1a`](https://github.com/TanStack/db/commit/077fc1a418ca090d7533115888c09f3f609e36b2)]:
329 - @tanstack/db@0.5.5
330
331## 0.1.48
332
333### Patch Changes
334
335- Updated dependencies [[`acb3e4f`](https://github.com/TanStack/db/commit/acb3e4f1441e6872ca577e74d92ae2d77deb5938), [`464805d`](https://github.com/TanStack/db/commit/464805d96bad6d0fd741e48fbfc98e90dc58bebe), [`2c2e4db`](https://github.com/TanStack/db/commit/2c2e4dbd781d278347d73373f66d3c51c6388116), [`15c772f`](https://github.com/TanStack/db/commit/15c772f5e42e49000a2d775fd8e4cfda3418243f)]:
336 - @tanstack/db@0.5.4
337
338## 0.1.47
339
340### Patch Changes
341
342- Updated dependencies [[`846a830`](https://github.com/TanStack/db/commit/846a8309a243197245f4400a5d53cef5cec6d5d9), [`8e26dcf`](https://github.com/TanStack/db/commit/8e26dcfde600e4a18cd51fbe524560d60ab98d70)]:
343 - @tanstack/db@0.5.3
344
345## 0.1.46
346
347### Patch Changes
348
349- Updated dependencies [[`99a3716`](https://github.com/TanStack/db/commit/99a371630b9f4632db86c43357c64701ecb53b0e)]:
350 - @tanstack/db@0.5.2
351
352## 0.1.45
353
354### Patch Changes
355
356- Updated dependencies [[`a83a818`](https://github.com/TanStack/db/commit/a83a8189514d22ca2fcdf34b9cb97206d3c03c38)]:
357 - @tanstack/db@0.5.1
358
359## 0.1.44
360
361### Patch Changes
362
363- Updated dependencies [[`243a35a`](https://github.com/TanStack/db/commit/243a35a632ee0aca20c3ee12ee2ac2929d8be11d), [`f9d11fc`](https://github.com/TanStack/db/commit/f9d11fc3d7297c61feb3c6876cb2f436edbb5b34), [`7aedf12`](https://github.com/TanStack/db/commit/7aedf12996a67ef64010bca0d78d51c919dd384f), [`28f81b5`](https://github.com/TanStack/db/commit/28f81b5165d0a9566f99c2b6cf0ad09533e1a2cb), [`28f81b5`](https://github.com/TanStack/db/commit/28f81b5165d0a9566f99c2b6cf0ad09533e1a2cb), [`f6ac7ea`](https://github.com/TanStack/db/commit/f6ac7eac50ae1334ddb173786a68c9fc732848f9), [`01093a7`](https://github.com/TanStack/db/commit/01093a762cf2f5f308edec7f466d1c3dabb5ea9f)]:
364 - @tanstack/db@0.5.0
365
366## 0.1.43
367
368### Patch Changes
369
370- Updated dependencies [[`6c55e16`](https://github.com/TanStack/db/commit/6c55e16a2545b479b1d47f548b6846d362573d45), [`7805afb`](https://github.com/TanStack/db/commit/7805afb7286b680168b336e77dd4de7dd1b6f06a), [`1367756`](https://github.com/TanStack/db/commit/1367756d0a68447405c5f5c1a3cca30ab0558d74)]:
371 - @tanstack/db@0.4.20
372
373## 0.1.42
374
375### Patch Changes
376
377- Updated dependencies [[`75470a8`](https://github.com/TanStack/db/commit/75470a8297f316b4817601b2ea92cb9b21cc7829)]:
378 - @tanstack/db@0.4.19
379
380## 0.1.41
381
382### Patch Changes
383
384- Add `useLiveSuspenseQuery` hook for React Suspense support ([#697](https://github.com/TanStack/db/pull/697))
385
386 Introduces a new `useLiveSuspenseQuery` hook that integrates with React Suspense and Error Boundaries, following TanStack Query's `useSuspenseQuery` pattern.
387
388 **Key features:**
389 - React 18+ compatible using the throw promise pattern
390 - Type-safe API with guaranteed data (never undefined)
391 - Automatic error handling via Error Boundaries
392 - Reactive updates after initial load via useSyncExternalStore
393 - Support for dependency-based re-suspension
394 - Works with query functions, config objects, and pre-created collections
395
396 **Example usage:**
397
398 ```tsx
399 import { Suspense } from 'react'
400 import { useLiveSuspenseQuery } from '@tanstack/react-db'
401
402 function TodoList() {
403 // Data is guaranteed to be defined - no isLoading needed
404 const { data } = useLiveSuspenseQuery((q) =>
405 q
406 .from({ todos: todosCollection })
407 .where(({ todos }) => eq(todos.completed, false)),
408 )
409
410 return (
411 <ul>
412 {data.map((todo) => (
413 <li key={todo.id}>{todo.text}</li>
414 ))}
415 </ul>
416 )
417 }
418
419 function App() {
420 return (
421 <Suspense fallback={<div>Loading...</div>}>
422 <TodoList />
423 </Suspense>
424 )
425 }
426 ```
427
428 **Implementation details:**
429 - Throws promises when collection is loading (caught by Suspense)
430 - Throws errors when collection fails (caught by Error Boundary)
431 - Reuses promise across re-renders to prevent infinite loops
432 - Detects dependency changes and creates new collection/promise
433 - Same TypeScript overloads as useLiveQuery for consistency
434
435 **Documentation:**
436 - Comprehensive guide in live-queries.md covering usage patterns and when to use each hook
437 - Comparison with useLiveQuery showing different approaches to loading/error states
438 - Router loader pattern recommendation for React Router/TanStack Router users
439 - Error handling examples with Suspense and Error Boundaries
440
441 Resolves #692
442
443## 0.1.40
444
445### Patch Changes
446
447- Updated dependencies [[`f416231`](https://github.com/TanStack/db/commit/f41623180c862b58b4fa6415383dfdb034f84ee9), [`b1b8299`](https://github.com/TanStack/db/commit/b1b82994cb9765225129b5a19be06e9369e3158d)]:
448 - @tanstack/db@0.4.18
449
450## 0.1.39
451
452### Patch Changes
453
454- Updated dependencies [[`49bcaa5`](https://github.com/TanStack/db/commit/49bcaa5557ba8d647c947811ed6e0c2450159d84)]:
455 - @tanstack/db@0.4.17
456
457## 0.1.38
458
459### Patch Changes
460
461- Add paced mutations with pluggable timing strategies ([#704](https://github.com/TanStack/db/pull/704))
462
463 Introduces a new paced mutations system that enables optimistic mutations with pluggable timing strategies. This provides fine-grained control over when and how mutations are persisted to the backend. Powered by [TanStack Pacer](https://github.com/TanStack/pacer).
464
465 **Key Design:**
466 - **Debounce/Throttle**: Only one pending transaction (collecting mutations) and one persisting transaction (writing to backend) at a time. Multiple rapid mutations automatically merge together.
467 - **Queue**: Each mutation creates a separate transaction, guaranteed to run in the order they're made (FIFO by default, configurable to LIFO).
468
469 **Core Features:**
470 - **Pluggable Strategy System**: Choose from debounce, queue, or throttle strategies to control mutation timing
471 - **Auto-merging Mutations**: Multiple rapid mutations on the same item automatically merge for efficiency (debounce/throttle only)
472 - **Transaction Management**: Full transaction lifecycle tracking (pending → persisting → completed/failed)
473 - **React Hook**: `usePacedMutations` for easy integration in React applications
474
475 **Available Strategies:**
476 - `debounceStrategy`: Wait for inactivity before persisting. Only final state is saved. (ideal for auto-save, search-as-you-type)
477 - `queueStrategy`: Each mutation becomes a separate transaction, processed sequentially in order (defaults to FIFO, configurable to LIFO). All mutations are guaranteed to persist. (ideal for sequential workflows, rate-limited APIs)
478 - `throttleStrategy`: Ensure minimum spacing between executions. Mutations between executions are merged. (ideal for analytics, progress updates)
479
480 **Example Usage:**
481
482 ```ts
483 import { usePacedMutations, debounceStrategy } from '@tanstack/react-db'
484
485 const mutate = usePacedMutations({
486 mutationFn: async ({ transaction }) => {
487 await api.save(transaction.mutations)
488 },
489 strategy: debounceStrategy({ wait: 500 }),
490 })
491
492 // Trigger a mutation
493 const tx = mutate(() => {
494 collection.update(id, (draft) => {
495 draft.value = newValue
496 })
497 })
498
499 // Optionally await persistence
500 await tx.isPersisted.promise
501 ```
502
503- Updated dependencies [[`979a66f`](https://github.com/TanStack/db/commit/979a66f2f6eff0ffe44dfde7c67feea933ee6110), [`f8a979b`](https://github.com/TanStack/db/commit/f8a979ba3aa90ac7e85f7a065fc050bda6589b4b), [`cb25623`](https://github.com/TanStack/db/commit/cb256234c9cd8df7771808b147e5afc2be56f51f)]:
504 - @tanstack/db@0.4.16
505
506## 0.1.37
507
508### Patch Changes
509
510- Updated dependencies [[`6738247`](https://github.com/TanStack/db/commit/673824791bcfae04acf42fc35e5d6d8755adceb2)]:
511 - @tanstack/db@0.4.15
512
513## 0.1.36
514
515### Patch Changes
516
517- Updated dependencies [[`970616b`](https://github.com/TanStack/db/commit/970616b6db723d1716eecd5076417de5d6e9a884)]:
518 - @tanstack/db@0.4.14
519
520## 0.1.35
521
522### Patch Changes
523
524- Updated dependencies [[`3c9526c`](https://github.com/TanStack/db/commit/3c9526cd1fd80032ddddff32cf4a23dfa8376888)]:
525 - @tanstack/db@0.4.13
526
527## 0.1.34
528
529### Patch Changes
530
531- Updated dependencies [[`8b29841`](https://github.com/TanStack/db/commit/8b298417964340bbac5ad08a831766f8f1497477), [`8187c6d`](https://github.com/TanStack/db/commit/8187c6d69c4b498e306ac2eb5fc7115e4f8193a5)]:
532 - @tanstack/db@0.4.12
533
534## 0.1.33
535
536### Patch Changes
537
538- Add support for pre-created live query collections in useLiveInfiniteQuery, enabling router loader patterns where live queries can be created, preloaded, and passed to components. ([#684](https://github.com/TanStack/db/pull/684))
539
540- Updated dependencies [[`5566b26`](https://github.com/TanStack/db/commit/5566b26100abdae9b4a041f048aeda1dd726e904)]:
541 - @tanstack/db@0.4.11
542
543## 0.1.32
544
545### Patch Changes
546
547- Add `useLiveInfiniteQuery` hook for infinite scrolling with live updates. ([#669](https://github.com/TanStack/db/pull/669))
548
549 The new `useLiveInfiniteQuery` hook provides an infinite query pattern similar to TanStack Query's `useInfiniteQuery`, but with live updates from your local collection. It uses `liveQueryCollection.utils.setWindow()` internally to efficiently paginate through ordered data without recreating the query on each page fetch.
550
551 **Key features:**
552 - Automatic live updates as data changes in the collection
553 - Efficient pagination using dynamic window adjustment
554 - Peek-ahead mechanism to detect when more pages are available
555 - Compatible with TanStack Query's infinite query API patterns
556
557 **Example usage:**
558
559 ```tsx
560 import { useLiveInfiniteQuery } from '@tanstack/react-db'
561
562 function PostList() {
563 const { data, pages, fetchNextPage, hasNextPage, isLoading } =
564 useLiveInfiniteQuery(
565 (q) =>
566 q
567 .from({ posts: postsCollection })
568 .orderBy(({ posts }) => posts.createdAt, 'desc'),
569 {
570 pageSize: 20,
571 getNextPageParam: (lastPage, allPages) =>
572 lastPage.length === 20 ? allPages.length : undefined,
573 },
574 )
575
576 if (isLoading) return <div>Loading...</div>
577
578 return (
579 <div>
580 {pages.map((page, i) => (
581 <div key={i}>
582 {page.map((post) => (
583 <PostCard key={post.id} post={post} />
584 ))}
585 </div>
586 ))}
587 {hasNextPage && (
588 <button onClick={() => fetchNextPage()}>Load More</button>
589 )}
590 </div>
591 )
592 }
593 ```
594
595 **Requirements:**
596 - Query must include `.orderBy()` for the window mechanism to work
597 - Returns flattened `data` array and `pages` array for flexible rendering
598 - Automatically detects new pages when data is synced to the collection
599
600- Updated dependencies [[`63aa8ef`](https://github.com/TanStack/db/commit/63aa8ef8b09960ce0f93e068d41b37fb0503a21a), [`b0687ab`](https://github.com/TanStack/db/commit/b0687ab4c1476362d7a25e3c1704ab0fb0385455)]:
601 - @tanstack/db@0.4.10
602
603## 0.1.31
604
605### Patch Changes
606
607- Updated dependencies [[`e52be92`](https://github.com/TanStack/db/commit/e52be92ce16b09a095b4b9baf7ac2cf708146f47), [`4a7c44a`](https://github.com/TanStack/db/commit/4a7c44a723223ade4e226745eadffead671fff13), [`ee61bb6`](https://github.com/TanStack/db/commit/ee61bb61f76ca510f113e96baa090940719aac40)]:
608 - @tanstack/db@0.4.9
609
610## 0.1.30
611
612### Patch Changes
613
614- Refactored live queries to execute eagerly during sync. Live queries now materialize their results immediately as data arrives from source collections, even while those collections are still in a "loading" state, rather than waiting for all sources to be "ready" before executing. ([#658](https://github.com/TanStack/db/pull/658))
615
616- Updated dependencies [[`d9ae7b7`](https://github.com/TanStack/db/commit/d9ae7b76b8ab30fd55fe835531974eee333dd450), [`44555b7`](https://github.com/TanStack/db/commit/44555b733a1a4d38d8126bf8da51d4b44f898298)]:
617 - @tanstack/db@0.4.8
618
619## 0.1.29
620
621### Patch Changes
622
623- Updated dependencies [[`6692aad`](https://github.com/TanStack/db/commit/6692aad4267e127b71ce595529080d6fc0aa2066)]:
624 - @tanstack/db@0.4.7
625
626## 0.1.28
627
628### Patch Changes
629
630- Updated dependencies [[`dd6cdf7`](https://github.com/TanStack/db/commit/dd6cdf7ea62d91bfb12ea8d25bdd25549259c113), [`c30a20b`](https://github.com/TanStack/db/commit/c30a20b1df39b34f18d0aa7c7b901a27fb963f36)]:
631 - @tanstack/db@0.4.6
632
633## 0.1.27
634
635### Patch Changes
636
637- Updated dependencies [[`7556fb6`](https://github.com/TanStack/db/commit/7556fb6f888b5bdc830fe6448eb3368efeb61988)]:
638 - @tanstack/db@0.4.5
639
640## 0.1.26
641
642### Patch Changes
643
644- Updated dependencies [[`56b870b`](https://github.com/TanStack/db/commit/56b870b3e63f8010b6eeebea87893b10c75a5888), [`f623990`](https://github.com/TanStack/db/commit/f62399062e4db61426ddfbbbe324c48cab2513dd), [`5f43d5f`](https://github.com/TanStack/db/commit/5f43d5f7f47614be8e71856ceb0f91733d9be627), [`05776f5`](https://github.com/TanStack/db/commit/05776f52a8ce4fe41b34fc8cace2046afc42835c), [`d27d32a`](https://github.com/TanStack/db/commit/d27d32aceb7f8fcabc07dcf1b55a84a605d2f23f)]:
645 - @tanstack/db@0.4.4
646
647## 0.1.25
648
649### Patch Changes
650
651- Updated dependencies [[`32f2212`](https://github.com/TanStack/db/commit/32f221278e2a684f3f4e1e2ace1ca98f5ecc858a)]:
652 - @tanstack/db@0.4.3
653
654## 0.1.24
655
656### Patch Changes
657
658- Updated dependencies [[`51c6bc5`](https://github.com/TanStack/db/commit/51c6bc58244ed6a3ac853e7e6af7775b33d6b65a), [`248e2c6`](https://github.com/TanStack/db/commit/248e2c6db8e9df8cf2cb225100e4ba9cb67cd534), [`ce7e2b2`](https://github.com/TanStack/db/commit/ce7e2b209ed882baa29ec86f89f1b527d6580e0b), [`1b832ff`](https://github.com/TanStack/db/commit/1b832ff9ec236e7dbe9256803e2ba12b4c9b9a30)]:
659 - @tanstack/db@0.4.2
660
661## 0.1.23
662
663### Patch Changes
664
665- Updated dependencies [[`8cd0876`](https://github.com/TanStack/db/commit/8cd0876b50bc7c1a614365318d5e74c2f32a0f80)]:
666 - @tanstack/db@0.4.1
667
668## 0.1.22
669
670### Patch Changes
671
672- Let collection.subscribeChanges return a subscription object. Move all data loading code related to optimizations into that subscription object. ([#564](https://github.com/TanStack/db/pull/564))
673
674- Updated dependencies [[`2f87216`](https://github.com/TanStack/db/commit/2f8721630e06331ca8bb2f962fbb283341103a58), [`ac6250a`](https://github.com/TanStack/db/commit/ac6250a879e95718e8d911732c10fb3388569f0f), [`2f87216`](https://github.com/TanStack/db/commit/2f8721630e06331ca8bb2f962fbb283341103a58)]:
675 - @tanstack/db@0.4.0
676
677## 0.1.21
678
679### Patch Changes
680
681- Expand `useLiveQuery` callback to support conditional queries and additional return types, enabling the ability to temporarily disable the query. ([#535](https://github.com/TanStack/db/pull/535))
682
683 **New Features:**
684 - Callback can now return `undefined` or `null` to temporarily disable the query
685 - Callback can return a pre-created `Collection` instance to use it directly
686 - Callback can return a `LiveQueryCollectionConfig` object for advanced configuration
687 - When disabled (returning `undefined`/`null`), the hook returns a specific idle state
688
689 **Usage Examples:**
690
691 ```ts
692 // Conditional queries - disable when not ready
693 const enabled = useState(false)
694 const { data, state, isIdle } = useLiveQuery((q) => {
695 if (!enabled) return undefined // Disables the query
696 return q.from({ users }).where(...)
697 }, [enabled])
698
699 /**
700 * When disabled, returns:
701 * {
702 * state: undefined,
703 * data: undefined,
704 * isIdle: true,
705 * ...
706 * }
707 */
708
709 // Return pre-created Collection
710 const { data } = useLiveQuery((q) => {
711 if (usePrebuilt) return myCollection // Use existing collection
712 return q.from({ items }).select(...)
713 }, [usePrebuilt])
714
715 // Return LiveQueryCollectionConfig
716 const { data } = useLiveQuery((q) => {
717 return {
718 query: q.from({ items }).select(...),
719 id: `my-collection`,
720 }
721 })
722 ```
723
724- Updated dependencies [[`cacfca2`](https://github.com/TanStack/db/commit/cacfca2d1b430c34a05202128fd3affa4bff54d6)]:
725 - @tanstack/db@0.3.2
726
727## 0.1.20
728
729### Patch Changes
730
731- Updated dependencies [[`5f51f35`](https://github.com/TanStack/db/commit/5f51f35d2c9543766a00cc5eea1374c62798b34e)]:
732 - @tanstack/db@0.3.1
733
734## 0.1.19
735
736### Patch Changes
737
738- Updated dependencies [[`c557a14`](https://github.com/TanStack/db/commit/c557a1488650ea9081b671a4ac278d55c59ac9cc), [`b5c87f7`](https://github.com/TanStack/db/commit/b5c87f71dbb534e4f1c660cf010e2cb6c0446ec5)]:
739 - @tanstack/db@0.3.0
740
741## 0.1.18
742
743### Patch Changes
744
745- Updated dependencies [[`b03894d`](https://github.com/TanStack/db/commit/b03894db05e063629a3660e03b31a80a48558dd5), [`3968087`](https://github.com/TanStack/db/commit/39680877fdc1993733933d2def13217bd18fa254)]:
746 - @tanstack/db@0.2.5
747
748## 0.1.17
749
750### Patch Changes
751
752- Updated dependencies [[`92febbf`](https://github.com/TanStack/db/commit/92febbf1feaa1d46f8cc4d7a4ea0d44cd5f85256), [`b487430`](https://github.com/TanStack/db/commit/b4874308813f95232f3361de539cec104ed55170)]:
753 - @tanstack/db@0.2.4
754
755## 0.1.16
756
757### Patch Changes
758
759- Updated dependencies [[`b162556`](https://github.com/TanStack/db/commit/b1625565df44b0824501297f7ef14ae1cd450b49)]:
760 - @tanstack/db@0.2.3
761
762## 0.1.15
763
764### Patch Changes
765
766- Updated dependencies [[`33515c6`](https://github.com/TanStack/db/commit/33515c69befc557add2cf828354ee378100f3977)]:
767 - @tanstack/db@0.2.2
768
769## 0.1.14
770
771### Patch Changes
772
773- Updated dependencies [[`620ebea`](https://github.com/TanStack/db/commit/620ebea96eb3fbeec66701b949de9920c4084c17)]:
774 - @tanstack/db@0.2.1
775
776## 0.1.13
777
778### Patch Changes
779
780- Updated dependencies [[`08303e6`](https://github.com/TanStack/db/commit/08303e645974db97e10b2aca0031abcbce027dd6), [`bafeaa1`](https://github.com/TanStack/db/commit/bafeaa1e9f161ac2200ce86537e442b2aa8e2a5b), [`1814f8c`](https://github.com/TanStack/db/commit/1814f8cc3c0e831c82f8053b86fbbbd737e4f34b), [`31acdf2`](https://github.com/TanStack/db/commit/31acdf2a96411da327f93f0d30fa78d884422969), [`e41ed7e`](https://github.com/TanStack/db/commit/e41ed7e1ff1d94dd3ce0c48b6321f66b8ea044fd), [`51954d8`](https://github.com/TanStack/db/commit/51954d8c5d64291d136159bce293e0ad00a19f88)]:
781 - @tanstack/db@0.2.0
782
783## 0.1.12
784
785### Patch Changes
786
787- Updated dependencies [[`cc4c34a`](https://github.com/TanStack/db/commit/cc4c34a6b40c81c83aa10c8d00dfc0a3d33c56db)]:
788 - @tanstack/db@0.1.12
789
790## 0.1.11
791
792### Patch Changes
793
794- Fixed a bug where a race condition could cause initial results not to be rendered when using `useLiveQuery`. ([#485](https://github.com/TanStack/db/pull/485))
795
796- Updated dependencies [[`b869f68`](https://github.com/TanStack/db/commit/b869f68f0109b3126509f202a38855cee38b4276)]:
797 - @tanstack/db@0.1.11
798
799## 0.1.10
800
801### Patch Changes
802
803- Updated dependencies [[`eb8fd18`](https://github.com/TanStack/db/commit/eb8fd18c50ee03b72cb06e4d7ef25f214367950b), [`e59a355`](https://github.com/TanStack/db/commit/e59a3551e75bac9dd166e14c911d9491e3a67b9a), [`074aab0`](https://github.com/TanStack/db/commit/074aab0477a7c55e9e0f19a705b96ed2619e2afb), [`d469c39`](https://github.com/TanStack/db/commit/d469c39a7bdc034fa4fbc533010573b3515f239f)]:
804 - @tanstack/db@0.1.10
805
806## 0.1.9
807
808### Patch Changes
809
810- Updated dependencies [[`d64b4a8`](https://github.com/TanStack/db/commit/d64b4a8b692a213c7ad58faaf66f5f5fd50bef66)]:
811 - @tanstack/db@0.1.9
812
813## 0.1.8
814
815### Patch Changes
816
817- Updated dependencies [[`1c5e206`](https://github.com/TanStack/db/commit/1c5e206d00d0a99f8419f0d00429b5a3c6cdc76e), [`4d20004`](https://github.com/TanStack/db/commit/4d2000488b9b5abf85c05801633297528af0eff6), [`968602e`](https://github.com/TanStack/db/commit/968602e4ffc597eaa559219daf22d6ef6321162a)]:
818 - @tanstack/db@0.1.8
819
820## 0.1.7
821
822### Patch Changes
823
824- Updated dependencies [[`48d0889`](https://github.com/TanStack/db/commit/48d088996a3f18df026aa7d2d1e7f27d1151345b), [`aecbcc3`](https://github.com/TanStack/db/commit/aecbcc32012561f1645df0bdf89a6c259058d888), [`a937f4c`](https://github.com/TanStack/db/commit/a937f4c7a5f4fc20c255e86692c5e2e80d5ebbec), [`3d60fad`](https://github.com/TanStack/db/commit/3d60fadbb9e8a1b62a9bcde947e282d653a2a270), [`79c95a3`](https://github.com/TanStack/db/commit/79c95a36f60087ffc3f9a02b76975c8bdf40acc7)]:
825 - @tanstack/db@0.1.7
826
827## 0.1.6
828
829### Patch Changes
830
831- Updated dependencies [[`ad33e9e`](https://github.com/TanStack/db/commit/ad33e9e535ca6197c2e00e2dbb59bf8e8f9bb51e)]:
832 - @tanstack/db@0.1.6
833
834## 0.1.5
835
836### Patch Changes
837
838- ensure that useLiveQuery returns a stable ref when there are no changes ([#388](https://github.com/TanStack/db/pull/388))
839
840- Updated dependencies [[`9a5a20c`](https://github.com/TanStack/db/commit/9a5a20c21fbf8286ab90e1db6d6f3315f8344a4e)]:
841 - @tanstack/db@0.1.5
842
843## 0.1.4
844
845### Patch Changes
846
847- Ensure that the ready status is correctly returned from a live query ([#390](https://github.com/TanStack/db/pull/390))
848
849- Updated dependencies [[`c90b4d8`](https://github.com/TanStack/db/commit/c90b4d85822f94f7fe72286d5c7ee07b087d0e20), [`6c1c19c`](https://github.com/TanStack/db/commit/6c1c19cedbc1d9d98396948e8e43fa0515bb8919), [`69a6d2d`](https://github.com/TanStack/db/commit/69a6d2d94c7a5510568c8b652356c62bd2b3cc76), [`6250a92`](https://github.com/TanStack/db/commit/6250a92c8045ef2fd69c107a94e05179471681d7), [`68538b4`](https://github.com/TanStack/db/commit/68538b4c446abeb992e24964f811c8900749f141)]:
850 - @tanstack/db@0.1.4
851
852## 0.1.3
853
854### Patch Changes
855
856- Updated dependencies [[`0cb7699`](https://github.com/TanStack/db/commit/0cb76999e5d6df5916694a5afeb31b928eab68e4)]:
857 - @tanstack/db@0.1.3
858
859## 0.1.2
860
861### Patch Changes
862
863- Updated dependencies [[`bb5d50e`](https://github.com/TanStack/db/commit/bb5d50e255d9114ef32b8f52eef6b15399255327), [`97b595e`](https://github.com/TanStack/db/commit/97b595e9617b1abb05c14489e3d608b314da08e8)]:
864 - @tanstack/db@0.1.2
865
866## 0.1.1
867
868### Patch Changes
869
870- Updated dependencies [[`bc2f204`](https://github.com/TanStack/db/commit/bc2f204b8cb8a4870ade00757d10f846524e2090), [`bda3f24`](https://github.com/TanStack/db/commit/bda3f24cc41504f60be0c5e071698b7735f75e28)]:
871 - @tanstack/db@0.1.1
872
873## 0.1.0
874
875### Minor Changes
876
877- 0.1 release - first beta 🎉 ([#332](https://github.com/TanStack/db/pull/332))
878
879### Patch Changes
880
881- We have moved development of the differential dataflow implementation from @electric-sql/d2mini to a new @tanstack/db-ivm package inside the tanstack db monorepo to make development simpler. ([#330](https://github.com/TanStack/db/pull/330))
882
883- Updated dependencies [[`7d2f4be`](https://github.com/TanStack/db/commit/7d2f4be95c43aad29fb61e80e5a04c58c859322b), [`f0eda36`](https://github.com/TanStack/db/commit/f0eda36cb36350399bc8835686a6c4b6ad297e45)]:
884 - @tanstack/db@0.1.0
885
886## 0.0.33
887
888### Patch Changes
889
890- Updated dependencies [[`6e8d7f6`](https://github.com/TanStack/db/commit/6e8d7f660050118e050d575913733e469e3daa8c)]:
891 - @tanstack/db@0.0.33
892
893## 0.0.32
894
895### Patch Changes
896
897- Updated dependencies [[`e04bd12`](https://github.com/TanStack/db/commit/e04bd1252f612d4638104368d17cb644cc85295b)]:
898 - @tanstack/db@0.0.32
899
900## 0.0.31
901
902### Patch Changes
903
904- Updated dependencies [[`3e9a36d`](https://github.com/TanStack/db/commit/3e9a36d2600c4f700ca7bc4f720c189a5a29387a)]:
905 - @tanstack/db@0.0.31
906
907## 0.0.30
908
909### Patch Changes
910
911- Updated dependencies [[`6bdde55`](https://github.com/TanStack/db/commit/6bdde554f36f54c0c4f4dacb74bef5da45811855)]:
912 - @tanstack/db@0.0.30
913
914## 0.0.29
915
916### Patch Changes
917
918- Updated dependencies [[`ced0657`](https://github.com/TanStack/db/commit/ced0657e72646e35343dfea8389d96e213710cdf), [`dcfef51`](https://github.com/TanStack/db/commit/dcfef51d4d94c756bf77e40e7015e47b7982c09a), [`360b0df`](https://github.com/TanStack/db/commit/360b0dfa411ba9f8a93f6b737aa1df8fb37dd036), [`608be0c`](https://github.com/TanStack/db/commit/608be0c14dc5ae9577deebf436557a1eace46733), [`5260ee3`](https://github.com/TanStack/db/commit/5260ee3098d12eccc58a5cf903ea479908681402)]:
919 - @tanstack/db@0.0.29
920
921## 0.0.28
922
923### Patch Changes
924
925- Updated dependencies [[`bb85522`](https://github.com/TanStack/db/commit/bb8552210a97dd05d3ca6fdd080a3fd25c1023a6), [`e9e8e5e`](https://github.com/TanStack/db/commit/e9e8e5e20c23fb7f98865d6b8aab05ad5322e5f7)]:
926 - @tanstack/db@0.0.28
927
928## 0.0.27
929
930### Patch Changes
931
932- Updated dependencies [[`bec8620`](https://github.com/TanStack/db/commit/bec862004deef5fdd560f70107ebd59f7c27656e)]:
933 - @tanstack/db@0.0.27
934
935## 0.0.26
936
937### Patch Changes
938
939- Add initial release of TrailBase collection for TanStack DB. TrailBase is a blazingly fast, open-source alternative to Firebase built on Rust, SQLite, and V8. It provides type-safe REST and realtime APIs with sub-millisecond latencies, integrated authentication, and flexible access control - all in a single executable. This collection type enables seamless integration with TrailBase backends for high-performance real-time applications. ([#228](https://github.com/TanStack/db/pull/228))
940
941- Updated dependencies [[`09c6995`](https://github.com/TanStack/db/commit/09c6995ea9c8e6979d077ca63cbdd6215054ae78)]:
942 - @tanstack/db@0.0.26
943
944## 0.0.25
945
946### Patch Changes
947
948- Updated dependencies [[`1758eda`](https://github.com/TanStack/db/commit/1758edab9608383d9d1470156021ee632f043e51), [`20f810e`](https://github.com/TanStack/db/commit/20f810e13a7d802bf56da6f0df89b34312ebb2fd)]:
949 - @tanstack/db@0.0.25
950
951## 0.0.24
952
953### Patch Changes
954
955- Updated dependencies [[`11215d9`](https://github.com/TanStack/db/commit/11215d9544d02e9dc6258c661ba4b5e439e479ed), [`fe42591`](https://github.com/TanStack/db/commit/fe42591bd7ea9955d67ecec4471b44cb7808e74b), [`665efe6`](https://github.com/TanStack/db/commit/665efe660c1aed68139326a2a33904968622a882)]:
956 - @tanstack/db@0.0.24
957
958## 0.0.23
959
960### Patch Changes
961
962- Updated dependencies [[`056609e`](https://github.com/TanStack/db/commit/056609ed2926e12df5ee08be5fad0a6333e787f3)]:
963 - @tanstack/db@0.0.23
964
965## 0.0.22
966
967### Patch Changes
968
969- Updated dependencies [[`aeee9a1`](https://github.com/TanStack/db/commit/aeee9a13411527bd0ebfc0a0c06989bdb904b650)]:
970 - @tanstack/db@0.0.22
971
972## 0.0.21
973
974### Patch Changes
975
976- Updated dependencies [[`8e23322`](https://github.com/TanStack/db/commit/8e233229b25eabed07cdaf12948ba913786bf4f9)]:
977 - @tanstack/db@0.0.21
978
979## 0.0.20
980
981### Patch Changes
982
983- Updated dependencies [[`f13c11e`](https://github.com/TanStack/db/commit/f13c11ed0ab27cd88b03d789b0cd953e86bd1333)]:
984 - @tanstack/db@0.0.20
985
986## 0.0.19
987
988### Patch Changes
989
990- Updated dependencies [[`9f0b0c2`](https://github.com/TanStack/db/commit/9f0b0c28ede99273eb5914be28aff55b91c50778)]:
991 - @tanstack/db@0.0.19
992
993## 0.0.18
994
995### Patch Changes
996
997- Improve jsdocs ([#243](https://github.com/TanStack/db/pull/243))
998
999- Updated dependencies [[`266bd29`](https://github.com/TanStack/db/commit/266bd29514c6c0fa9e903986ca11c5e22f4d2361)]:
1000 - @tanstack/db@0.0.18
1001
1002## 0.0.17
1003
1004### Patch Changes
1005
1006- Updated dependencies [[`7e63d76`](https://github.com/TanStack/db/commit/7e63d7671f9df9f9fc81240c3818789d4ed0d464)]:
1007 - @tanstack/db@0.0.17
1008
1009## 0.0.16
1010
1011### Patch Changes
1012
1013- add support for composable queries ([#232](https://github.com/TanStack/db/pull/232))
1014
1015- Updated dependencies [[`e478d53`](https://github.com/TanStack/db/commit/e478d5353cc8fc64e3a29dda1f86fba863cf6ce8)]:
1016 - @tanstack/db@0.0.16
1017
1018## 0.0.15
1019
1020### Patch Changes
1021
1022- Updated dependencies [[`f5cf44b`](https://github.com/TanStack/db/commit/f5cf44b1b181afef89a80cf7b8678337a3d4a065), [`f5cf44b`](https://github.com/TanStack/db/commit/f5cf44b1b181afef89a80cf7b8678337a3d4a065)]:
1023 - @tanstack/db@0.0.15
1024
1025## 0.0.14
1026
1027### Patch Changes
1028
1029- Updated dependencies [[`74c140d`](https://github.com/TanStack/db/commit/74c140d8744f1f7bd3f9cb940c75719574afc78f)]:
1030 - @tanstack/db@0.0.14
1031
1032## 0.0.13
1033
1034### Patch Changes
1035
1036- feat: implement Collection Lifecycle Management ([#198](https://github.com/TanStack/db/pull/198))
1037
1038 Adds automatic lifecycle management for collections to optimize resource usage.
1039
1040 **New Features:**
1041 - Added `startSync` option (defaults to `false`, set to `true` to start syncing immediately)
1042 - Automatic garbage collection after `gcTime` (default 5 minutes) of inactivity
1043 - Collection status tracking: "idle" | "loading" | "ready" | "error" | "cleaned-up"
1044 - Manual `preload()` and `cleanup()` methods for lifecycle control
1045
1046 **Usage:**
1047
1048 ```typescript
1049 const collection = createCollection({
1050 startSync: false, // Enable lazy loading
1051 gcTime: 300000, // Cleanup timeout (default: 5 minutes)
1052 })
1053
1054 console.log(collection.status) // Current state
1055 await collection.preload() // Ensure ready
1056 await collection.cleanup() // Manual cleanup
1057 ```
1058
1059- Add createOptimisticAction helper that replaces useOptimisticMutation ([#210](https://github.com/TanStack/db/pull/210))
1060
1061 An example of converting a `useOptimisticMutation` hook to `createOptimisticAction`. Now all optimistic & server mutation logic are consolidated.
1062
1063 ```diff
1064 -import { useOptimisticMutation } from '@tanstack/react-db'
1065 +import { createOptimisticAction } from '@tanstack/react-db'
1066 +
1067 +// Create the `addTodo` action, passing in your `mutationFn` and `onMutate`.
1068 +const addTodo = createOptimisticAction<string>({
1069 + onMutate: (text) => {
1070 + // Instantly applies the local optimistic state.
1071 + todoCollection.insert({
1072 + id: uuid(),
1073 + text,
1074 + completed: false
1075 + })
1076 + },
1077 + mutationFn: async (text) => {
1078 + // Persist the todo to your backend
1079 + const response = await fetch('/api/todos', {
1080 + method: 'POST',
1081 + body: JSON.stringify({ text, completed: false }),
1082 + })
1083 + return response.json()
1084 + }
1085 +})
1086
1087 const Todo = () => {
1088 - // Create the `addTodo` mutator, passing in your `mutationFn`.
1089 - const addTodo = useOptimisticMutation({ mutationFn })
1090 -
1091 const handleClick = () => {
1092 - // Triggers the mutationFn
1093 - addTodo.mutate(() =>
1094 - // Instantly applies the local optimistic state.
1095 - todoCollection.insert({
1096 - id: uuid(),
1097 - text: '🔥 Make app faster',
1098 - completed: false
1099 - })
1100 - )
1101 + // Triggers the onMutate and then the mutationFn
1102 + addTodo('🔥 Make app faster')
1103 }
1104
1105 return <Button onClick={ handleClick } />
1106 }
1107 ```
1108
1109- Updated dependencies [[`945868e`](https://github.com/TanStack/db/commit/945868e95944543ccf5d778409548679a952e249), [`0f8a008`](https://github.com/TanStack/db/commit/0f8a008be8b368f231c8518ad1adfcac08132da2), [`57b5f5d`](https://github.com/TanStack/db/commit/57b5f5de6297326a57ef205a400428af0697b48b)]:
1110 - @tanstack/db@0.0.13
1111
1112## 0.0.12
1113
1114### Patch Changes
1115
1116- Updated dependencies [[`f6abe9b`](https://github.com/TanStack/db/commit/f6abe9b94b890487fe960bd72a89e4a75de89d46)]:
1117 - @tanstack/db@0.0.12
1118
1119## 0.0.11
1120
1121### Patch Changes
1122
1123- Export `ElectricCollectionUtils` & allow passing generic to `createTransaction` ([#179](https://github.com/TanStack/db/pull/179))
1124
1125- Updated dependencies [[`66ed58b`](https://github.com/TanStack/db/commit/66ed58b66553683ff0a5241de8cde83954d18847), [`c5489ff`](https://github.com/TanStack/db/commit/c5489ff276db07a0a4b65876790ccd7f11a6f99d)]:
1126 - @tanstack/db@0.0.11
1127
1128## 0.0.10
1129
1130### Patch Changes
1131
1132- Updated dependencies [[`38d4505`](https://github.com/TanStack/db/commit/38d45051b065b619b95849f78422e9ace8750361)]:
1133 - @tanstack/db@0.0.10
1134
1135## 0.0.9
1136
1137### Patch Changes
1138
1139- Updated dependencies [[`2ae0b09`](https://github.com/TanStack/db/commit/2ae0b09cc52152b0044818b538e11e8ca10d0f80)]:
1140 - @tanstack/db@0.0.9
1141
1142## 0.0.8
1143
1144### Patch Changes
1145
1146- A large refactor of the core `Collection` with: ([#155](https://github.com/TanStack/db/pull/155))
1147 - a change to not use Store internally and emit fine grade changes with `subscribeChanges` and `subscribeKeyChanges` methods.
1148 - changes to the `Collection` api to be more `Map` like for reads, with `get`, `has`, `size`, `entries`, `keys`, and `values`.
1149 - renames `config.getId` to `config.getKey` for consistency with the `Map` like api.
1150
1151- Updated dependencies [[`5c538cf`](https://github.com/TanStack/db/commit/5c538cf03573512a8d1bbde96962a9f7ca014708), [`9553366`](https://github.com/TanStack/db/commit/955336604a286d7992f9506cb1c76ecf150d0432), [`b4602a0`](https://github.com/TanStack/db/commit/b4602a071cb6866bb1338e30d5802220b0d1fc49), [`02adc81`](https://github.com/TanStack/db/commit/02adc813177cbb44ab6245cc9821142e9cf97876), [`06d8ecc`](https://github.com/TanStack/db/commit/06d8eccc5aaabc194c31ea89c9b4191e2aa68180), [`c50cd51`](https://github.com/TanStack/db/commit/c50cd51ac8030b391cd9d84e8cd8b8fb57cb8ca5)]:
1152 - @tanstack/db@0.0.8
1153
1154## 0.0.7
1155
1156### Patch Changes
1157
1158- Expose utilities on collection instances ([#161](https://github.com/TanStack/db/pull/161))
1159
1160 Implemented a utility exposure pattern for TanStack DB collections that allows utility functions to be passed as part of collection options and exposes them under a `.utils` namespace, with full TypeScript typing.
1161 - Refactored `createCollection` in packages/db/src/collection.ts to accept options with utilities directly
1162 - Added `utils` property to CollectionImpl
1163 - Added TypeScript types for utility functions and utility records
1164 - Changed Collection from a class to a type, updating all usages to use createCollection() instead
1165 - Updated Electric/Query implementations
1166 - Utilities are now ergonomically accessible under `.utils`
1167 - Full TypeScript typing is preserved for both collection data and utilities
1168 - API is clean and straightforward - users can call `createCollection(optionsCreator(config))` directly
1169 - Zero-boilerplate TypeScript pattern that infers utility types automatically
1170
1171- Updated dependencies [[`8b43ad3`](https://github.com/TanStack/db/commit/8b43ad305b277560aed660c31cf1409d22ed1e47)]:
1172 - @tanstack/db@0.0.7
1173
1174## 0.0.6
1175
1176### Patch Changes
1177
1178- Updated dependencies [[`856be72`](https://github.com/TanStack/db/commit/856be725a6299374a3a97c88b50bd5d7bb94b783), [`0455e27`](https://github.com/TanStack/db/commit/0455e27f50d69b1e1887b841dc2f262f4de4c55d), [`80fdac7`](https://github.com/TanStack/db/commit/80fdac76389ea741f5743bc788df375f63fb767b)]:
1179 - @tanstack/db@0.0.6
1180
1181## 0.0.5
1182
1183### Patch Changes
1184
1185- Collections must have a getId function & use an id for update/delete operators ([#134](https://github.com/TanStack/db/pull/134))
1186
1187- the `keyBy` query operator has been removed, keying withing the query pipeline is now automatic ([#144](https://github.com/TanStack/db/pull/144))
1188
1189- Updated dependencies [[`1fbb844`](https://github.com/TanStack/db/commit/1fbb8447d8425d37cb9ab4f078ffab999b28b06c), [`338efc2`](https://github.com/TanStack/db/commit/338efc229c3794da5ac373b8b26143e379433407), [`ee5d026`](https://github.com/TanStack/db/commit/ee5d026715962dd0232fcaca513a8fac9189dce2), [`e7b036c`](https://github.com/TanStack/db/commit/e7b036ce6ebd17c94cc944d6d96ca2c645921c3e), [`e4feb0c`](https://github.com/TanStack/db/commit/e4feb0c214835675b47f0aa18a72d004a423df03)]:
1190 - @tanstack/db@0.0.5
1191
1192## 0.0.4
1193
1194### Patch Changes
1195
1196- Updated dependencies [[`8ce449e`](https://github.com/TanStack/db/commit/8ce449ed6d070e9e591d1b74b0db5fed7a3fc92f)]:
1197 - @tanstack/db@0.0.4
1198
1199## 0.0.3
1200
1201### Patch Changes
1202
1203- Updated dependencies [[`b29420b`](https://github.com/TanStack/db/commit/b29420bcdae30dfeffeef63a8753b83306a54e5a)]:
1204 - @tanstack/db@0.0.3
1205
1206## 0.0.2
1207
1208### Patch Changes
1209
1210- Fixed an issue with injecting the optimistic state removal into the reactive live query. ([#78](https://github.com/TanStack/db/pull/78))
1211
1212- Updated dependencies [[`4c82edb`](https://github.com/TanStack/db/commit/4c82edb9547f26c9de44f5bf43d4385c38920672)]:
1213 - @tanstack/db@0.0.2
1214
1215## 0.0.3
1216
1217### Patch Changes
1218
1219- Make transactions first class & move ownership of mutationFn from collections to transactions ([#53](https://github.com/TanStack/db/pull/53))
1220
1221- Updated dependencies [[`b42479c`](https://github.com/TanStack/db/commit/b42479cf95f9a820b36e01684b13a9179973f3d8)]:
1222 - @tanstack/db@0.0.3
1223
1224## 0.0.2
1225
1226### Patch Changes
1227
1228- make mutationFn optional for read-only collections ([#12](https://github.com/TanStack/db/pull/12))
1229
1230- Updated dependencies [[`9bb6e89`](https://github.com/TanStack/db/commit/9bb6e8909cebdcd7c03091bfc12dd37f5ab2e1ea), [`8eb7e9b`](https://github.com/TanStack/db/commit/8eb7e9b1d1f569c5c064e0f440257589486b73cf)]:
1231 - @tanstack/db@0.0.2
1232
1233## 0.0.1
1234
1235### Patch Changes
1236
1237- feat: Initial release ([#2](https://github.com/TanStack/db/pull/2))
1238
1239- Updated dependencies [[`2d2dd77`](https://github.com/TanStack/db/commit/2d2dd7743f715ffefaeee8e8d11173b751c7043b)]:
1240 - @tanstack/db@0.0.1