Implementation started on 2026-06-01. The repository began as a Vite+ TypeScript package starter with one placeholder export.
- Ran
vp install. - Reviewed
GOAL.md, package configuration, and starter files. - Created package module scaffolding and public entrypoints.
- Implemented the first framework-neutral core slice:
schema definitions, Standard Schema typing, memory collections, view masking,
composable query specs, generated CRUD actions, reusable custom actions,
.with(...)binding,.extend(...)local overrides, optimistic rollback, pending/submission tracking, and hydration snapshots. - Added
@tanstack/dband switched schema-generated collections to a TanStack DB-backed local-only adapter. - Added Standard Schema mutation validation and configured persistence callbacks for generated CRUD actions.
- Pass each entity Standard Schema through to the generated TanStack DB
local-only collection so direct native mutations also receive official
schema validation, defaults, and transforms. Strip TanStack DB
$-prefixed virtual metadata at the adapterget()/values()boundary so cache and hydration helpers only see entity data. - Deep-merge custom action namespaces with generated CRUD namespaces and assign stable custom action names for submissions.
- Keep custom and derived action
actionNamevalues live after namespace merging, and adapt route pending/submission APIs so exposed aliases such as"likePost"resolve canonical actions such as"post.like". - Evaluate reusable action
affects(...)metadata and invokeinvalidate(...)after successful runs. - Generate concise index helpers such as
byPost(...)frompostIdindexes and executable relationship queries from schema relationships. - Track pending fields from evaluated affected query specs.
- Preserve literal schema indexes and relationships in generated query
helper types, so helpers such as
q.comment.byPost(...)type-check. - Accept externally supplied collection adapters through
queryCollection(..., { collection }). - Add
nativeCollection(key, engine, options?)for pre-created official TanStack DB collections, including entity-specific adapter inference and an intentional broad-record escape hatch. Generated CRUD actions and native query specs operate on these adapters without recreating their sync engine. - Make hydration explicit for external native adapters: they are excluded
from
dehydrateDb(...)snapshots by default and can opt in with adapter-provideddehydrate(engine)/hydrate(engine, values)hooks. - Add an isolated optional
./query-collectionentrypoint that wraps the officialqueryCollectionOptions(...), passes through entity schemas, derives keys from schema metadata, compiles convenience persistence handlers, and serializes confirmed state through adapter-specific hooks. - Added initial server and testing entrypoints.
- Make
createMemoryStartDb(schema)construct actual engine-freeMemoryCollectionadapters so tests deliberately exercise in-memory query execution and rollback fallbacks. - Added an initial typed React route-builder entrypoint.
- Add
@tanstack/react-routeras an optional peer-backed React entrypoint dependency and compile fluent DB route builders to officialcreateFileRoute(path)(options)routes via.build(). The builder now accumulates.queries()/.views(),.actions(), components, boundaries,.validateSearch(),.beforeLoad(), and.loaderDeps(); exposes a testable.load(...); and includes typeduseQuery(name). - Add Router loader semantics for
.defer(),.preloadOnly(), andhydrate: "route". Deferred specs remain unresolved promises in loader data, preload-only specs execute without becoming component data, and route hydration loaders include confirmed DB snapshots while hooks keep exposing flat route data. - Retain native live deferred route specs after their initial promise
resolves. Deferred handles expose the latest
currentvalue anddispose(), route reloads replace retained resources, compiled route components clean them up on unmount, and loader-only consumers can call builder.dispose()explicitly. - Expose the underlying
@tanstack/dbCollection<Value, EntityId>on theDbCollectionadapter so generated query specs can compile to native query-builder functions. - Compile generated query specs to TanStack DB query-builder functions and
execute them with
queryOnce(...); fall back to the in-memory executor when a collection has no native engine (e.g.MemoryCollection). - Implement live query subscriptions through
createLiveQueryCollection(...)withsubscribeChangesandpreload()-driven initial emission; the cleanup callback unsubscribes the change feed and tears the live collection down. - Compile simple
db.view()selections (no nested relationship views) into native TanStack DBselectprojections at.as(View)time viacompileViewSelect(view, rowAlias)and a per-specQueryBuildfactory; strip TanStack DB's internal$-prefixed virtual props from the result so the user receives only the selected, readonly component data. - Execute and subscribe to native
db.q.raw({ key, query })escape-hatch specs through the samequeryOnce(...)and live-query collection pipeline used by generated query helpers. - Surface React live-query hooks in
src/react.ts:useDbLiveQueryState(spec)returns a discriminatedloading | ready | errorstate;useDbLiveQuery(spec)returns the current value (orundefinedwhile loading). Both useuseSyncExternalStoreand a stableuseCallbackso the subscription is only set up once per mount. - Add
useDbLiveSuspenseQuery(spec)with a render-phase shared resource cache scoped by the native collection and query key. It starts the live subscription before the component commits, wakes Suspense after preload, streams later updates, isolates identical keys across DB instances, and releases retained collections after unmount. - Add
DbProviderand context-backed zero-argument React hooks:useDb(),useDbCollections(),useDbPending(), anduseDbSubmissions(). Existing explicit DB arguments remain supported. - Make
useDbStatus()context-backed, allowDbProviderto provide explicit status, and provide derived route status to nested route component descendants. - Implement first-pass
createDbComponent(View)helpers for typed static view components and action-aware components with context-backed actions, pending state, submissions, and status. - Add DB-bound
createDbComponent(db).props<Props>().views(...).render(...)helpers for component-owned live queries. Query maps use an aggregate Suspense resource so subscriptions start during render, stream updates, and clean up after the component unmounts. - Add relationship-aware nested views: schema relationship names are
accepted as typed
db.view(...)selection keys, nested views are checked against relationship targets at definition time, and.as(View)materializes masked nestedoneandmanyresults from registered collections after native query execution. Nested live views subscribe to referenced relationship collections and re-emit when related rows change. - Return observable
DbActionSubmissionthenables immediately from action calls while preservingawait action(...). Generated CRUD submissions expose the native TanStack DB mutation transaction and wait for itsisPersisted.promise. - Compile reusable custom
optimistic(...)/optimisticLocal(...)handlers through TanStack DBcreateOptimisticAction(...)whenever a native collection is present. Confirm local-only writes withengine.utils.acceptMutations(...)after persistence succeeds, expose the native transaction on the submission, and retain package undo records only for memory-adapter mutations. - Add adapter-level confirmed-state dehydration for generated TanStack
collections.
dehydrateDb(...)usesconfirmedValues()when available, preventing pending optimistic overlays from being serialized as confirmed hydration state. - Enforce
.required()query specs during static execution and live emissions by raisingDbNotFoundErrorfor nullish results. - Run
vp check,vp test, andvp run build.
Realign the prototype action and query runtimes with the implementation-grounded
TanStack DB architecture documented in GOAL.md.
- Compile
byId,all,byIndex, and relationship (one/many) specs to native TanStack DB query-builder functions. - Execute compiled specs through
queryOnce(...)andcreateLiveQueryCollection(...)with cardinality and live-mode mapping. - Chain
select(...)andas(View)through the native pipeline and project results withpickViewat execute time. - Compile simple
db.view()selections (no nested relationship views) into nativeselectprojections and strip internal virtual props. - Surface
useDbLiveQuery/useDbLiveQueryStateReact hooks backed by the compiled native live-query collections. - Add a first-pass
createDbActionSubmission/DbActionSubmissionwrapper that exposes the GOAL.md action result contract (transaction,persisted,result,status, thenable). Actions now return this wrapper immediately, generated CRUD submissions retain the transaction returned by native collection mutations, and theirpersistedpromise waits fortransaction.isPersisted.promise. - Keep the existing
OptimisticCacheundo layer for in-memory collections.cache.post(id).patch(...)now routes throughcollection.update(...)(instead ofcollection.insert(...)) so it no longer tripsDuplicateKeyErrorwhen patching an existing row, andcache.rollback()reverts via the recorded undo operations. - Wire the
submitpipeline so the action'sruncallback throws aDbActionError(or wraps unknown errors asDbActionError("Action failed.", cause)), the cache rolls back, the submission resolves to"failed", anddbSubmission.persistedis also rejected. Theinvokefunction attaches a no-op.catch(() => {})topersistedso the failure surfaces throughawait action(...)without triggering an unhandled rejection warning from Vitest. - Materialize relationship
one/manynested view projections after native query execution, so a view like{ id: true, title: true, author: UserCardView }produces the expected masked result for static execution. - Compile nested relationship projections into native TanStack DB joins rather than materializing them after query execution. The current layer keeps native source filtering and execution and retains relationship collection subscriptions so related writes re-emit nested live results.
- Add a Suspense-aware
useDbLiveSuspenseQueryhook backed by a shared, render-phase subscription cache keyed by native query scope andspec.key(). - Expose native
db.q.raw(...)query-builder escape-hatch specs. - Add a generic
nativeCollection(...)wrapper for externally configured TanStack DB collections and sync engines. - Add optional-package convenience sugar for Query Collection through an
isolated
./query-collectionentrypoint. - Add optional-package convenience sugar for other engine-specific
adapters.
localStorageCollection(in./local-storage-collection) wrapslocalStorageCollectionOptionswithmutations: { insert, update, delete }sugar and a storage-driven dehydrate snapshot;syncCollection(in./sync-collection) accepts any pre-createdCollection<Value, TKey>engine and lets users overridedehydrate/hydratefor adapter semantics like Electric or PowerSync. Both are wired into thecreateStartDbFromSchemacollectionsfactory. - Wire reusable custom optimistic actions through
createOptimisticAction(...)and expose their native transactions while preserving memory-adapter rollback records. - Track pending query refresh state for active live query subscriptions.
ActionTrackernow exposes aLiveQueryTrackerregistry; generated query specs register their native live collections onsubscribe(), the registry keeps the entry live until the cleanup callback fires, andpending.query(name)returnstruewhile any matching entry is still loading.
- Add a first-class generic wrapper for externally configured TanStack DB collections and sync engines.
- Add optional-package convenience sugar for Query Collection.
- Replace the native-collection custom-action rollback path with TanStack DB
createOptimisticAction(...)transactions while retaining the memory adapter fallback. - Track pending query refresh state beyond affected-query metadata.
- Implement a first Router-backed route loading compiler via
.load(...)and.build(). - Integrate first-pass route hydration snapshots and deferred loader data.
- Resolve route action aliases for pending and submission lookups.
- Add first-pass route status and client hydration wiring.
- Add adapter-derived route refetch/stale status through neutral collection status hooks and the official Query Collection utilities.
- Expand fixtures, render helpers, server handlers, tests, and README docs. - Upgraded
src/testing.tsfrom stubs to real render helpers (renderDbRoutedriving the route'sload(...),renderDbComponentusingreact-dom/server, pluswaitFor,flushMicrotasks,seedCollections,listFixture,mockDbActionreturning a realDbActionSubmission, andcreateMemoryStartDb). - Added 8 new tests for the testing helpers and a type-level inference test that exercisesInferEntity/InferView/InferDbQueryResultat runtime. - Documented every public export insrc/schema.ts,src/view.ts,src/query.ts,src/action.ts,src/cache.ts,src/collection.ts,src/hydrate.ts,src/transaction.ts,src/errors.ts,src/local-storage-collection.ts,src/sync-collection.ts,src/query-collection.ts,src/db.ts,src/react.ts,src/server.ts, andsrc/testing.tswith@typeParam,@param,@returns,@example, and@remarksas appropriate. - Server entry point keeps its thincreateDbServerFn/createDbServerHandlershape with full JSDoc; framework-specific server-function integration is left to the consumer's chosen framework.
GOAL.mdis the product design reference.- TanStack DB integration should remain an adapter boundary: the package adds contracts and ergonomics without introducing a competing data engine.
- Audited
GOAL.mdagainst installed@tanstack/dbsource and current official TanStack DB, Router, and Start docs. Added implementation-grounded decisions for official collection options, native transactions, live queries, Router loaders, Start server functions, adapter-specific hydration, and transaction-derived pending state. compileQueryFn(collection, build)accepts a builder callback that returns a TanStack DBInitialQueryBuilderclosure; the first arg is reserved for per-collection type inference. The runtime is intentionallyany-typed inside the builder callback to side-step the deeply genericQueryBuilder<Context>constraint while keeping the user-facing types driven by the schema.subscribeChanges(...)returns aCollectionSubscriptionobject with anunsubscribe()method — the cleanup callback inDbQuerySpec.subscribe(...)must call that method before invokingcleanup()on the live collection.- Each generated spec carries a
QueryBuildfactory ((view?) => NativeQueryFn) in addition to the resolvedqueryBuilder..as(View)rebuilds thequeryBuilderthrough that factory so the view is folded into the nativeselect(...)step before the terminator (findOne()or array form).hasNestedViews(view)gates the native compilation path; views with nested relationship selections fall back to the runtimepickViewprojection. stripVirtualProps(...)recurses through the result returned byqueryOnce(...)andcreateLiveQueryCollection(...).values()to drop the internal$collectionId,$key,$origin,$syncedkeys, leaving only the user-requested fields.- Verified after the native query compilation + view projection slice:
vp check --fixandvp testpass with 18 tests (10 prior + 8 new covering native byId/all/byIndex/relationship execution, live subscription, view projection through nativeselect, and view projection through the relationship join chain). - Verified after the action-submission-contract slice:
vp checkis clean andvp testpasses 21/21 (unchanged from the previous slice — the existing optimistic-rollback test now exercises the new submission wrapper and still passes; no new test was added because the wrapper is only observable when a real TanStack DB transaction is available, which is the next sub-slice). - Verified after the relationship-aware nested-view slice:
vp checkis clean andvp testpasses 25/25. Added coverage for masked nestedoneandmanyresults, rejecting unknown or target-mismatched nested relationships, and re-emitting a nested live view when its related collection changes. Added nativeq.raw(...)execution and subscription coverage. - Verified after the generated-action transaction and schema pass-through
slice:
vp checkis clean andvp testpasses 28/28. Added coverage for immediate action submissions with native CRUD transactions, direct engine schema defaults, and.required()missing-result enforcement. - Verified after the Suspense live-query slice:
vp checkis clean andvp testpasses 29/29. Added coverage for Suspense wake-up, subsequent live updates, and isolation of identical query keys across DB instances. - Verified after the custom optimistic-action transaction slice:
vp checkis clean andvp testpasses 30/30. Added coverage for visible optimistic state, exposed native transaction status, local-only mutation acceptance, and persisted optimistic state. - Verified after the confirmed-state hydration slice:
vp checkis clean andvp testpasses 31/31. Added coverage proving pending optimistic overlays are excluded from dehydration snapshots until persistence completes. - Verified after the external native-adapter slice:
vp checkis clean andvp testpasses 33/33. Added coverage for generated CRUD/query behavior on a pre-created official collection, default snapshot exclusion, and explicit external hydration hooks. - Verified after the React context slice:
vp checkis clean andvp testpasses 34/34. Added coverage for resolving DB, collections, pending state, and submissions throughDbProvider. - Verified after the first Router compiler slice:
vp checkis clean andvp testpasses 35/35. Added coverage for fluent query loading, official file-route compilation, Router loader execution, and passthrough route options. - Verified after the Router hydration/deferred slice:
vp checkis clean andvp testpasses 36/36. Added coverage for non-blocking deferred promises, preload-only execution, and confirmed route snapshot payloads. - Verified after the memory testing-helper fix:
vp checkis clean andvp testpasses 37/37. Added coverage provingcreateMemoryStartDb(...)uses engine-free fallback queries. - Verified after the route action-alias slice:
vp checkis clean andvp testpasses 38/38. Added coverage for alias-aware pending state and submission lookups, and fixed stale customactionNamevalues. - Verified after the route status/client hydration slice:
vp checkis clean andvp testpasses 39/39. Added route-scoped critical and deferred loading state plushydrateDbRoutePayload(...)and builder.hydrate(...)helpers for applying route snapshots on the client. - Verified after the official Query Collection adapter slice:
vp checkis clean andvp testpasses 41/41. Added an isolated./query-collectionentrypoint with schema pass-through, generated key extraction, convenience mutation handlers, confirmed-state dehydration, and tested direct-write hydration. - Verified after the adapter-derived route status slice:
vp checkis clean andvp testpasses 42/42. Added neutral collection status hooks, Query Collection loading/refetch/stale/error derivation, context-resolved route DB tracking, and route-level aggregation. - Verified after the first component-helper slice:
vp checkis clean andvp testpasses 43/43. Added context-backeduseDbStatus(), route descendant status providers, typed static view components, and action-aware view components. - Verified after the retained deferred live-query slice:
vp checkis clean andvp testpasses 44/44. Added augmented deferred promises with livecurrentvalues, explicit disposal, reload replacement, and compiled route component unmount cleanup. - Verified after the component-owned local-query slice:
vp checkis clean andvp testpasses 45/45. Added DB-bound local component view builders, typed props staging, aggregate Suspense resources, retained live updates, and unmount cleanup. - Verified after the native-join view-projection slice:
vp checkis clean andvp testpasses 47/47.buildViewSelectWithJoins(...)walks the view selection and emits left-join clauses for each foldableonerelationship (related collection exposes a native engine). The nativeselectprojection now produces the source fields plus the joined rows;materializeViewrecurses withsource[name]for joinedonefields and still resolvesmany/ non-foldableonerelationships from the related collections.as(View)now keeps the post-executematerializeViewstep in place even on the native path so non-foldable fields are filled in afterqueryOnce/createLiveQueryCollection. Added coverage for foldableonejoins insidebyIdandallprojections, live re-emit when the joined row or amanyrelationship changes, and the post-execute fallback foronerelationships whose related collection has no native engine. - Verified after the pending query refresh-state slice:
vp checkis clean,vp testpasses 48/48, andvp run buildis clean.ActionTrackernow exposes aliveQueries: LiveQueryTrackerregistry; generated query specs accept the registry through a newliveQueryTrackerextra, register theirpreload-bound loading predicate onsubscribe(), and unregister it in the cleanup callback.pending.query(name)now returnstruewhile any matching entry is still loading, and the local-only engine's preload resolves inside a microtask so the predicate flips back tofalseby the time the firstonValuefires. Added coverage proving the pending state istruesynchronously aftersubscribe(), flips tofalseafter the first emit, and remainsfalseafter unsubscribe. - Verified after the README + passthrough helper slice:
vp checkis clean,vp testpasses 49/49, andvp run buildis clean. Added a typedpassthrough<Value>()Standard Schema helper tosrc/schema.tsfor unvalidated entity definitions, expandedREADME.mdwith usage examples for schemas, custom collection adapters, view projection, the action submission contract, custom optimistic actions, hydration, React hooks, route builders, and the Query Collection entrypoint, and added a test proving the passthrough helper drives both the action submission contract and the standardq.*query helpers. - Verified after the review-pass +
select()fix slice:vp checkis clean,vp testpasses 56/56, andvp run buildis clean.DbQuerySpec.select(...)now routes throughcopy(...)instead of constructing a fresh spec, so the selector is applied once on both the native and in-memory execute paths andviewBuild/resolveView/subscribeView/view/liveQueryTrackerare preserved for downstream.as(View)chaining. Added coverage provingselect(selector)produces the correct projection onqueryOnceand on the in-memory fallback, thatas(View).select(selector)re-emits when a related collection changes, and that the per-spec relationship subscription wiring survivesselect(...). - Verified after the engine-adapter sugar slice:
vp checkis clean,vp testpasses 59/59, andvp run buildis clean. Added two isolated entrypoints alongsidequery-collection.ts:local-storage-collection.tsexports alocalStorageCollection(entityName, options)helper that wrapslocalStorageCollectionOptionsfrom@tanstack/db, addsmutations: { insert, update, delete }sugar for forwarding writes to a server, and reads the dehydrate snapshot directly from the storage API so it matches what the next session would see (including cross-tab storage events).sync-collection.tsexports asyncCollection(entityName, options)helper that accepts any pre-createdCollection<Value, TKey>engine (Electric, PowerSync, custom sync engines, etc.) and wraps it innativeCollectionwith optionaldehydrate/hydrateoverrides.createStartDbFromSchemanow exposes both helpers in itscollectionsfactory alongsidequeryCollection. Added coverage proving the localStorage helper persists generated CRUD through the storage API, drives themutationssugar, exposes a storage-driven snapshot, and survives adehydrateDb/hydrateDbround-trip; and that the sync-collection helper exposes a customdehydrateprojection and a customhydratecallback for cross-DB snapshots. - Verified after the JSDoc / public-types polish slice:
vp checkis clean,vp testpasses 67/67, andvp run buildis clean. Every public export acrosssrc/schema.ts,src/view.ts,src/query.ts,src/action.ts,src/cache.ts,src/collection.ts,src/hydrate.ts,src/transaction.ts,src/errors.ts,src/local-storage-collection.ts,src/sync-collection.ts,src/query-collection.ts,src/db.ts,src/react.ts,src/server.ts, andsrc/testing.tsnow carries a JSDoc block with@typeParam,@param,@returns,@example, and@remarksas appropriate; generics onDbQuerySpec,InferDbQueryResult,InferEntity,InferView,StartDb,QueryCollectionDefinition,GeneratedEntityActions,GeneratedEntityQueries,OptimisticCache,EntityCache,SelectedEntityCache,NativeCollection,TanStackCollection,MemoryCollection,nativeCollection,createDbActionSubmission,DbActionSubmission,mockDbAction,seedCollections,useDbLiveQuery,useDbLiveSuspenseQuery, etc. infer correctly. Upgradedsrc/testing.tsrender helpers from stubs to real implementations driving the route'sload(...)andreact-dom/server. Added 8 new tests coveringcreateMemoryStartDb,seedCollections,fixture,listFixture,mockDbAction,renderDbComponent,waitFor,flushMicrotasks, and a runtime type-level inference check forInferEntity/InferView/InferDbQueryResult. - Verified after the review-pass + docs slice:
vp checkis clean,vp testpasses 97/97, andvp run buildis clean. Added theDbConflictErrorandDbOfflineErrorclasses plus theirisDbConflictError/isDbOfflineErrortype-guards insrc/errors.ts; thefreezeViewdeep-freeze helper insrc/view.ts; thecreateInfiniteQuery,DbInfiniteQuerySpec,DbInfiniteState,InfiniteOptions, andisDbInfiniteQuerySpecexports in a newsrc/infinite.ts; and theuseDbLiveInfiniteQuery/useDbLiveInfiniteSuspenseQueryReact hooks plus route-builder integration (infinite specs are attached to deferred route data and warmed viafirstPage()) insrc/react.ts. Fixed a pagination bug wheregetNextPageParamreturningnulldid not fliphasNextPagetofalse; the runtime now uses== nullfor both the early-out andhasNextPagecomputation. Added 7 new tests covering the first-page live subscription, multi-pageloadMorewith anullcursor terminator, the React hooks, the route builder's spec attachment + SSR warming,freezeView's deep-freeze contract, the new error type-guards, andactionNamepreservation through.with(...),.extend(...), and route-level aliasing. Split the review-tied sections ofREADME.mdinto detailed deep-dive files underdocs/(views.md,relationships.md,pagination.md,authorization.md,optimistic-conflict-offline.md,action-aliases.md,query-keys.md, plus adevtools.mdplaceholder for the v0.2 Devtools surface). The package remains pre-stable. - Verified after the four follow-up slices (auto-affects,
db.componentflagship, hydration strategies, docs pass):vp checkis clean,vp testpasses 106/106, andvp run buildis clean. Slice 1 — auto-affects for generated CRUD: every generated CRUD action insrc/db.tsnow ships with an auto-derivedaffects(...)sopending.field(entity, "fieldname")andpending.query("entity")work for free.createaffects[q.<entity>.all()],patchaffects[q.<entity>.byId(id).field(name)]for eachnameinchanges, andupdate/deleteaffect[q.<entity>.byId(id)]. Added 2 new tests intests/index.test.tsprovingsubmission.affectedcarries the auto-derived specs and that thepending.fieldlookup matches the auto-derivedbyId(id).field(name)spec through a parked action. Slice 2 —db.component(View)flagship: added acomponentmethod to theStartDbinterface insrc/db.tsthat mirrors the view-boundcreateDbComponent(view)overload.db.componentreads the DB from the call site (via the React context inside the builder), so the render callback only needs to receive the projected row plusactions/pending/status/submissions. Added 1 new test exercising both the simple form and the.actions(...).render(...)chain.createDbComponentis preserved (it also covers the no-arg and bound-db overloads). Slice 3 — hydration strategies: addedDbSnapshotModeandDehydrateDbOptionstosrc/hydrate.ts;dehydrateDbnow accepts asnapshotoption that toggles between"confirmed-only"(default — exclude pending optimistic overlays) and"include-pending-for-debug"(preserve them for SSR / localStorage debugging). Added an optionaldehydrateDebug()method to theDbCollectioninterface (implemented onTanStackCollectionandMemoryCollection;NativeCollectionopts in via its existing options). AddedsnapshottoDbRouteDefaultsand forwarded it through the route loader. ExportedDbSnapshotModeandDehydrateDbOptionsfromsrc/index.ts. Added 2 new tests proving the debug snapshot preserves the in-flight overlay, and that the route builder forwardssnapshot: "include-pending-for-debug"into the SSR payload. Slice 4 — docs pass: added a "Positioning" section toREADME.mdwith the "not Fate" framing, the "TanStack DB power + app-level contracts" positioning, and a catalogued escape-hatch surface (db.q.raw,useDb,useCollections,nativeCollection,route.useDb); added a "Three levels" section (Level 1: schema to CRUD, Level 2: views + components + routes, Level 3: custom actions + relationships + adapters + devtools); updated the React section to usedb.component(View)as the flagship view-bound builder while keeping thecreateDbComponent(db).props<...>()example for component-owned queries; added a "Hydration" subsection documenting the snapshot and hydration strategies (route / root / manual). Added a newdocs/design.mdcovering the positioning, the "what this package is not" list, the layered architecture diagram, the escape-hatch rationale, the "actions own their behavior" principle, the auto-affects rationale, the readonly-view guarantee, and the route-owned hydration rationale. Added a new section todocs/action-aliases.mddocumenting the generated CRUD auto-affects, and a new section todocs/optimistic-conflict-offline.mddocumenting the snapshot strategies. Updateddocs/README.mdto adddesign.mdto the topic table and the reading order. The package remains pre-stable; the Devtools surface is the only review item still deferred to v0.2.