Open History to see the last commit
1# @tanstack/react-db
2
3## 0.1.11
4
5### Patch Changes
6
7- 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))
8
9- Updated dependencies [[`b869f68`](https://github.com/TanStack/db/commit/b869f68f0109b3126509f202a38855cee38b4276)]:
10 - @tanstack/db@0.1.11
11
12## 0.1.10
13
14### Patch Changes
15
16- 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)]:
17 - @tanstack/db@0.1.10
18
19## 0.1.9
20
21### Patch Changes
22
23- Updated dependencies [[`d64b4a8`](https://github.com/TanStack/db/commit/d64b4a8b692a213c7ad58faaf66f5f5fd50bef66)]:
24 - @tanstack/db@0.1.9
25
26## 0.1.8
27
28### Patch Changes
29
30- 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)]:
31 - @tanstack/db@0.1.8
32
33## 0.1.7
34
35### Patch Changes
36
37- 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)]:
38 - @tanstack/db@0.1.7
39
40## 0.1.6
41
42### Patch Changes
43
44- Updated dependencies [[`ad33e9e`](https://github.com/TanStack/db/commit/ad33e9e535ca6197c2e00e2dbb59bf8e8f9bb51e)]:
45 - @tanstack/db@0.1.6
46
47## 0.1.5
48
49### Patch Changes
50
51- ensure that useLiveQuery returns a stable ref when there are no changes ([#388](https://github.com/TanStack/db/pull/388))
52
53- Updated dependencies [[`9a5a20c`](https://github.com/TanStack/db/commit/9a5a20c21fbf8286ab90e1db6d6f3315f8344a4e)]:
54 - @tanstack/db@0.1.5
55
56## 0.1.4
57
58### Patch Changes
59
60- Ensure that the ready status is correctly returned from a live query ([#390](https://github.com/TanStack/db/pull/390))
61
62- 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)]:
63 - @tanstack/db@0.1.4
64
65## 0.1.3
66
67### Patch Changes
68
69- Updated dependencies [[`0cb7699`](https://github.com/TanStack/db/commit/0cb76999e5d6df5916694a5afeb31b928eab68e4)]:
70 - @tanstack/db@0.1.3
71
72## 0.1.2
73
74### Patch Changes
75
76- Updated dependencies [[`bb5d50e`](https://github.com/TanStack/db/commit/bb5d50e255d9114ef32b8f52eef6b15399255327), [`97b595e`](https://github.com/TanStack/db/commit/97b595e9617b1abb05c14489e3d608b314da08e8)]:
77 - @tanstack/db@0.1.2
78
79## 0.1.1
80
81### Patch Changes
82
83- Updated dependencies [[`bc2f204`](https://github.com/TanStack/db/commit/bc2f204b8cb8a4870ade00757d10f846524e2090), [`bda3f24`](https://github.com/TanStack/db/commit/bda3f24cc41504f60be0c5e071698b7735f75e28)]:
84 - @tanstack/db@0.1.1
85
86## 0.1.0
87
88### Minor Changes
89
90- 0.1 release - first beta 🎉 ([#332](https://github.com/TanStack/db/pull/332))
91
92### Patch Changes
93
94- 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))
95
96- Updated dependencies [[`7d2f4be`](https://github.com/TanStack/db/commit/7d2f4be95c43aad29fb61e80e5a04c58c859322b), [`f0eda36`](https://github.com/TanStack/db/commit/f0eda36cb36350399bc8835686a6c4b6ad297e45)]:
97 - @tanstack/db@0.1.0
98
99## 0.0.33
100
101### Patch Changes
102
103- Updated dependencies [[`6e8d7f6`](https://github.com/TanStack/db/commit/6e8d7f660050118e050d575913733e469e3daa8c)]:
104 - @tanstack/db@0.0.33
105
106## 0.0.32
107
108### Patch Changes
109
110- Updated dependencies [[`e04bd12`](https://github.com/TanStack/db/commit/e04bd1252f612d4638104368d17cb644cc85295b)]:
111 - @tanstack/db@0.0.32
112
113## 0.0.31
114
115### Patch Changes
116
117- Updated dependencies [[`3e9a36d`](https://github.com/TanStack/db/commit/3e9a36d2600c4f700ca7bc4f720c189a5a29387a)]:
118 - @tanstack/db@0.0.31
119
120## 0.0.30
121
122### Patch Changes
123
124- Updated dependencies [[`6bdde55`](https://github.com/TanStack/db/commit/6bdde554f36f54c0c4f4dacb74bef5da45811855)]:
125 - @tanstack/db@0.0.30
126
127## 0.0.29
128
129### Patch Changes
130
131- 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)]:
132 - @tanstack/db@0.0.29
133
134## 0.0.28
135
136### Patch Changes
137
138- Updated dependencies [[`bb85522`](https://github.com/TanStack/db/commit/bb8552210a97dd05d3ca6fdd080a3fd25c1023a6), [`e9e8e5e`](https://github.com/TanStack/db/commit/e9e8e5e20c23fb7f98865d6b8aab05ad5322e5f7)]:
139 - @tanstack/db@0.0.28
140
141## 0.0.27
142
143### Patch Changes
144
145- Updated dependencies [[`bec8620`](https://github.com/TanStack/db/commit/bec862004deef5fdd560f70107ebd59f7c27656e)]:
146 - @tanstack/db@0.0.27
147
148## 0.0.26
149
150### Patch Changes
151
152- 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))
153
154- Updated dependencies [[`09c6995`](https://github.com/TanStack/db/commit/09c6995ea9c8e6979d077ca63cbdd6215054ae78)]:
155 - @tanstack/db@0.0.26
156
157## 0.0.25
158
159### Patch Changes
160
161- Updated dependencies [[`1758eda`](https://github.com/TanStack/db/commit/1758edab9608383d9d1470156021ee632f043e51), [`20f810e`](https://github.com/TanStack/db/commit/20f810e13a7d802bf56da6f0df89b34312ebb2fd)]:
162 - @tanstack/db@0.0.25
163
164## 0.0.24
165
166### Patch Changes
167
168- 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)]:
169 - @tanstack/db@0.0.24
170
171## 0.0.23
172
173### Patch Changes
174
175- Updated dependencies [[`056609e`](https://github.com/TanStack/db/commit/056609ed2926e12df5ee08be5fad0a6333e787f3)]:
176 - @tanstack/db@0.0.23
177
178## 0.0.22
179
180### Patch Changes
181
182- Updated dependencies [[`aeee9a1`](https://github.com/TanStack/db/commit/aeee9a13411527bd0ebfc0a0c06989bdb904b650)]:
183 - @tanstack/db@0.0.22
184
185## 0.0.21
186
187### Patch Changes
188
189- Updated dependencies [[`8e23322`](https://github.com/TanStack/db/commit/8e233229b25eabed07cdaf12948ba913786bf4f9)]:
190 - @tanstack/db@0.0.21
191
192## 0.0.20
193
194### Patch Changes
195
196- Updated dependencies [[`f13c11e`](https://github.com/TanStack/db/commit/f13c11ed0ab27cd88b03d789b0cd953e86bd1333)]:
197 - @tanstack/db@0.0.20
198
199## 0.0.19
200
201### Patch Changes
202
203- Updated dependencies [[`9f0b0c2`](https://github.com/TanStack/db/commit/9f0b0c28ede99273eb5914be28aff55b91c50778)]:
204 - @tanstack/db@0.0.19
205
206## 0.0.18
207
208### Patch Changes
209
210- Improve jsdocs ([#243](https://github.com/TanStack/db/pull/243))
211
212- Updated dependencies [[`266bd29`](https://github.com/TanStack/db/commit/266bd29514c6c0fa9e903986ca11c5e22f4d2361)]:
213 - @tanstack/db@0.0.18
214
215## 0.0.17
216
217### Patch Changes
218
219- Updated dependencies [[`7e63d76`](https://github.com/TanStack/db/commit/7e63d7671f9df9f9fc81240c3818789d4ed0d464)]:
220 - @tanstack/db@0.0.17
221
222## 0.0.16
223
224### Patch Changes
225
226- add support for composable queries ([#232](https://github.com/TanStack/db/pull/232))
227
228- Updated dependencies [[`e478d53`](https://github.com/TanStack/db/commit/e478d5353cc8fc64e3a29dda1f86fba863cf6ce8)]:
229 - @tanstack/db@0.0.16
230
231## 0.0.15
232
233### Patch Changes
234
235- Updated dependencies [[`f5cf44b`](https://github.com/TanStack/db/commit/f5cf44b1b181afef89a80cf7b8678337a3d4a065), [`f5cf44b`](https://github.com/TanStack/db/commit/f5cf44b1b181afef89a80cf7b8678337a3d4a065)]:
236 - @tanstack/db@0.0.15
237
238## 0.0.14
239
240### Patch Changes
241
242- Updated dependencies [[`74c140d`](https://github.com/TanStack/db/commit/74c140d8744f1f7bd3f9cb940c75719574afc78f)]:
243 - @tanstack/db@0.0.14
244
245## 0.0.13
246
247### Patch Changes
248
249- feat: implement Collection Lifecycle Management ([#198](https://github.com/TanStack/db/pull/198))
250
251 Adds automatic lifecycle management for collections to optimize resource usage.
252
253 **New Features:**
254 - Added `startSync` option (defaults to `false`, set to `true` to start syncing immediately)
255 - Automatic garbage collection after `gcTime` (default 5 minutes) of inactivity
256 - Collection status tracking: "idle" | "loading" | "ready" | "error" | "cleaned-up"
257 - Manual `preload()` and `cleanup()` methods for lifecycle control
258
259 **Usage:**
260
261 ```typescript
262 const collection = createCollection({
263 startSync: false, // Enable lazy loading
264 gcTime: 300000, // Cleanup timeout (default: 5 minutes)
265 })
266
267 console.log(collection.status) // Current state
268 await collection.preload() // Ensure ready
269 await collection.cleanup() // Manual cleanup
270 ```
271
272- Add createOptimisticAction helper that replaces useOptimisticMutation ([#210](https://github.com/TanStack/db/pull/210))
273
274 An example of converting a `useOptimisticMutation` hook to `createOptimisticAction`. Now all optimistic & server mutation logic are consolidated.
275
276 ```diff
277 -import { useOptimisticMutation } from '@tanstack/react-db'
278 +import { createOptimisticAction } from '@tanstack/react-db'
279 +
280 +// Create the `addTodo` action, passing in your `mutationFn` and `onMutate`.
281 +const addTodo = createOptimisticAction<string>({
282 + onMutate: (text) => {
283 + // Instantly applies the local optimistic state.
284 + todoCollection.insert({
285 + id: uuid(),
286 + text,
287 + completed: false
288 + })
289 + },
290 + mutationFn: async (text) => {
291 + // Persist the todo to your backend
292 + const response = await fetch('/api/todos', {
293 + method: 'POST',
294 + body: JSON.stringify({ text, completed: false }),
295 + })
296 + return response.json()
297 + }
298 +})
299
300 const Todo = () => {
301 - // Create the `addTodo` mutator, passing in your `mutationFn`.
302 - const addTodo = useOptimisticMutation({ mutationFn })
303 -
304 const handleClick = () => {
305 - // Triggers the mutationFn
306 - addTodo.mutate(() =>
307 - // Instantly applies the local optimistic state.
308 - todoCollection.insert({
309 - id: uuid(),
310 - text: '🔥 Make app faster',
311 - completed: false
312 - })
313 - )
314 + // Triggers the onMutate and then the mutationFn
315 + addTodo('🔥 Make app faster')
316 }
317
318 return <Button onClick={ handleClick } />
319 }
320 ```
321
322- 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)]:
323 - @tanstack/db@0.0.13
324
325## 0.0.12
326
327### Patch Changes
328
329- Updated dependencies [[`f6abe9b`](https://github.com/TanStack/db/commit/f6abe9b94b890487fe960bd72a89e4a75de89d46)]:
330 - @tanstack/db@0.0.12
331
332## 0.0.11
333
334### Patch Changes
335
336- Export `ElectricCollectionUtils` & allow passing generic to `createTransaction` ([#179](https://github.com/TanStack/db/pull/179))
337
338- Updated dependencies [[`66ed58b`](https://github.com/TanStack/db/commit/66ed58b66553683ff0a5241de8cde83954d18847), [`c5489ff`](https://github.com/TanStack/db/commit/c5489ff276db07a0a4b65876790ccd7f11a6f99d)]:
339 - @tanstack/db@0.0.11
340
341## 0.0.10
342
343### Patch Changes
344
345- Updated dependencies [[`38d4505`](https://github.com/TanStack/db/commit/38d45051b065b619b95849f78422e9ace8750361)]:
346 - @tanstack/db@0.0.10
347
348## 0.0.9
349
350### Patch Changes
351
352- Updated dependencies [[`2ae0b09`](https://github.com/TanStack/db/commit/2ae0b09cc52152b0044818b538e11e8ca10d0f80)]:
353 - @tanstack/db@0.0.9
354
355## 0.0.8
356
357### Patch Changes
358
359- A large refactor of the core `Collection` with: ([#155](https://github.com/TanStack/db/pull/155))
360 - a change to not use Store internally and emit fine grade changes with `subscribeChanges` and `subscribeKeyChanges` methods.
361 - changes to the `Collection` api to be more `Map` like for reads, with `get`, `has`, `size`, `entries`, `keys`, and `values`.
362 - renames `config.getId` to `config.getKey` for consistency with the `Map` like api.
363
364- 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)]:
365 - @tanstack/db@0.0.8
366
367## 0.0.7
368
369### Patch Changes
370
371- Expose utilities on collection instances ([#161](https://github.com/TanStack/db/pull/161))
372
373 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.
374 - Refactored `createCollection` in packages/db/src/collection.ts to accept options with utilities directly
375 - Added `utils` property to CollectionImpl
376 - Added TypeScript types for utility functions and utility records
377 - Changed Collection from a class to a type, updating all usages to use createCollection() instead
378 - Updated Electric/Query implementations
379 - Utilities are now ergonomically accessible under `.utils`
380 - Full TypeScript typing is preserved for both collection data and utilities
381 - API is clean and straightforward - users can call `createCollection(optionsCreator(config))` directly
382 - Zero-boilerplate TypeScript pattern that infers utility types automatically
383
384- Updated dependencies [[`8b43ad3`](https://github.com/TanStack/db/commit/8b43ad305b277560aed660c31cf1409d22ed1e47)]:
385 - @tanstack/db@0.0.7
386
387## 0.0.6
388
389### Patch Changes
390
391- 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)]:
392 - @tanstack/db@0.0.6
393
394## 0.0.5
395
396### Patch Changes
397
398- Collections must have a getId function & use an id for update/delete operators ([#134](https://github.com/TanStack/db/pull/134))
399
400- the `keyBy` query operator has been removed, keying withing the query pipeline is now automatic ([#144](https://github.com/TanStack/db/pull/144))
401
402- 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)]:
403 - @tanstack/db@0.0.5
404
405## 0.0.4
406
407### Patch Changes
408
409- Updated dependencies [[`8ce449e`](https://github.com/TanStack/db/commit/8ce449ed6d070e9e591d1b74b0db5fed7a3fc92f)]:
410 - @tanstack/db@0.0.4
411
412## 0.0.3
413
414### Patch Changes
415
416- Updated dependencies [[`b29420b`](https://github.com/TanStack/db/commit/b29420bcdae30dfeffeef63a8753b83306a54e5a)]:
417 - @tanstack/db@0.0.3
418
419## 0.0.2
420
421### Patch Changes
422
423- Fixed an issue with injecting the optimistic state removal into the reactive live query. ([#78](https://github.com/TanStack/db/pull/78))
424
425- Updated dependencies [[`4c82edb`](https://github.com/TanStack/db/commit/4c82edb9547f26c9de44f5bf43d4385c38920672)]:
426 - @tanstack/db@0.0.2
427
428## 0.0.3
429
430### Patch Changes
431
432- Make transactions first class & move ownership of mutationFn from collections to transactions ([#53](https://github.com/TanStack/db/pull/53))
433
434- Updated dependencies [[`b42479c`](https://github.com/TanStack/db/commit/b42479cf95f9a820b36e01684b13a9179973f3d8)]:
435 - @tanstack/db@0.0.3
436
437## 0.0.2
438
439### Patch Changes
440
441- make mutationFn optional for read-only collections ([#12](https://github.com/TanStack/db/pull/12))
442
443- Updated dependencies [[`9bb6e89`](https://github.com/TanStack/db/commit/9bb6e8909cebdcd7c03091bfc12dd37f5ab2e1ea), [`8eb7e9b`](https://github.com/TanStack/db/commit/8eb7e9b1d1f569c5c064e0f440257589486b73cf)]:
444 - @tanstack/db@0.0.2
445
446## 0.0.1
447
448### Patch Changes
449
450- feat: Initial release ([#2](https://github.com/TanStack/db/pull/2))
451
452- Updated dependencies [[`2d2dd77`](https://github.com/TanStack/db/commit/2d2dd7743f715ffefaeee8e8d11173b751c7043b)]:
453 - @tanstack/db@0.0.1