Commit Graph

9 Commits

Author SHA1 Message Date
6d704f59e0 feat: add Value.Hash O(1) change detection before Value.Equal in reconciler
Adds hash field to Fiber<I> for caching FNV-1a hash after each commit.
Hash comparison runs before Value.Equal in reconcileProps for fast bail-out
on unchanged subtrees. Hashes computed during commit phase only (outside
reactive computations) via commitHashes after commitEffects.
2026-05-18 17:38:27 +00:00
47e0e490a2 feat: implement full Root.unmount() with disposeFiber and instance cleanup 2026-05-18 17:31:31 +00:00
4fb70c3f0a Merge feat/value-equal-bailout: add Value.Equal bail-out + cachedNode on Fiber (resolved conflicts with fiber-disposal's disposed field) 2026-05-18 17:26:42 +00:00
23db3775ad feat: add Value.Equal bail-out check before reconciliation
Add TypeBox Value.Equal deep-comparison as first optimization layer
in reconcileProps. When a fiber's cached node is deep-equal to the
next node, skip prepareUpdate, commitUpdate, and children
reconciliation entirely. New cachedNode field on Fiber stores the
last reconciled node for comparison.
2026-05-18 17:25:02 +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
24d0134ae4 Wire signal-driven updates: scheduleUpdate, flushUpdates, reconcileProps, commitEffects, wireSignalToFiber, re-renderable render() 2026-05-18 16:50:08 +00:00
87ec672641 Refactor mountNode to build fiber tree alongside host instances 2026-05-18 16:46:15 +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