Merge feat/value-hash-detection: add Value.Hash O(1) change detection with commitHashes (clean merge, no Value.Diff overlap)

This commit is contained in:
2026-05-18 17:40:13 +00:00
parent 6d704f59e0
commit 27c1f2671b
4 changed files with 36 additions and 50 deletions

View File

@@ -81,15 +81,15 @@ describe("Root.render() re-renderable", () => {
expect(divFiber.props.class).toBe("b");
});
it("prepareUpdate is called for changed props on re-render", () => {
const { host, prepareUpdateCalls } = makeHost();
it("commitUpdate is called for changed props on re-render", () => {
const { host, commitUpdateCalls } = makeHost();
const root = createHostRoot(host, {});
root.render(h("div", { class: "old" }, "hello"));
prepareUpdateCalls.length = 0;
commitUpdateCalls.length = 0;
root.render(h("div", { class: "new" }, "hello"));
expect(prepareUpdateCalls.length).toBeGreaterThanOrEqual(1);
const divCall = prepareUpdateCalls.find((c) => c.tag === "div");
expect(commitUpdateCalls.length).toBeGreaterThanOrEqual(1);
const divCall = commitUpdateCalls.find((c) => c.tag === "div");
expect(divCall).toBeDefined();
expect(divCall!.prevProps.class).toBe("old");
expect(divCall!.nextProps.class).toBe("new");