1.0 Roadmap
Schema
- Copy over code from Zero Schema so that we can drop that dependency and gain flexibility if needed in the future
- Use minimal internal validators instead of Valibot
Syncer
- If present, app startup has to have/request
baseSyncIdbefore triggering any requests - Support following protocol messages, updating lastSyncId for each:
-
{type: "data", data: RowsByTable<S>}should store rows -
{type: "reset", reason: string}should throw “resetNeeded” error (and store it) -
{type: "refetch"}should => mark all coverages/bootstraps as incomplete
-
Mutators
- Switch over to using mutators instead of the event/projector separation
- Decide on a mutator design
- Build type-safe mutator definitions, with a Standard Schema
datafield - Build cross-tab ordering system
- Connect to IDB for persistence
- Choose an incrementing Mutation ID format per (client|browser)
- Connect mutations rebasing to store
- Clear accepted mutations when lastSyncId updates
- A way to filter out “self-inflicted” changes
Queries
- Finalise design for query DSL
- Design system for subscriptions
- Make sure updates to queries are batched before revealing to the UI
- Add lazy accessor to queries to track just insert/update/delete (like experimental
watch()API) - Connect query layer with the coverage tracker
Batcher
- Connect batch loader with the store
- Design batch loader that dedupes query satisfactions and validates responses
- Connect the coverage tracker with the batch loader
Bootstrap
- Handle the
bootstrapsBroadcast Channel updates - Build bootstrap lifecycle manager
- Connect bootstrap layer to store
- Persist and load BoostrapStatus(es) from IDB
- Expose BoostrapStatus as an Observable
Store
- Design APIs to write to the store from:
- Mutations
- Syncers
- Batch/bootstrap
- Handle the
store-updatedBroadcast Channel coordinator - Freeze objects returnes by queries
Persistence (IDB)
- Handle the
schema-changedBroadcast Channel coordinator - Build an IndexedDB database management system
- Coordinate the startup sequence (check for database, create if needed)
- Design API for storing mutation queue
- Design API for persisting store data
- Provide namespaced KV store
- https://gist.github.com/pesterhazy/4de96193af89a6dd5ce682ce2adff49a
- https://github.com/rocicorp/replicache/issues/973
Integrations
- Solid.js wrapper with Stores on the reactive layers
- React wrapper with stable identity
- Figure out how to play well with SSR:
- Build a
await client.prefetch("users", { id: "id-me" })that can run in a loader - Add
client.dehydrate()that can serialise the client’s state to JSON - Add
client.hydrate(state);that can use the JSON to setup the browser client - Build hydrate and rehydration paths for LastSyncId, Store, Coverage, and Bootstrap
- Make IDB storage purely pluggable
- Guard
BroadcastChannelmessages to only run on client
- Build a
Performance
- Make sure store APIs are fast
- Add perf tests for store => query connection
- Ensure that rebasing is fast
- Prefer monomorphic objects (https://github.com/rocicorp/mono/pull/5801)
- Reduce allocations (https://github.com/rocicorp/mono/pull/5843, https://github.com/rocicorp/mono/pull/5834)
- https://github.com/rocicorp/mono/pull/5807
- 7x faster client-side index construction (PR 5844)
- Bulk-insertion optimization in Replicache via
putMany(3–5x faster typical sync batches, 50x+ for large preloads) (PR 5380). - Parallelize I/O during pull and rebase (PR 5926)
QoL
- Add thorough docstrings to all files to drive agents and test creation
- Come up with a minimal set of key/id formats for everything (maybe use https://rxdb.info/key-compression.html)
- Decide on a single format for passing along row changes
- Play code golf on largest modules to get things down to <10kb gzip
- Design error types for library
- Switch to using tagged union Result type for typed error handling
- Flatten all table row vaildation into one shape (across network + persistence)
Future
- Go through https://github.com/rocicorp/replicache/releases and implement all useful features.
- Give materializers access to the database
- Add IVM for
wherequeries (store.issues.where(q => q.eq("status", "open"))) to the query language, withsorted-btreefor indexing.- gte
- lte
- eq
- in
Dead ends
Events & Projectors
-
Switch to usingbetter-resultfor typed error handling -
Decide on an event schema format -
Figure out a nice projector API that is easy to use across backend and frontend -
Build type-safe projectors that connect events and schema in a SSSync client