Tasks follow the architecture spec phases: - Phase 0: key field on UElement (2 tasks + review) - Phase 1: reactive-host bridge / fiber tree (4 tasks + review) - Phase 2: key-based children reconciliation (3 tasks + review) - Phase 3: unmount & dispose support (4 tasks) - Phase 4: TypeBox value optimizations (4 tasks) Validated with taskgraph CLI: no cycles, 15 parallel generations, 3 high-risk tasks identified (signal-driven-updates, commit-mutations, fiber-disposal).
1.7 KiB
1.7 KiB
id, name, status, depends_on, created, modified, scope, risk, impact, level
| id | name | status | depends_on | created | modified | scope | risk | impact | level |
|---|---|---|---|---|---|---|---|---|---|
| key-on-uelement | Add key field to UElement | pending | 2026-05-18T16:22:57.098951833Z | 2026-05-18T16:22:57.098952376Z | narrow | low | component | implementation |
Description
Add key?: string as a first-class field on UElement in both the TypeScript type and the TypeBox Module schema. This is Reconciler Roadmap Phase 0 (ADR-004).
The key field enables identity-based children matching in the reconciler. Without it, reconciliation is positional-only, which breaks when children are reordered, inserted, or removed. key is a reconciler concern, not a component concern — it must live outside props so that component schemas don't need to declare it and component functions never receive it.
URoot does NOT get a key field. Roots are unique per createRoot() call and are never children of another element.
Acceptance Criteria
UElementTypeScript type haskey?: stringfield- TypeBox Module
UElementschema includesType.Optional(Type.String())forkey URootTypeScript type has nokeyfieldURootTypeBox schema has nokeyfieldisUElementtype guard still correctly discriminates UElement from URoot- Existing tests pass (
npm run test) - New test:
UElementwithkeyfield validates and type-checks - New test:
UElementwithoutkeyfield still works (backward compatible)
References
- docs/architecture/schema.md — Known Gaps:
keyfield onUElement - docs/architecture/decisions/004-key-as-first-class-field.md — ADR-004
- docs/architecture/reconciler.md — Reconciler Roadmap Phase 0
Notes
To be filled by implementation agent
Summary
To be filled on completion