Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

CHANGELOG.md

430 lines16.7 KB

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