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).
2.2 KiB
2.2 KiB
id, name, status, depends_on, created, modified, scope, risk, impact, level
| id | name | status | depends_on | created | modified | scope | risk | impact | level | |
|---|---|---|---|---|---|---|---|---|---|---|
| value-diff-payloads | Value.Diff granular prop payloads | pending |
|
2026-05-18T16:22:57.384875485Z | 2026-05-18T16:22:57.384875927Z | narrow | medium | component | implementation |
Description
Add Value.Diff to produce granular property-level diff payloads for commitUpdate. Instead of passing the full prevProps and nextProps to the host, Value.Diff identifies exactly which properties changed, allowing hosts to apply targeted updates.
This is the lowest-priority optimization per the architecture doc — "nice-to-have for hosts wanting granular updates." It's optional and the reconciler is correct without it.
Critical constraint: Value.Diff throws ValueDiffError on function values. Since PropValue includes functions, Value.Diff must either strip function props before diffing or catch the error and fall back to full replacement.
Implementation approach:
- Before calling
Value.Diff, strip function-valued props - Call
Value.Diff(cleanPrevProps, cleanNextProps) - If
Value.Diffthrows (unexpected function somehow), catch and fall back to fullprepareUpdate - Use the diff result as the payload for
commitUpdate
Acceptance Criteria
Value.Diffimported from@alkdev/typebox/value- Function-valued props stripped before
Value.Diffcall ValueDiffErrorcaught and falls back to fullprepareUpdate- Diff result used as
commitUpdatepayload - Hosts that don't need granular diffs can ignore the diff payload and use
prevProps/nextProps - Existing tests pass
- New test:
Value.Diffpayload contains only changed keys - New test: function-valued props don't crash
Value.Diff(stripped or caught) - New test: diff error falls back gracefully to
prepareUpdate
References
- docs/architecture/reconciler.md — TypeBox Optimization Layer, Value.Diff row, Value.Diff on Functions
- docs/architecture/reconciler.md — Optimization Strategy (step 5, optional)
- docs/architecture/schema.md — PropValue includes functions
Notes
To be filled by implementation agent
Summary
To be filled on completion