Commit Graph

13 Commits

Author SHA1 Message Date
f14916c1bb Implement ReactiveRoot.dispose() and real dispose on ReactiveNode
Adds ReactiveRoot.dispose() which calls render effect disposer, iterates
all tracked subscriber disposers, and clears internal state. subscribe()
now tracks effect disposers in a Set and returns idempotent unsubscribe.
render() now disposes previous render effect before overwriting. Both
reactiveComponent and reactiveElement return real dispose functions that
sever the computed signal reference on disposal.
2026-05-18 17:23:51 +00:00
95995f4602 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.)
2026-05-18 17:22:05 +00:00
1e0abb0900 Implement commitMutations for insert/move/remove effects in tree order
Adds commitMutations function to reconcile.ts that processes fiber effects
in correct order: removes (reverse), inserts+moves (left-to-right with
insertBefore), updates (top-down). Integrates key-based reconciliation
pipeline into render() via reconcileNode, resolveUNode, and
createFiberForInsert.
2026-05-18 17:17:28 +00:00
9e5b901efc feat: add LIS-based move detection for keyed children reconciliation 2026-05-18 16:59:57 +00:00
63b5fcba67 Add key-based child matching algorithm (reconcileChildren) for fiber reconciliation 2026-05-18 16:56:19 +00:00
021be4644b Merge feat/signal-driven-updates with conflict resolution (reconcile.ts extracted, render re-renderable preserved) 2026-05-18 16:50:59 +00:00
24d0134ae4 Wire signal-driven updates: scheduleUpdate, flushUpdates, reconcileProps, commitEffects, wireSignalToFiber, re-renderable render() 2026-05-18 16:50:08 +00:00
8faa9fc4aa Make Root.render() re-renderable with positional props reconciliation
First render still does a full mount and builds fiber tree. Subsequent
renders reconcile the new UNode tree against existing fibers: compare
props via prepareUpdate, apply changes via commitUpdate. Excess old
children remain (structural changes deferred to Phase 2). Function
components remain transparent during reconciliation.
2026-05-18 16:49:22 +00:00
87ec672641 Refactor mountNode to build fiber tree alongside host instances 2026-05-18 16:46:15 +00:00
d472b9f107 Define Fiber<I> and Effect<I> types in src/host/fiber.ts 2026-05-18 16:43:21 +00:00
614ee05364 Extract key from props in h() for UElement, keep key in props for URoot 2026-05-18 16:41:35 +00:00
822ded6cf1 Add key field to UElement (ADR-004) 2026-05-18 16:39:14 +00:00
3eb1f1d896 port ujsx from Deno-only to cross-platform (Node/Bun/Deno)
Add npm project configuration (package.json, tsconfig.json, tsup, vitest)
matching the taskgraph_ts conventions. All source imports changed from .ts
to .js extensions for Node16 module resolution. Tests migrated from Deno.test
to vitest. Fixed strict type errors (noUncheckedIndexedAccess). Preserved
deno.json with sloppy-imports for dual Deno/Node compatibility.

Subpath exports: schema, h, reactive, context, events, pointer, host,
transform, jsx-runtime — plus barrel export at root.

Build: ESM + CJS dual output via tsup. 22 tests passing.
2026-05-03 08:19:49 +00:00