Repository navigation
v0.4.0
Object-schema authoring (defineSync) replaces the builder, and typed commands run end to end (ADR-0014). Breaking, no compat shim.
Changed
- Authoring is now an object schema, not a builder (ADR-0014).
new SyncRegistry().defineCollection().defineMutation().defineCommand()is replaced bydefineSync<User, Env>(), which binds identity/env once and returns{ collection, command, schema }. Mutations are a closed insert/update/delete trio co-located on the collection (mirroring@tanstack/db'sonInsert/onUpdate/onDelete— a custom mutation type is now structurally unrepresentable), superseding ADR-0001 D11 and absorbing ADR-0010's row manifest: the row type lives on the collection (sync.collection<Message>({ pk })) instead of a thirdSyncRegistrygeneric. The DO registers the schema value withthis.registerSync(schema). Breaking, no compat shim.
Added
- Typed commands, end to end (ADR-0014).
export type Api = typeof schemais the whole client contract:new WebSocketTransport<Api>()exposes a typedtransport.call.<command>(args)proxy plus a typed low-levelsendCall(name, args)(txId generated internally viacrypto.randomUUID()), anddoCollectionOptions<Api, "table">({ … })infers the row type from the schema — one source of truth across server and client. examples/multi-do— a two-Durable-Object example: one transport per DO, a ReactSyncProvider/useSynckeyed by DO so command namespaces never collide, and a client-side cross-DO feed.
Full Changelog: v0.3.3...v0.4.0