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.4 KiB
2.4 KiB
id, name, status, depends_on, created, modified, scope, risk, impact, level
| id | name | status | depends_on | created | modified | scope | risk | impact | level | |
|---|---|---|---|---|---|---|---|---|---|---|
| commit-mutations | Commit insert/move/remove effects in tree order | pending |
|
2026-05-18T16:22:57.246628537Z | 2026-05-18T16:22:57.246628975Z | moderate | high | phase | implementation |
Description
Implement the commit phase that applies all pending effects (insert, move, remove, update) to the host in the correct order. This is where fiber effects become host mutations.
The commit order matters for host correctness:
- Removes — reverse order (children before parents, bottom-up)
- Inserts + Moves — left-to-right using
insertBeforeorappendChild - Updates — top-down (parent before child, so parent state is consistent)
This task also creates new fibers for inserted children (via mountNode-style recursive creation) and updates the fiber tree structure after commit.
commitMutations is called after the reconciliation algorithm has classified all changes and queued effects on fibers. It walks the fiber tree and applies effects in the specified order.
Acceptance Criteria
commitMutations(rootFiber, ctx)function implemented insrc/host/reconcile.ts- Removes committed in reverse order (children before parents)
host.removeChild(parent, child, ctx)called for each removal- Inserts committed left-to-right, using
host.appendChildorhost.insertBefore - New fibers created for inserted children, linked into parent's children array
- Moves committed left-to-right using
host.insertBefore(parent, child, before, ctx) - Updates committed top-down (parent before child) via
host.commitUpdate - Fiber tree is updated after commit: new children added, removed children pruned, moved children reordered
- Order guarantee: removes → inserts/moves → updates
- Existing tests pass
- New test: adding a child calls
host.appendChild - New test: removing a child calls
host.removeChild - New test: reordering children calls
host.insertBeforefor moved children - New test: mixed add+remove+update operations apply in correct order
- New test:
insertBeforefalls back toappendChildifbeforeis null
References
- docs/architecture/reconciler.md — Step 3 (commit order), Step 4 (Commit Effects), Effect Types
- docs/architecture/host-config.md — insertBefore, removeChild, appendChild
Notes
To be filled by implementation agent
Summary
To be filled on completion