Kernel + module registration API
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 冷清
- 技術堆疊
- typescript
研究方向
Start with the parent issue #25 and resolve the stated blocker, issue #27, before taking this on. The issue names no files or tests; use its acceptance criteria to define and verify the kernel, module contract, typed registration, and Calendar factory, including that unused modules tree-shake and navigation recomputes the projection.
由索引模型根據 Issue 內容生成。
描述
Parent
https://github.com/TanStack/time/issues/25
What to build
Define and implement the feature-agnostic kernel and the module registration contract. This is the architectural centrepiece of v1: a small, stateful core that owns the event collection, viewport, and date-range projection, extended by opt-in modules whose unused code tree-shakes away.
The kernel owns: event collection, viewport (current period + view mode), navigation, the date-range projection (events → occurrences mapped to the visible range), and plain create/edit/remove. Nothing domain-specific (no availability, recurrence, dependencies, drag, or undo) lives in the kernel itself.
Modules attach via two ordered pipelines with kernel-defined stages and per-module priority within a stage:
- Read pipeline: `recurrence-expand → clip-to-viewport → layout`
- Write pipeline: `recurrence-materialize → dependency-transform → availability-validate → commit → undo-snapshot/emit`
Stage order is fixed and kernel-defined. A module declares which stage(s) it participates in and a numeric priority — it does not run in registration order. Writes are committed as atomic batches so undo/redo and devtools observe one logical action.
The Calendar product is a convenience factory that wires the kernel with the recurrence, drag-resize, and availability modules pre-registered.
Acceptance criteria
- `createCalendar({ modules: [...], strategy: 'client' })` constructs a kernel instance
- A module is a plain object declaring `{ stage, priority, ... handlers }` — no class required
- Unused modules do not appear in the production bundle (verified via bundle analysis or import tracing)
- The kernel exposes `getRequiredRange(write)` returning the date range needed to validate the write; it does not fetch
- The kernel exposes `rollback(batch)` to reverse an atomic write batch
- `getDaysWithEvents()` returns `Day[]` with `Day.date` as `YYYY-MM-DD` (per #27)
- Navigation (`goToNext`, `goToPrevious`, `goToToday`, `goToSpecificPeriod`) updates the viewport and recomputes the projection
- The Calendar product factory (`createCalendar`) is exported and produces a kernel pre-configured with core Calendar modules
- TypeScript: module registration is fully typed; a module with wrong stage/priority shape is a compile error
Blocked by
- 主要語言
- TypeScript
- 星號
- 620
- 分支
- 6
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
TanStack/time 的其他 Issue
-
難度 5/5 一週以上 新手友好度 5/100
-
enhancement
難度 5/5 一週以上 新手友好度 25/100
-
enhancement
難度 5/5 一週以上 新手友好度 32/100
-
enhancement
難度 4/5 3-5 天 新手友好度 35/100
-
enhancement
難度 5/5 一週以上 新手友好度 35/100
相似的 Issue
-
area: cli bug flake ready-for-agent
難度 2/5 1-3 小時 新手友好度 62/100
gazetta-studio/gazetta-studio#1772 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
-
needs-triage
難度 2/5 1-3 小時 新手友好度 66/100
microsoft/playwright#43875 · 1 則留言 ·
維護者通常 1 天內回覆
-
documentation good first issue
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
feature
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆