Server package: validateOnServer + loadEvents adapter
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 32/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
Direzione di ricerca
Start by reading the parent issue #25 and blocked issue #26 to understand the shared Validation Core and what this package depends on. Then trace the existing core's public functions and package conventions; this issue names no files or tests. Done means the new runtime-agnostic package implements the adapter and direct exports, has mock-based unit tests, and documents transactional isolation and the exclusion-constraint recommendation.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Parent
https://github.com/TanStack/time/issues/25
What to build
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 package's key export:
```ts
validateOnServer(write, { loadEvents }, ctx) → Promise<conflicts[]>
```
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
Blocked by
- Lingua principale
- TypeScript
- Stelle
- 620
- Fork
- 6
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TanStack/time
-
Dependency DashboardAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 5/100
-
Client/server Data StrategyApertaenhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Undo/redo moduleApertaenhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
Tutte le issue di TanStack/time
Issue simili
-
area: frontend priority: normal
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
formbricks/formbricks#9918 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
thecodacus/pithagoras#364 ·
I maintainer di solito rispondono entro 1 giorno
-
TestAutonomousStop_ReportsObservedState fails under host load: 1s wall-clock ceiling vs 250ms cycleApertatype:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
nightgauge/nightgauge#2909 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno