You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Server package: validateOnServer + loadEvents adapter #37
Build `@tanstack/time-server` — a runtime-agnostic package that exposes the shared isomorphic Validation Core with a `loadEvents` adapter seam for authoritative server-side validation. The library never opens a database connection; the consumer implements `loadEvents` against their own DB inside their own write transaction.
The library computes `getRequiredRange(write)`, calls `loadEvents(range, ctx)` to get the relevant events from the consumer's DB, then runs the same pure Validation Core as the client's advisory checks. Same logic, authoritative data.
Documentation must prominently state: read-validate-write is only race-free inside one transaction with a consistent/locked view. The library provides rules; the consumer provides isolation. A DB exclusion constraint is the recommended backstop for raw time-overlap.
Acceptance criteria
`@tanstack/time-server` is a new package in the monorepo with no DOM or browser dependencies
`validateOnServer(write, { loadEvents }, ctx)` calls `loadEvents` with the required range, then runs the Validation Core
`loadEvents(range, ctx) → Promise<Event[]>` is the only DB seam; the package opens no connections
The package works in Node, Bun, Deno, and edge runtimes (no Node-specific APIs)
Unit tests use a mock `loadEvents` — no real DB required
The package exports the same Validation Core pure functions directly for consumers who want to call them without the adapter orchestration
Documentation clearly states the transactional-isolation requirement and the DB exclusion constraint recommendation
Activity