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 | |
|---|---|---|---|---|---|---|---|---|---|---|
| host-finalize-instance | Add finalizeInstance to HostConfig | pending |
|
2026-05-18T16:22:57.323634873Z | 2026-05-18T16:22:57.323635316Z | single | low | component | implementation |
Description
Add the optional finalizeInstance?(instance: Instance, ctx: RootCtx): void method to the HostConfig interface. This method allows hosts to perform per-instance cleanup when an instance is removed (e.g., releasing GPU buffer slots, closing database connections, removing graphology nodes).
This is a backward-compatible change: the method is optional, so existing HostConfig implementations continue to work without modification. The reconciler calls finalizeInstance during disposeFiber after children are disposed but before the fiber's own state is cleared.
Acceptance Criteria
finalizeInstance?(instance: Instance, ctx: RootCtx): voidadded toHostConfiginterface- Method is optional (existing hosts don't need to implement it)
- Called by
disposeFiberduring fiber tree disposal - Called bottom-up: children's
finalizeInstancebefore parent's - Updated in
src/host/config.tsinterface definition - TypeScript compiles (
npm run build:tsc) - Existing tests pass (existing HostConfig implementations don't break)
- New test: host implementing
finalizeInstancereceives calls during disposal
References
- docs/architecture/lifecycle.md — Host Notification section, finalizeInstance interface
- docs/architecture/host-config.md — Open Question 3 (should HostConfig include finalizeInstance)
Notes
To be filled by implementation agent
Summary
To be filled on completion