Implement disposeFiber for fiber tree disposal

Add disposeFiber() function that performs bottom-up teardown of fiber
subtrees: recursively disposes children before parents, calls
host.finalizeInstance for per-instance cleanup, invokes signal disposers,
and clears fiber state. Idempotent via disposed flag. Does NOT call
host.removeChild (that's the commit phase's job).

- Add disposeFiber + HostLike to src/host/fiber.ts
- Add finalizeInstance to HostConfig interface
- Add disposed boolean to Fiber interface
- Export disposeFiber and HostLike from barrel
- Add 7 tests for disposeFiber (3-level tree, idempotency, signal cleanup, etc.)
This commit is contained in:
2026-05-18 17:22:05 +00:00
parent 1e0abb0900
commit 95995f4602
7 changed files with 279 additions and 3 deletions

View File

@@ -210,6 +210,7 @@ describe("commitMutations direct", () => {
effect: null,
signalDisposers: [],
prevProps: null,
disposed: false,
};
}