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.
This commit is contained in:
2026-05-18 17:25:02 +00:00
parent 1e0abb0900
commit 23db3775ad
8 changed files with 283 additions and 41 deletions

View File

@@ -70,6 +70,7 @@ export function createRoot<TTag extends string, Instance, RootCtx>(
effect: null,
signalDisposers: [],
prevProps: null,
cachedNode: node,
};
if (parentFiber) parentFiber.children.push(fiber);
return fiber;
@@ -106,6 +107,7 @@ export function createRoot<TTag extends string, Instance, RootCtx>(
effect: null,
signalDisposers: [],
prevProps: null,
cachedNode: node,
};
for (const child of el.children) {
@@ -132,6 +134,7 @@ export function createRoot<TTag extends string, Instance, RootCtx>(
effect: null,
signalDisposers: [],
prevProps: null,
cachedNode: node,
};
}
@@ -158,6 +161,7 @@ export function createRoot<TTag extends string, Instance, RootCtx>(
effect: null,
signalDisposers: [],
prevProps: null,
cachedNode: node,
};
for (const child of el.children) {
@@ -281,6 +285,7 @@ export function createRoot<TTag extends string, Instance, RootCtx>(
effect: null,
signalDisposers: [],
prevProps: null,
cachedNode: null,
};
const payloadChildren = isURoot(node) ? (node as URoot).children : [node];
for (const child of payloadChildren) {