Files
ujsx/tasks/key-extraction-in-h.md
glm-5.1 c9c32a6aa6 decompose reconciler roadmap into 20 implementation tasks across 5 phases
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).
2026-05-18 16:26:52 +00:00

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
key-on-uelement
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() extracts key from props before constructing the element
  • key is promoted to the returned element's key field (top-level)
  • key is removed from resolvedProps so component functions never see it
  • createRoot() does NOT extract key (URoot has no key field)
  • h("root", { key: "x" })key stays in props for URoot (no promotion)
  • Existing tests pass (npm run test)
  • New test: h("div", { key: "a" }) produces UElement with key: "a" and no key in props
  • New test: h("div", { key: "b", class: "x" })key promoted, class remains in props
  • New test: h("div", null)key is undefined, no key in props

References

  • docs/architecture/element-factory.md — Known Gaps: key prop not extracted
  • docs/architecture/decisions/004-key-as-first-class-field.md — ADR-004 decision and consequences
  • docs/architecture/reconciler.md — Fiber Node key field

Notes

To be filled by implementation agent

Summary

To be filled on completion