@tanstack/vue-db#
1.0.0-rc.1#
Major Changes#
Release the first 1.0 candidate. Remove deprecated pre-1.0 APIs and give (#2171) published row metadata precedence over colliding selected fields. Structured source spreads and direct source-row returns keep source attribution; new functional objects and other projections receive output Collection metadata. Keep the two packages accidentally released as stable 1.x on their stable release lines. Both stable minor releases require
@tanstack/db@^1.0.0-rc.0for the RC health and restoration settlement APIs; upgrade DB with them.Remove Query Collection’s automatic refetch after mutation handlers. Handlers return
Promise<void>and must awaitcollection.utils.refetch()or write confirmed data with thewrite*utilities;{ refetch: false }is removed.
Minor Changes#
Collections now answer two questions separately: can the data be shown (
status), and is it still kept up to date (health). Once a query has shown data, a network or backend failure never takes it off the screen. (#2168)statusgainscrashed: local storage broke (a closed IndexedDB connection, a failed SQLite persistence write or restore, a throwing sync function, or an invariant failure). Nothing recovers it in place, andreload()rejects. To recover, callcleanup({ dependents: true }), then start the Collection again (for example withpreload()); it starts with no rows. It reaches every live query and Effect above it.errornow means only "the first load failed".- Every Collection has
collection.health, a health node withstatus,failureReason(the adapter is still trying),error(the adapter stopped, or the first load failed),reloading, andhasErrors. A live query'shealthhas one node per source alias, in query order, and keeps object identity while unchanged.health:changefires when it changes.findProblems(health)lists the nodes that have a problem, in query order. Each problem (HealthProblem) shows its newest failure inmessage,cause, andat, and lists every failure still open inerrors, oldest first: eachreportError()of the sync run untilreportHealthy(), or each failed request for more data on a live query's node. One error value is one failure: reporting it again changes nothing, andreportHealthy(error)removes just that failure, so a query Collection whose failing Query recovers removes only that Query's failures. After a live query is ready, a failed request for more data (a page, a joined row, or a source reload's replay of its data) is anerroron the query's own node; the source stays healthy. collection.reload()starts a new sync run and keeps the rows, status, and error on screen until the reload completes: when the new run's snapshot (begin({ snapshot: true })) ortruncate()applies, or at itsmarkReady(), which keeps the rows when no snapshot came. On a live query it reloads every Collection below it that shows anerror, through nested live queries, then the query itself when its own node has anerror, including a failed request for more data. It rejects on acrashedCollection. When the cleanup of the sync run that a reload retired rejects, the Collection crashes, also if the rejection comes later. A query inerrorstays there until itsreload().cleanup()rejects withCollectionHasSubscribersErrorwhile a live query with subscribers or an Effect reads the Collection.cleanup({ dependents: true })ends them first.collection.subscriberslists every dependent.- A local-only Collection's
reload()keeps its rows, including the user's writes:initialDataloads only when the Collection starts, or starts again after cleanup. - Persisted Collections have one status. With
initialRender: { strategy: 'network-first' }, restored rows make the Collectionreadyonce the deadline passes or the remote fails; an empty restore staysloading. Only a local storage failure crashes a persisted Collection: a failed remote subset request is a failure reason, which the next successful remote request clears.
Breaking changes and migration:
Before After hook isErrorisLoadingError(first load failed) orisCrashed— isSyncError:readyand the health tree has a problemstatus: 'error'after a crashstatus: 'crashed'adapter markError(error)fail(error). After readiness it sets the node'serrorand keeps the rows. Later calls throw.cleanup()thenpreload()to recoverreload()adapter begin({ direct: true })begin(): every write applies on the rows the Collection holds, also during a reloada reload's first commit replaced every row begin({ snapshot: true })ortruncate()in the new run replaces themadapter markReady()afterfail()threwit does nothing cleanup()while live queries or Effects read the Collectionrejects; unmount first or pass { dependents: true }persistedStatus,isPersistedReady,persistedError,preloadForInitialRender(),PERSISTED_READINESSstatusandhealthquery-db utils.lastError,utils.isError,utils.errorCount,utils.clearError()collection.health,reload()infinite-query hooks' error(React, Preact, Vue, Svelte)the root node's errorinhealth;fetchNextPage()still resolvesCustom sync adapters: keep the run's readiness in your
syncfunction. A reload callssyncagain whilecollection.statusstill shows the previous run's status and the Collection still holds the previous run's rows. The new run's writes apply on those rows; it replaces every row only with a snapshot, a transaction begun withbegin({ snapshot: true }), or with its owntruncate(). The reload completes when that replacement applies, or at the new run'smarkReady(), which keeps the rows when no snapshot came. So send the new run's full state as a snapshot, or write against the kept rows: aninsertof a key the Collection holds throwsDuplicateKeySyncError, during a reload as at any time, so writeupdatefor a kept row, also from a replayed load after the reload completed. A reload keeps every row its new run does not rewrite: core never deletes kept rows on its own, so removing a row the backend deleted is the adapter's job, through a snapshot, adelete, or row ownership (#2269). An on-demandloadSubsetresult is partial and is never a snapshot. A live query's own reload keeps its rows and its window until its new run's result is complete.reportError()andreportHealthy()throw before the firstmarkReady()and afterfail().markReady()after the run is ready, or after itsfail(), does nothing, so an adapter needs no flag of its own to guard it. A secondfail()in the same sync run does nothing. A first-ready callback that throws whilesyncruns is reported uncaught, and the Collection stays ready.reload()called from insidesyncor aloadSubsetcall rejects, unless a reload is already in flight, whose promise it returns. Calls after a crash do nothing. For an on-demand Collection, a reload aborts the retired run'sloadSubsetcalls and asks the new run'sloadSubsetfor the current demand as soon assyncreturns. Honor thesignal: when core aborts a load, that load is over for core, and its later resolve or reject decides nothing, holds no readiness, and no replay waits for it. AloadSubsetthat throws synchronously is a rejection: a failed load, whichrequestSnapshot()andsetWindow()report without throwing. A truncate's or reload's replay decides every request error of the query's demand: its success clears them all, and its failure replaces them with the replay's failures.useLiveSuspenseQuerynow throws an Error for a failed first load or a crash: the cause itself when it is an Error, otherwise an Error with the problem's message whosecauseholds the reported value.
Patch Changes#
Breaking: grouping, includes, and pooling are now opt-in. An app bundles an operator's code only when it imports the value for that operator. Joins do not change. A typical app is about 8 kB smaller after gzip. This app has a query collection, a filtered live query, and React
useLiveQuery. (#2232)- An include needs
include(),toArray(), ormaterialize(). Changeissues: q.from(...)inselect()toissues: include(q.from(...)). A subquery inselect()without one of these throwsIncludeOperatorRequiredError. - Aggregates such as
count()need no change. AgroupBywith no aggregate takesgroupKeys():.groupBy(groupKeys(({ todo }) => todo.status)). Without it, the query throwsGroupingOperatorRequiredError. - Hooks do not pool live queries by default. To share one partition among many equality-filtered queries, pass
pool: pooledLiveQueriesin the hook's query config:useLiveQuery({ query, pool: pooledLiveQueries }). Results do not change. Angular's{ params, query }form takespoolthe same way. Any otherpoolvalue, such as the old boolean, throwsInvalidPoolOptionError, also for a disabled query. For adapter authors: thepooloption ofresolveLiveQueryValueis nowpooledLiveQueriesorfalse, not a boolean. An adapter that readspoolfrom its own options checks it withconfigPoolfirst. - Code that builds query IR by hand must supply the operator code.
IR.AggregatetakesgroupingCompileras its third argument.IR.IncludesSubquerytakesincludesRuntimeas its fifth argument, beforeparentFilters. Import both from@tanstack/db. IR without them throwsGroupingOperatorRequiredErrororIncludeOperatorRequiredErrorwhen it compiles, unless another aggregate orgroupKeys()in the query supplies the grouping compiler. Queries that the query builder builds need no change. - Operator code is part of query identity. A hook that re-renders a grouped query without
groupKeys()now throwsGroupingOperatorRequiredError. Before, React and Preact kept the grouped query. - Vue: when a changed query fails to compile,
useLiveQueryno longer shows the rows of the previous query.
- An include needs
useLiveInfiniteQuerynow uses the shared window binding from@tanstack/db. A window collection it creates starts syncing when the query compiles, as in the other adapters, and an update that changes nothing keeps the current controller. (#2235)Updated dependencies [
5649a07,43d4ef6,7538afd,a07cd73,6c1ca8f,30175be,4c39add,1640de8,367ea7c,7d9ed02,45eeef8]:- @tanstack/db@1.0.0-rc.1
0.3.12#
Patch Changes#
0.3.11#
Patch Changes#
Retire adapter-created live-query collections after their final subscriber leaves. Treat an undefined
gcTimeas omitted, preserve explicit values and caller-supplied collections, and retain Solid projections while their Suspense boundary is pending. (#2172)Updated dependencies [
468db85,3c481f6,a09ba67,92b11b0,fcd539a,2c83fdc]:- @tanstack/db@0.15.1
0.3.10#
Patch Changes#
0.3.9#
Patch Changes#
- Updated dependencies [
cda9d6a,2f928e6,dfec42e,1a65c2c,1b4ee8d,bbbf017,bc6f30e,fade2e2,bbe9327,b34a579,6fa60aa,f84387c,be4a3d6,0dc696a,fd13e3c]:- @tanstack/db@0.14.0
0.3.8#
Patch Changes#
- Updated dependencies [
f6aba31,faa3de6,bcb2af6,2ab7f3e,86f00ea,f7ac2c6,fa36267,2c98b49,f6d65ea,fe284cc,8b0e1de,4bd66cf]:- @tanstack/db@0.13.0
0.3.7#
Patch Changes#
- Updated dependencies [
487c5a6]:- @tanstack/db@0.12.3
0.3.6#
Patch Changes#
0.3.5#
Patch Changes#
Build a live query's keyed
statemap only when code reads it. Most callers read onlydata, so an update no longer builds a second copy of the results: (#2043)- The shared live query snapshot and the infinite query window build
stateon first read. useLiveInfiniteQueryin React readsstateonly when your code reads it.- Vue and Svelte
useLiveQuerybuild theirdataarray from the snapshot's ordered rows instead of fromstate.
A retained snapshot still shows the rows from the time it was built.
- The shared live query snapshot and the infinite query window build
Updated dependencies [
d029833,aa1b58e,c3a4e4a,2376eb5,a37e69a,d029833,d029833,de8d0f1]:- @tanstack/db@0.12.1
0.3.4#
Patch Changes#
0.3.3#
Patch Changes#
- Updated dependencies [
06cab6f]:- @tanstack/db@0.11.3
0.3.2#
Patch Changes#
Mount and update many small filtered live queries at Redux-level cost. A live query that reads one eager source Collection, filters it by at least one
eq(field, literal), and has no clause besideswhereand anorderByon its own fields is served from an equality partition shared by every query on those fields, in React, Vue, Solid, Svelte, and Angular. Its otherwhereconditions on the row, such asnot,gt, orlike, are evaluated per query over its group. This applies to a query function, a query builder, and a{ query }config that sets no other option besidesqueryKeyorgcTime. Queries with aDbClient(React, Svelte) or React Suspense keep a live-query Collection. Each query reads its group of rows instead of compiling a live query and subscribing to the source. With 240 such queries in React, mounting takes about 2.3 ms instead of 8.2 ms, and is the same with or without an index. (#1987)Results are unchanged: the same rows in the same order with the same values and status, including a terminal error when the source is cleaned up. Two things can differ. Rows are the source Collection's row objects rather than copies. The returned
collectionis built only when your code reads it, so its automatic id may differ, and tools that list live Collections do not see a pooled query until then.Updated dependencies [
dac687d,dac687d,dac687d,dac687d,7595a2d,dac687d,dac687d,8be6705]:- @tanstack/db@0.11.2
0.3.1#
Patch Changes#
- Updated dependencies [
a18f63d,e706483,18abcee,d2690bf,5b85af0,1dbf5f9,7ab48d8,d2690bf,7ca38db,f2f92c5]:- @tanstack/db@0.11.1
0.3.0#
Minor Changes#
- Add opt-in network-first initial rendering for eagerly persisted SQLite Collections.
initialRender: { strategy: 'network-first', networkTimeoutMs }lets React and Solid Suspense render restored rows after the configured deadline (three seconds by default) or a network failure while sync continues. Live-query observers and the Angular, React, Solid, Svelte, and Vue integrations exposepersistedStatus,isPersistedReady, andpersistedErrorseparately from Collection readiness. (#1955)
Patch Changes#
Publish one coherent live-query data snapshot to synchronous Vue watchers. Propagate query errors even when their text matches the disabled-query marker. A saved
data.valuearray no longer receives later row-list changes; readdata.valueagain for the latest rows. (#1943)Updated dependencies [
9c62ac3,d5e4732,0122da8,f7d96f7,fb509ef,dc4b4e0,f158258,c879ba6,b5d92ce]:- @tanstack/db@0.11.0
0.2.2#
Patch Changes#
- Preserve pre-created collection row, key, and utility types in React infinite (#1864) queries. Align conditional live-query result types with each framework's disabled representation, including nullable collections, disabled statuses, and empty single-result data in the empty-reactive bindings.
- Updated dependencies [
2ad6834,b528a61,84fc44b,9351f46,5108acf,afbeb44,2775082,fef53f8,b44a50a,19dd9a2,3096b8f,1ab1cd3,e5fe2ea,3eb5b2b,7c62bf5,63362dc,7f6b643,c479fdc,91a2cbf,144c6b1,5218f0c,76d766e,1e54c6a,d698b90,04a1a81,3ad64a4,4c5a8de,b72b5d1,fc1adde,2781581,40a5aea,e16d46c,9cbc885,23ae52d,7917ef9,1ca838b,34a999d,825acc5,febd4bc,b7a7d10,510cb53,efb84d8,236d77b,71ad428]:- @tanstack/db@0.10.0
0.2.1#
Patch Changes#
- Updated dependencies [
3c4c35d]:- @tanstack/db@0.9.2
0.2.0#
Minor Changes#
- Remove the ignored
getNextPageParamoption fromuseLiveInfiniteQueryand reject it with a clear error when passed at runtime. Delete this callback from your config; for server pagination, use an on-demand Query Collection whosequeryFnfulfillsmeta.loadSubsetOptions. Document fixed-server-page loading and clarify thatinitialPageParamlabels result pages rather than setting a server cursor. (#1806)
Patch Changes#
0.1.10#
Patch Changes#
- Updated dependencies [
cfb01ce]:- @tanstack/db@0.9.0
0.1.9#
Patch Changes#
- Updated dependencies [
bbc9edf]:- @tanstack/db@0.8.7
0.1.8#
Patch Changes#
- Updated dependencies [
ae2fe74]:- @tanstack/db@0.8.6
0.1.7#
Patch Changes#
0.1.6#
Patch Changes#
0.1.5#
Patch Changes#
0.1.4#
Patch Changes#
- Updated dependencies [
c521b5d]:- @tanstack/db@0.8.2
0.1.3#
Patch Changes#
0.1.2#
Patch Changes#
- Updated dependencies [
4b9e8cd]:- @tanstack/db@0.8.0
0.1.1#
Patch Changes#
Update agent skills to match current APIs and behavior. (#1696)
Updated dependencies [
5f63996]:- @tanstack/db@0.7.2
0.1.0#
Minor Changes#
- Add
useLiveInfiniteQueryas a Vue binding over the shared live-query window controller. Align infinite-query behavior across React, Vue, and Svelte, including awaitable page fetches, safe page sizes, reactive page-depth preservation, ordered collection validation, shared input resolution, and shared-window cleanup. (#1724)
Patch Changes#
- Updated dependencies [
424382b]:- @tanstack/db@0.7.1
0.0.129#
Patch Changes#
Add an internal shared live-query observer and migrate all five framework adapters to it (#1642)
Introduces
createLiveQueryObserverin@tanstack/db: given a resolved live-query collection (ornullfor a disabled query) it owns the subscription lifecycle every adapter used to re-implement — change and status subscriptions, a snapshot with stable identity per state revision for wholesale consumers, and delivery of the rawChangeMessage[]for granular consumers. React, Vue, Svelte, Solid, and Angular's live-query hooks now materialize from the observer instead of their own hand-rolled subscription/status/snapshot machinery, keeping each adapter's native reactivity and each adapter's data-loading policy (wholesale adapters subscribe without initial state; granular adapters seed from it).The observer is an internal, unstable contract for TanStack DB's official adapters — it is exported so the adapter packages can consume it, but it is not a public extension point yet and its API may change in any release.
The migration also fixes several live-query lifecycle defects: status-only transitions (
error,cleaned-up) now reach mounted consumers; snapshot identity is stable across unsubscribe/resubscribe and stays fresh while detached; dispatch is FIFO and non-reentrant with subscriptions identified by record rather than callback; disposing during the synchronous initial replay no longer leaks the collection subscription; subscribing after dispose throws instead of registering a dead listener; Solid guards its async resource continuations against superseded collections; and constructing an observer no longer activates sync. Observers activate on their first committed subscription unless an adapter has already started a pre-created collection supplied directly or returned from a callback.Updated dependencies [
ad88d07,7e7abda,dc53f0e]:- @tanstack/db@0.7.0
0.0.128#
Patch Changes#
- Updated dependencies [
8ee783d]:- @tanstack/db@0.6.17
0.0.127#
Patch Changes#
0.0.126#
Patch Changes#
Extract shared live-query adapter helpers into
@tanstack/db(#1641)Adds
isCollection,isSingleResultCollection, andgetLiveQueryStatusFlagsto@tanstack/dband migrates all five framework adapters to use them.isCollectionreplaces the per-adapter duck-typing and Solid'sinstanceof CollectionImplwith one structural, multi-realm-safe guard (theinstanceofform gave false negatives across dual-package boundaries). No behavior change; internal deduplication only.Updated dependencies [
eabcea7,6d4c096]:- @tanstack/db@0.6.15
0.0.125#
Patch Changes#
- Updated dependencies [
397e12a]:- @tanstack/db@0.6.14
0.0.124#
Patch Changes#
0.0.123#
Patch Changes#
- Updated dependencies [
2b27dd1]:- @tanstack/db@0.6.12
0.0.122#
Patch Changes#
0.0.121#
Patch Changes#
- Updated dependencies [
307fdf8]:- @tanstack/db@0.6.10
0.0.120#
Patch Changes#
0.0.119#
Patch Changes#
- Updated dependencies [
3827b62]:- @tanstack/db@0.6.8
0.0.118#
Patch Changes#
0.0.117#
Patch Changes#
- Updated dependencies [
4e9ab39]:- @tanstack/db@0.6.6
0.0.116#
Patch Changes#
0.0.115#
Patch Changes#
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)
Updated dependencies [
1e69dd6]:- @tanstack/db@0.6.4
0.0.114#
Patch Changes#
0.0.113#
Patch Changes#
0.0.112#
Patch Changes#
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)
Updated dependencies [
8b7fb1a]:- @tanstack/db@0.6.1
0.0.111#
Patch Changes#
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/store0.9.x API which returnsSubscriptionobjects instead of unsubscribe functions. (#1381)Updated dependencies [
f60384b,b8abc02,09c7afc,bb09eb1,179d666,43ecbfa,055fd94,055fd94,055fd94,055fd94,85f5435,b65d8f7,e0df07e,9952921,d351c67]:- @tanstack/db@0.6.0
0.0.110#
Patch Changes#
- Updated dependencies [
c3e6a96]:- @tanstack/db@0.5.33
0.0.109#
Patch Changes#
0.0.108#
Patch Changes#
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)Updated dependencies [
bf1d078]:- @tanstack/db@0.5.31
0.0.107#
Patch Changes#
- Updated dependencies [
e9d0fd8]:- @tanstack/db@0.5.30
0.0.106#
Patch Changes#
0.0.105#
Patch Changes#
- Updated dependencies [
46450e7]:- @tanstack/db@0.5.28
0.0.104#
Patch Changes#
0.0.103#
Patch Changes#
0.0.102#
Patch Changes#
0.0.101#
Patch Changes#
- Updated dependencies [
7099459]:- @tanstack/db@0.5.24
0.0.100#
Patch Changes#
- Updated dependencies [
05130f2]:- @tanstack/db@0.5.23
0.0.99#
Patch Changes#
- Updated dependencies [
f9b741e]:- @tanstack/db@0.5.22
0.0.98#
Patch Changes#
0.0.97#
Patch Changes#
- Fix type of findOne queries in Vue such that they type to a singular result instead of an array of results. (#1134)
0.0.96#
Patch Changes#
- Updated dependencies []:
- @tanstack/db@0.5.20
0.0.95#
Patch Changes#
0.0.94#
Patch Changes#
- Updated dependencies [
c1247e8]:- @tanstack/db@0.5.18
0.0.93#
Patch Changes#
0.0.92#
Patch Changes#
- Updated dependencies [
41308b8]:- @tanstack/db@0.5.16
0.0.91#
Patch Changes#
- Updated dependencies [
32ec4d8]:- @tanstack/db@0.5.15
0.0.90#
Patch Changes#
- Updated dependencies [
26ed0aa]:- @tanstack/db@0.5.14
0.0.89#
Patch Changes#
0.0.88#
Patch Changes#
0.0.87#
Patch Changes#
Fixed
isReadyto returntruefor disabled queries inuseLiveQuery/injectLiveQueryacross all framework packages. When a query function returnsnullorundefined(disabling the query), there's no async operation to wait for, so the hook should be considered "ready" immediately. (#886)Additionally, all frameworks now have proper TypeScript overloads that explicitly support returning
undefined | nullfrom query functions, making the disabled query pattern type-safe.This fixes the common pattern where users conditionally enable queries and don't want to show loading states when the query is disabled.
Updated dependencies [
c4b9399,a1a484e]:- @tanstack/db@0.5.11
0.0.86#
Patch Changes#
0.0.85#
Patch Changes#
- Updated dependencies [
5f474f1]:- @tanstack/db@0.5.9
0.0.84#
Patch Changes#
0.0.83#
Patch Changes#
- Updated dependencies [
295cb45]:- @tanstack/db@0.5.7
0.0.82#
Patch Changes#
- Updated dependencies [
c8a2c16]:- @tanstack/db@0.5.6
0.0.81#
Patch Changes#
- Updated dependencies [
077fc1a]:- @tanstack/db@0.5.5
0.0.80#
Patch Changes#
0.0.79#
Patch Changes#
0.0.78#
Patch Changes#
- Updated dependencies [
99a3716]:- @tanstack/db@0.5.2
0.0.77#
Patch Changes#
- Updated dependencies [
a83a818]:- @tanstack/db@0.5.1
0.0.76#
Patch Changes#
- Updated dependencies [
243a35a,f9d11fc,7aedf12,28f81b5,28f81b5,f6ac7ea,01093a7]:- @tanstack/db@0.5.0
0.0.75#
Patch Changes#
0.0.74#
Patch Changes#
- Updated dependencies [
75470a8]:- @tanstack/db@0.4.19
0.0.73#
Patch Changes#
0.0.72#
Patch Changes#
- Updated dependencies [
49bcaa5]:- @tanstack/db@0.4.17
0.0.71#
Patch Changes#
0.0.70#
Patch Changes#
- Updated dependencies [
6738247]:- @tanstack/db@0.4.15
0.0.69#
Patch Changes#
- Updated dependencies [
970616b]:- @tanstack/db@0.4.14
0.0.68#
Patch Changes#
- Updated dependencies [
3c9526c]:- @tanstack/db@0.4.13
0.0.67#
Patch Changes#
0.0.66#
Patch Changes#
- Updated dependencies [
5566b26]:- @tanstack/db@0.4.11
0.0.65#
Patch Changes#
0.0.64#
Patch Changes#
0.0.63#
Patch Changes#
0.0.62#
Patch Changes#
- Updated dependencies [
6692aad]:- @tanstack/db@0.4.7
0.0.61#
Patch Changes#
0.0.60#
Patch Changes#
- Updated dependencies [
7556fb6]:- @tanstack/db@0.4.5
0.0.59#
Patch Changes#
0.0.58#
Patch Changes#
- Updated dependencies [
32f2212]:- @tanstack/db@0.4.3
0.0.57#
Patch Changes#
0.0.56#
Patch Changes#
- Updated dependencies [
8cd0876]:- @tanstack/db@0.4.1
0.0.55#
Patch Changes#
Let collection.subscribeChanges return a subscription object. Move all data loading code related to optimizations into that subscription object. (#564)
Updated dependencies [
2f87216,ac6250a,2f87216]:- @tanstack/db@0.4.0
0.0.54#
Patch Changes#
- Updated dependencies [
cacfca2]:- @tanstack/db@0.3.2
0.0.53#
Patch Changes#
- Updated dependencies [
5f51f35]:- @tanstack/db@0.3.1
0.0.52#
Patch Changes#
0.0.51#
Patch Changes#
0.0.50#
Patch Changes#
0.0.49#
Patch Changes#
- Updated dependencies [
b162556]:- @tanstack/db@0.2.3
0.0.48#
Patch Changes#
- Updated dependencies [
33515c6]:- @tanstack/db@0.2.2
0.0.47#
Patch Changes#
- Updated dependencies [
620ebea]:- @tanstack/db@0.2.1
0.0.46#
Patch Changes#
0.0.45#
Patch Changes#
- Updated dependencies [
cc4c34a]:- @tanstack/db@0.1.12
0.0.44#
Patch Changes#
- Updated dependencies [
b869f68]:- @tanstack/db@0.1.11
0.0.43#
Patch Changes#
0.0.42#
Patch Changes#
- Updated dependencies [
d64b4a8]:- @tanstack/db@0.1.9
0.0.41#
Patch Changes#
0.0.40#
Patch Changes#
0.0.39#
Patch Changes#
- Updated dependencies [
ad33e9e]:- @tanstack/db@0.1.6
0.0.38#
Patch Changes#
- Updated dependencies [
9a5a20c]:- @tanstack/db@0.1.5
0.0.37#
Patch Changes#
Ensure that the ready status is correctly returned from a live query (#390)
Updated dependencies [
c90b4d8,6c1c19c,69a6d2d,6250a92,68538b4]:- @tanstack/db@0.1.4
0.0.36#
Patch Changes#
- Updated dependencies [
0cb7699]:- @tanstack/db@0.1.3
0.0.35#
Patch Changes#
0.0.34#
Patch Changes#
0.0.33#
Patch Changes#
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)
Updated dependencies [
7d2f4be,f0eda36]:- @tanstack/db@0.1.0
0.0.32#
Patch Changes#
- Updated dependencies [
6e8d7f6]:- @tanstack/db@0.0.33
0.0.31#
Patch Changes#
- Updated dependencies [
e04bd12]:- @tanstack/db@0.0.32
0.0.30#
Patch Changes#
- Updated dependencies [
3e9a36d]:- @tanstack/db@0.0.31
0.0.29#
Patch Changes#
- Updated dependencies [
6bdde55]:- @tanstack/db@0.0.30
0.0.28#
Patch Changes#
0.0.27#
Patch Changes#
0.0.26#
Patch Changes#
- Updated dependencies [
bec8620]:- @tanstack/db@0.0.27
0.0.25#
Patch Changes#
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)
Updated dependencies [
09c6995]:- @tanstack/db@0.0.26
0.0.24#
Patch Changes#
0.0.23#
Patch Changes#
0.0.22#
Patch Changes#
- Updated dependencies [
056609e]:- @tanstack/db@0.0.23
0.0.21#
Patch Changes#
- Updated dependencies [
aeee9a1]:- @tanstack/db@0.0.22
0.0.20#
Patch Changes#
- Updated dependencies [
8e23322]:- @tanstack/db@0.0.21
0.0.19#
Patch Changes#
- Updated dependencies [
f13c11e]:- @tanstack/db@0.0.20
0.0.18#
Patch Changes#
- Updated dependencies [
9f0b0c2]:- @tanstack/db@0.0.19
0.0.17#
Patch Changes#
0.0.16#
Patch Changes#
- Updated dependencies [
7e63d76]:- @tanstack/db@0.0.17
0.0.15#
Patch Changes#
0.0.14#
Patch Changes#
0.0.13#
Patch Changes#
- Updated dependencies [
74c140d]:- @tanstack/db@0.0.14
0.0.12#
Patch Changes#
feat: implement Collection Lifecycle Management (#198)
Adds automatic lifecycle management for collections to optimize resource usage.
New Features:
- Added
startSyncoption (defaults tofalse, set totrueto start syncing immediately) - Automatic garbage collection after
gcTime(default 5 minutes) of inactivity - Collection status tracking: "idle" | "loading" | "ready" | "error" | "cleaned-up"
- Manual
preload()andcleanup()methods for lifecycle control
Usage:
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- Added
Add createOptimisticAction helper that replaces useOptimisticMutation (#210)
An example of converting a
useOptimisticMutationhook tocreateOptimisticAction. Now all optimistic & server mutation logic are consolidated.-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<string>({ + 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 <Button onClick={ handleClick } /> }Updated dependencies [
945868e,0f8a008,57b5f5d]:- @tanstack/db@0.0.13
0.0.11#
Patch Changes#
- Updated dependencies [
f6abe9b]:- @tanstack/db@0.0.12
0.0.10#
Patch Changes#
Export
ElectricCollectionUtils& allow passing generic tocreateTransaction(#179)Updated dependencies [
66ed58b,c5489ff]:- @tanstack/db@0.0.11
0.0.9#
Patch Changes#
- Updated dependencies [
38d4505]:- @tanstack/db@0.0.10
0.0.8#
Patch Changes#
- Updated dependencies [
2ae0b09]:- @tanstack/db@0.0.9
0.0.7#
Patch Changes#
A large refactor of the core
Collectionwith: (#155)- a change to not use Store internally and emit fine grade changes with
subscribeChangesandsubscribeKeyChangesmethods. - changes to the
Collectionapi to be moreMaplike for reads, withget,has,size,entries,keys, andvalues. - renames
config.getIdtoconfig.getKeyfor consistency with theMaplike api.
- a change to not use Store internally and emit fine grade changes with
Updated dependencies [
5c538cf,9553366,b4602a0,02adc81,06d8ecc,c50cd51]:- @tanstack/db@0.0.8
0.0.6#
Patch Changes#
Expose utilities on collection instances (#161)
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
.utilsnamespace, with full TypeScript typing.- Refactored
createCollectionin packages/db/src/collection.ts to accept options with utilities directly - Added
utilsproperty to CollectionImpl - Added TypeScript types for utility functions and utility records
- Changed Collection from a class to a type, updating all usages to use createCollection() instead
- Updated Electric/Query implementations
- Utilities are now ergonomically accessible under
.utils - Full TypeScript typing is preserved for both collection data and utilities
- API is clean and straightforward - users can call
createCollection(optionsCreator(config))directly - Zero-boilerplate TypeScript pattern that infers utility types automatically
- Refactored
Updated dependencies [
8b43ad3]:- @tanstack/db@0.0.7
0.0.5#
Patch Changes#
0.0.4#
Patch Changes#
Collections must have a getId function & use an id for update/delete operators (#134)
the
keyByquery operator has been removed, keying withing the query pipeline is now automatic (#144)Updated dependencies [
1fbb844,338efc2,ee5d026,e7b036c,e4feb0c]:- @tanstack/db@0.0.5
0.0.3#
Patch Changes#
- Updated dependencies [
8ce449e]:- @tanstack/db@0.0.4
0.0.2#
Patch Changes#
- Updated dependencies [
b29420b]:- @tanstack/db@0.0.3
0.0.1#
Patch Changes#
- Add Vue support (#83)