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.8 KiB
1.8 KiB
id, name, status, depends_on, created, modified, scope, risk, impact, level
| id | name | status | depends_on | created | modified | scope | risk | impact | level | |
|---|---|---|---|---|---|---|---|---|---|---|
| key-extraction-in-h | Extract key from props in h() | pending |
|
2026-05-18T16:22:57.111275411Z | 2026-05-18T16:22:57.111275823Z | narrow | low | component | implementation |
Description
Modify h() and createRoot() to extract key from props and promote it to the element-level key field. This ensures component functions never receive key in their props — it is stripped during construction, not during component invocation.
Per ADR-004: key is a reconciler concern, not a prop. The factory layer is where the extraction happens, so that every downstream consumer (components, hosts, transforms) sees key only on the element, never in props.
Acceptance Criteria
h()extractskeyfrompropsbefore constructing the elementkeyis promoted to the returned element'skeyfield (top-level)keyis removed fromresolvedPropsso component functions never see itcreateRoot()does NOT extractkey(URoot has no key field)h("root", { key: "x" })—keystays in props for URoot (no promotion)- Existing tests pass (
npm run test) - New test:
h("div", { key: "a" })producesUElementwithkey: "a"and nokeyinprops - New test:
h("div", { key: "b", class: "x" })—keypromoted,classremains in props - New test:
h("div", null)—keyisundefined, nokeyin props
References
- docs/architecture/element-factory.md — Known Gaps:
keyprop not extracted - docs/architecture/decisions/004-key-as-first-class-field.md — ADR-004 decision and consequences
- docs/architecture/reconciler.md — Fiber Node
keyfield
Notes
To be filled by implementation agent
Summary
To be filled on completion