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:
@@ -14,6 +14,7 @@ function makeFiber(key: string | undefined, tag: string): Fiber<string> {
|
||||
effect: null,
|
||||
signalDisposers: [],
|
||||
prevProps: null,
|
||||
disposed: false,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user