Kernel + module registration API

オープン
#28 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
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 の本文から書いたものです。

説明

enhancement

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

https://github.com/TanStack/time/issues/27

主要言語
TypeScript
スター
620
フォーク
6
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TanStack/time のほかの issue

TanStack/time の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。