[compiler][be] Stabilize compiler output: sort deps and decls by name (#31362)

All dependencies and declarations of a reactive scope can be reordered
to scope start/end. i.e. generated code does not depend on conditional
short-circuiting logic as dependencies are inferred to have no side
effects.

Sorting these by name helps us get higher signal compilation snapshot
diffs when upgrading the compiler and testing PRs
This commit is contained in:
mofeiZ
2024-11-05 18:26:50 -05:00
committed by GitHub
parent 792fa065ca
commit f2f002c7c1
154 changed files with 732 additions and 685 deletions
@@ -34,6 +34,7 @@ import {
ReactiveInstruction,
ReactiveScope,
ReactiveScopeBlock,
ReactiveScopeDeclaration,
ReactiveScopeDependency,
ReactiveTerminal,
ReactiveValue,
@@ -572,7 +573,8 @@ function codegenReactiveScope(
const changeExpressions: Array<t.Expression> = [];
const changeExpressionComments: Array<string> = [];
const outputComments: Array<string> = [];
for (const dep of scope.dependencies) {
for (const dep of [...scope.dependencies].sort(compareScopeDependency)) {
const index = cx.nextCacheIndex;
changeExpressionComments.push(printDependencyComment(dep));
const comparison = t.binaryExpression(
@@ -615,7 +617,10 @@ function codegenReactiveScope(
);
}
let firstOutputIndex: number | null = null;
for (const [, {identifier}] of scope.declarations) {
for (const [, {identifier}] of [...scope.declarations].sort(([, a], [, b]) =>
compareScopeDeclaration(a, b),
)) {
const index = cx.nextCacheIndex;
if (firstOutputIndex === null) {
firstOutputIndex = index;
@@ -2566,3 +2571,45 @@ function convertIdentifier(identifier: Identifier): t.Identifier {
);
return t.identifier(identifier.name.value);
}
function compareScopeDependency(
a: ReactiveScopeDependency,
b: ReactiveScopeDependency,
): number {
CompilerError.invariant(
a.identifier.name?.kind === 'named' && b.identifier.name?.kind === 'named',
{
reason: '[Codegen] Expected named identifier for dependency',
loc: a.identifier.loc,
},
);
const aName = [
a.identifier.name.value,
...a.path.map(entry => `${entry.optional ? '?' : ''}${entry.property}`),
].join('.');
const bName = [
b.identifier.name.value,
...b.path.map(entry => `${entry.optional ? '?' : ''}${entry.property}`),
].join('.');
if (aName < bName) return -1;
else if (aName > bName) return 1;
else return 0;
}
function compareScopeDeclaration(
a: ReactiveScopeDeclaration,
b: ReactiveScopeDeclaration,
): number {
CompilerError.invariant(
a.identifier.name?.kind === 'named' && b.identifier.name?.kind === 'named',
{
reason: '[Codegen] Expected named identifier for declaration',
loc: a.identifier.loc,
},
);
const aName = a.identifier.name.value;
const bName = b.identifier.name.value;
if (aName < bName) return -1;
else if (aName > bName) return 1;
else return 0;
}
@@ -47,7 +47,7 @@ import { identity, mutate, setProperty } from "shared-runtime";
function AllocatingPrimitiveAsDepNested(props) {
const $ = _c(5);
let t0;
if ($[0] !== props.b || $[1] !== props.a) {
if ($[0] !== props.a || $[1] !== props.b) {
const x = {};
mutate(x);
const t1 = identity(props.b) + 1;
@@ -62,8 +62,8 @@ function AllocatingPrimitiveAsDepNested(props) {
const y = t2;
setProperty(x, props.a);
t0 = [x, y];
$[0] = props.b;
$[1] = props.a;
$[0] = props.a;
$[1] = props.b;
$[2] = t0;
} else {
t0 = $[2];
@@ -41,7 +41,7 @@ function ArrayAtTest(props) {
}
const arr = t1;
let t2;
if ($[4] !== props.y || $[5] !== arr) {
if ($[4] !== arr || $[5] !== props.y) {
let t3;
if ($[7] !== props.y) {
t3 = bar(props.y);
@@ -51,8 +51,8 @@ function ArrayAtTest(props) {
t3 = $[8];
}
t2 = arr.at(t3);
$[4] = props.y;
$[5] = arr;
$[4] = arr;
$[5] = props.y;
$[6] = t2;
} else {
t2 = $[6];
@@ -22,10 +22,10 @@ import { c as _c } from "react/compiler-runtime";
function Component(props) {
const $ = _c(3);
let t0;
if ($[0] !== props.foo || $[1] !== props.bar) {
if ($[0] !== props.bar || $[1] !== props.foo) {
t0 = [0, ...props.foo, null, ...props.bar, "z"];
$[0] = props.foo;
$[1] = props.bar;
$[0] = props.bar;
$[1] = props.foo;
$[2] = t0;
} else {
t0 = $[2];
@@ -24,18 +24,18 @@ export const FIXTURE_ENTRYPOINT = {
import { c as _c } from "react/compiler-runtime";
function Component(props) {
const $ = _c(11);
let t0;
let a;
let t0;
if ($[0] !== props.a || $[1] !== props.b) {
a = [props.a, props.b, "hello"];
t0 = a.push(42);
$[0] = props.a;
$[1] = props.b;
$[2] = t0;
$[3] = a;
$[2] = a;
$[3] = t0;
} else {
t0 = $[2];
a = $[3];
a = $[2];
t0 = $[3];
}
const x = t0;
let t1;
@@ -70,10 +70,10 @@ function Component() {
throw new Error("invariant broken");
}
let t1;
if ($[1] !== obj || $[2] !== boxedInner) {
if ($[1] !== boxedInner || $[2] !== obj) {
t1 = <Stringify obj={obj} inner={boxedInner} />;
$[1] = obj;
$[2] = boxedInner;
$[1] = boxedInner;
$[2] = obj;
$[3] = t1;
} else {
t1 = $[3];
@@ -57,16 +57,16 @@ import { identity, mutate } from "shared-runtime";
*/
function Component(props) {
const $ = _c(8);
let t0;
let key;
let t0;
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
key = {};
t0 = (mutate(key), key);
$[0] = t0;
$[1] = key;
$[0] = key;
$[1] = t0;
} else {
t0 = $[0];
key = $[1];
key = $[0];
t0 = $[1];
}
const tmp = t0;
let t1;
@@ -32,7 +32,7 @@ import { mutate } from "shared-runtime";
function component(foo, bar) {
const $ = _c(3);
let x;
if ($[0] !== foo || $[1] !== bar) {
if ($[0] !== bar || $[1] !== foo) {
x = { foo };
const y = { bar };
@@ -41,8 +41,8 @@ function component(foo, bar) {
a.x = b;
mutate(y);
$[0] = foo;
$[1] = bar;
$[0] = bar;
$[1] = foo;
$[2] = x;
} else {
x = $[2];
@@ -24,7 +24,7 @@ import { c as _c } from "react/compiler-runtime";
function component(foo, bar) {
const $ = _c(3);
let x;
if ($[0] !== foo || $[1] !== bar) {
if ($[0] !== bar || $[1] !== foo) {
x = { foo };
const y = { bar };
const f0 = function () {
@@ -35,8 +35,8 @@ function component(foo, bar) {
f0();
mutate(y);
$[0] = foo;
$[1] = bar;
$[0] = bar;
$[1] = foo;
$[2] = x;
} else {
x = $[2];
@@ -32,7 +32,7 @@ const { mutate } = require("shared-runtime");
function component(foo, bar) {
const $ = _c(3);
let x;
if ($[0] !== foo || $[1] !== bar) {
if ($[0] !== bar || $[1] !== foo) {
x = { foo };
const y = { bar };
@@ -41,8 +41,8 @@ function component(foo, bar) {
a.x = b;
mutate(y);
$[0] = foo;
$[1] = bar;
$[0] = bar;
$[1] = foo;
$[2] = x;
} else {
x = $[2];
@@ -24,7 +24,7 @@ import { c as _c } from "react/compiler-runtime";
function component(foo, bar) {
const $ = _c(3);
let x;
if ($[0] !== foo || $[1] !== bar) {
if ($[0] !== bar || $[1] !== foo) {
x = { foo };
const y = { bar };
const f0 = function () {
@@ -35,8 +35,8 @@ function component(foo, bar) {
f0();
mutate(y);
$[0] = foo;
$[1] = bar;
$[0] = bar;
$[1] = foo;
$[2] = x;
} else {
x = $[2];
@@ -32,7 +32,7 @@ const { mutate } = require("shared-runtime");
function component(foo, bar) {
const $ = _c(3);
let y;
if ($[0] !== foo || $[1] !== bar) {
if ($[0] !== bar || $[1] !== foo) {
const x = { foo };
y = { bar };
@@ -41,8 +41,8 @@ function component(foo, bar) {
a.x = b;
mutate(y);
$[0] = foo;
$[1] = bar;
$[0] = bar;
$[1] = foo;
$[2] = y;
} else {
y = $[2];
@@ -24,7 +24,7 @@ import { c as _c } from "react/compiler-runtime";
function component(foo, bar) {
const $ = _c(3);
let y;
if ($[0] !== foo || $[1] !== bar) {
if ($[0] !== bar || $[1] !== foo) {
const x = { foo };
y = { bar };
const f0 = function () {
@@ -35,8 +35,8 @@ function component(foo, bar) {
f0();
mutate(y);
$[0] = foo;
$[1] = bar;
$[0] = bar;
$[1] = foo;
$[2] = y;
} else {
y = $[2];
@@ -32,7 +32,7 @@ const { mutate } = require("shared-runtime");
function component(foo, bar) {
const $ = _c(3);
let y;
if ($[0] !== foo || $[1] !== bar) {
if ($[0] !== bar || $[1] !== foo) {
const x = { foo };
y = { bar };
@@ -41,8 +41,8 @@ function component(foo, bar) {
a.x = b;
mutate(y);
$[0] = foo;
$[1] = bar;
$[0] = bar;
$[1] = foo;
$[2] = y;
} else {
y = $[2];
@@ -24,7 +24,7 @@ import { c as _c } from "react/compiler-runtime";
function component(foo, bar) {
const $ = _c(3);
let y;
if ($[0] !== foo || $[1] !== bar) {
if ($[0] !== bar || $[1] !== foo) {
const x = { foo };
y = { bar };
const f0 = function () {
@@ -35,8 +35,8 @@ function component(foo, bar) {
f0();
mutate(y);
$[0] = foo;
$[1] = bar;
$[0] = bar;
$[1] = foo;
$[2] = y;
} else {
y = $[2];
@@ -46,10 +46,10 @@ function component(t0) {
}
const hide = t2;
let t3;
if ($[4] !== poke || $[5] !== hide) {
if ($[4] !== hide || $[5] !== poke) {
t3 = <Foo poke={poke} hide={hide} />;
$[4] = poke;
$[5] = hide;
$[4] = hide;
$[5] = poke;
$[6] = t3;
} else {
t3 = $[6];
@@ -46,7 +46,7 @@ function Component(props) {
const items = props.items;
const maxItems = props.maxItems;
let renderedItems;
if ($[0] !== maxItems || $[1] !== items) {
if ($[0] !== items || $[1] !== maxItems) {
renderedItems = [];
const seen = new Set();
const max = Math.max(0, maxItems);
@@ -62,8 +62,8 @@ function Component(props) {
break;
}
}
$[0] = maxItems;
$[1] = items;
$[0] = items;
$[1] = maxItems;
$[2] = renderedItems;
} else {
renderedItems = $[2];
@@ -79,15 +79,15 @@ function Component(props) {
t0 = $[4];
}
let t1;
if ($[5] !== t0 || $[6] !== renderedItems) {
if ($[5] !== renderedItems || $[6] !== t0) {
t1 = (
<div>
{t0}
{renderedItems}
</div>
);
$[5] = t0;
$[6] = renderedItems;
$[5] = renderedItems;
$[6] = t0;
$[7] = t1;
} else {
t1 = $[7];
@@ -16,11 +16,11 @@ import { c as _c } from "react/compiler-runtime";
function Component(props) {
const $ = _c(4);
let t0;
if ($[0] !== props.method || $[1] !== props.a || $[2] !== props.b) {
if ($[0] !== props.a || $[1] !== props.b || $[2] !== props.method) {
t0 = foo[props.method](...props.a, null, ...props.b);
$[0] = props.method;
$[1] = props.a;
$[2] = props.b;
$[0] = props.a;
$[1] = props.b;
$[2] = props.method;
$[3] = t0;
} else {
t0 = $[3];
@@ -41,7 +41,7 @@ function foo(a, b) {
x = $[1];
}
let y;
if ($[2] !== x || $[3] !== b) {
if ($[2] !== b || $[3] !== x) {
y = [];
if (x.length) {
y.push(x);
@@ -49,8 +49,8 @@ function foo(a, b) {
if (b) {
y.push(b);
}
$[2] = x;
$[3] = b;
$[2] = b;
$[3] = x;
$[4] = y;
} else {
y = $[4];
@@ -61,11 +61,11 @@ function useFoo(props) {
z = $[4];
}
let t0;
if ($[5] !== x || $[6] !== y || $[7] !== myList) {
if ($[5] !== myList || $[6] !== x || $[7] !== y) {
t0 = { x, y, myList };
$[5] = x;
$[6] = y;
$[7] = myList;
$[5] = myList;
$[6] = x;
$[7] = y;
$[8] = t0;
} else {
t0 = $[8];
@@ -41,10 +41,10 @@ function Component(props) {
}
const sameName = t1;
let t2;
if ($[2] !== sameName || $[3] !== renamed) {
if ($[2] !== renamed || $[3] !== sameName) {
t2 = [sameName, renamed];
$[2] = sameName;
$[3] = renamed;
$[2] = renamed;
$[3] = sameName;
$[4] = t2;
} else {
t2 = $[4];
@@ -36,45 +36,45 @@ export const FIXTURE_ENTRYPOINT = {
import { c as _c } from "react/compiler-runtime";
function foo(a, b, c) {
const $ = _c(18);
let t0;
let d;
let h;
let t0;
if ($[0] !== a) {
[d, t0, ...h] = a;
$[0] = a;
$[1] = t0;
$[2] = d;
$[3] = h;
$[1] = d;
$[2] = h;
$[3] = t0;
} else {
t0 = $[1];
d = $[2];
h = $[3];
d = $[1];
h = $[2];
t0 = $[3];
}
const [t1] = t0;
let t2;
let g;
let t2;
if ($[4] !== t1) {
({ e: t2, ...g } = t1);
$[4] = t1;
$[5] = t2;
$[6] = g;
$[5] = g;
$[6] = t2;
} else {
t2 = $[5];
g = $[6];
g = $[5];
t2 = $[6];
}
const { f } = t2;
const { l: t3, p } = b;
const { m: t4 } = t3;
let t5;
let o;
let t5;
if ($[7] !== t4) {
[t5, ...o] = t4;
$[7] = t4;
$[8] = t5;
$[9] = o;
$[8] = o;
$[9] = t5;
} else {
t5 = $[8];
o = $[9];
o = $[8];
t5 = $[9];
}
const [n] = t5;
let t6;
@@ -53,8 +53,8 @@ import { ValidateMemoization } from "shared-runtime";
function Component(t0) {
const $ = _c(25);
const { a, b, c } = t0;
let y;
let x;
let y;
if ($[0] !== a || $[1] !== b || $[2] !== c) {
x = [];
if (a) {
@@ -73,11 +73,11 @@ function Component(t0) {
$[0] = a;
$[1] = b;
$[2] = c;
$[3] = y;
$[4] = x;
$[3] = x;
$[4] = y;
} else {
y = $[3];
x = $[4];
x = $[3];
y = $[4];
}
let t1;
if ($[7] !== y) {
@@ -61,10 +61,10 @@ function Component(props) {
t2 = $[3];
}
let t3;
if ($[4] !== t2 || $[5] !== array) {
if ($[4] !== array || $[5] !== t2) {
t3 = <ValidateMemoization inputs={t2} output={array} />;
$[4] = t2;
$[5] = array;
$[4] = array;
$[5] = t2;
$[6] = t3;
} else {
t3 = $[6];
@@ -59,10 +59,10 @@ function Component(props) {
t3 = $[4];
}
let t4;
if ($[5] !== t3 || $[6] !== doubled) {
if ($[5] !== doubled || $[6] !== t3) {
t4 = <ValidateMemoization inputs={t3} output={doubled} />;
$[5] = t3;
$[6] = doubled;
$[5] = doubled;
$[6] = t3;
$[7] = t4;
} else {
t4 = $[7];
@@ -61,10 +61,10 @@ function Component(t0) {
t3 = $[3];
}
let t4;
if ($[4] !== t3 || $[5] !== el) {
if ($[4] !== el || $[5] !== t3) {
t4 = <ValidateMemoization inputs={t3} output={el} />;
$[4] = t3;
$[5] = el;
$[4] = el;
$[5] = t3;
$[6] = t4;
} else {
t4 = $[6];
@@ -32,7 +32,7 @@ function Component(t0) {
const $ = _c(4);
const { name, data, icon } = t0;
let t1;
if ($[0] !== name || $[1] !== icon || $[2] !== data) {
if ($[0] !== data || $[1] !== icon || $[2] !== name) {
t1 = (
<Text type="body4">
{fbt._(
@@ -61,9 +61,9 @@ function Component(t0) {
)}
</Text>
);
$[0] = name;
$[0] = data;
$[1] = icon;
$[2] = data;
$[2] = name;
$[3] = t1;
} else {
t1 = $[3];
@@ -67,7 +67,7 @@ const TOTAL = 10;
function Component(props) {
const $ = _c(3);
let t0;
if ($[0] !== props.start || $[1] !== props.items) {
if ($[0] !== props.items || $[1] !== props.start) {
const items = [];
for (let i = props.start ?? 0; i < props.items.length; i++) {
const item = props.items[i];
@@ -75,8 +75,8 @@ function Component(props) {
}
t0 = <div>{items}</div>;
$[0] = props.start;
$[1] = props.items;
$[0] = props.items;
$[1] = props.start;
$[2] = t0;
} else {
t0 = $[2];
@@ -91,10 +91,10 @@ function Component(t0) {
t5 = $[9];
}
let t6;
if ($[10] !== x || $[11] !== b) {
if ($[10] !== b || $[11] !== x) {
t6 = [x, b];
$[10] = x;
$[11] = b;
$[10] = b;
$[11] = x;
$[12] = t6;
} else {
t6 = $[12];
@@ -59,10 +59,10 @@ function Component(props) {
t1 = $[3];
}
let t2;
if ($[4] !== t1 || $[5] !== a_0) {
if ($[4] !== a_0 || $[5] !== t1) {
t2 = <ValidateMemoization inputs={t1} output={a_0} />;
$[4] = t1;
$[5] = a_0;
$[4] = a_0;
$[5] = t1;
$[6] = t2;
} else {
t2 = $[6];
@@ -36,10 +36,10 @@ function Component(t0) {
}
const f = t1;
let t2;
if ($[2] !== props || $[3] !== f) {
if ($[2] !== f || $[3] !== props) {
t2 = props == null ? _temp : f;
$[2] = props;
$[3] = f;
$[2] = f;
$[3] = props;
$[4] = t2;
} else {
t2 = $[4];
@@ -36,10 +36,10 @@ function Component(props) {
}
const getLength = t0;
let t1;
if ($[2] !== props.bar || $[3] !== getLength) {
if ($[2] !== getLength || $[3] !== props.bar) {
t1 = props.bar && getLength();
$[2] = props.bar;
$[3] = getLength;
$[2] = getLength;
$[3] = props.bar;
$[4] = t1;
} else {
t1 = $[4];
@@ -56,10 +56,10 @@ function Component() {
t0 = $[1];
}
let t1;
if ($[2] !== t0 || $[3] !== state) {
if ($[2] !== state || $[3] !== t0) {
t1 = <div onClick={t0}>{state}</div>;
$[2] = t0;
$[3] = state;
$[2] = state;
$[3] = t0;
$[4] = t1;
} else {
t1 = $[4];
@@ -41,10 +41,10 @@ function Component(props) {
console.log(props);
}, [props.a]);
let t1;
if ($[2] !== x || $[3] !== item) {
if ($[2] !== item || $[3] !== x) {
t1 = [x, item];
$[2] = x;
$[3] = item;
$[2] = item;
$[3] = x;
$[4] = t1;
} else {
t1 = $[4];
@@ -73,15 +73,15 @@ function Component() {
t1 = $[4];
}
let t3;
if ($[5] !== t2 || $[6] !== json) {
if ($[5] !== json || $[6] !== t2) {
t3 = (
<div>
{t2}
{json}
</div>
);
$[5] = t2;
$[6] = json;
$[5] = json;
$[6] = t2;
$[7] = t3;
} else {
t3 = $[7];
@@ -29,22 +29,22 @@ import { Stringify } from "shared-runtime";
function Component(t0) {
const $ = _c(4);
let t1;
let a;
let b;
let t1;
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
a = "a";
const [t2, t3] = [null, null];
t1 = t3;
a = t2;
$[0] = t1;
$[1] = a;
$[2] = b;
$[0] = a;
$[1] = b;
$[2] = t1;
} else {
t1 = $[0];
a = $[1];
b = $[2];
a = $[0];
b = $[1];
t1 = $[2];
}
b = t1;
let t2;
@@ -27,10 +27,10 @@ function Component(props) {
const $ = _c(15);
const item = useFragment(FRAGMENT, props.item);
useFreeze(item);
let t0;
let T0;
let t1;
let T1;
let t0;
let t1;
if ($[0] !== item) {
const count = new MaybeMutable(item);
@@ -44,15 +44,15 @@ function Component(props) {
}
t0 = maybeMutate(count);
$[0] = item;
$[1] = t0;
$[2] = T0;
$[3] = t1;
$[4] = T1;
$[1] = T0;
$[2] = T1;
$[3] = t0;
$[4] = t1;
} else {
t0 = $[1];
T0 = $[2];
t1 = $[3];
T1 = $[4];
T0 = $[1];
T1 = $[2];
t0 = $[3];
t1 = $[4];
}
let t2;
if ($[6] !== t0) {
@@ -83,10 +83,10 @@ function _temp(t0) {
t1 = $[1];
}
let t2;
if ($[2] !== x || $[3] !== t1) {
if ($[2] !== t1 || $[3] !== x) {
t2 = <Bar x={x}>{t1}</Bar>;
$[2] = x;
$[3] = t1;
$[2] = t1;
$[3] = x;
$[4] = t2;
} else {
t2 = $[4];
@@ -98,15 +98,15 @@ function Bar(t0) {
const $ = _c(3);
const { x, children } = t0;
let t1;
if ($[0] !== x || $[1] !== children) {
if ($[0] !== children || $[1] !== x) {
t1 = (
<>
{x}
{children}
</>
);
$[0] = x;
$[1] = children;
$[0] = children;
$[1] = x;
$[2] = t1;
} else {
t1 = $[2];
@@ -52,7 +52,7 @@ function Component(t0) {
const { arr } = t0;
const x = useX();
let t1;
if ($[0] !== x || $[1] !== arr) {
if ($[0] !== arr || $[1] !== x) {
let t2;
if ($[3] !== x) {
t2 = (i, id) => {
@@ -66,8 +66,8 @@ function Component(t0) {
t2 = $[4];
}
t1 = arr.map(t2);
$[0] = x;
$[1] = arr;
$[0] = arr;
$[1] = x;
$[2] = t1;
} else {
t1 = $[2];
@@ -94,10 +94,10 @@ function _temp(t0) {
t1 = $[1];
}
let t2;
if ($[2] !== x || $[3] !== t1) {
if ($[2] !== t1 || $[3] !== x) {
t2 = <Bar x={x}>{t1}</Bar>;
$[2] = x;
$[3] = t1;
$[2] = t1;
$[3] = x;
$[4] = t2;
} else {
t2 = $[4];
@@ -109,15 +109,15 @@ function Bar(t0) {
const $ = _c(3);
const { x, children } = t0;
let t1;
if ($[0] !== x || $[1] !== children) {
if ($[0] !== children || $[1] !== x) {
t1 = (
<>
{x}
{children}
</>
);
$[0] = x;
$[1] = children;
$[0] = children;
$[1] = x;
$[2] = t1;
} else {
t1 = $[2];
@@ -60,7 +60,7 @@ function Component(t0) {
const { arr } = t0;
const x = useX();
let t1;
if ($[0] !== x || $[1] !== arr) {
if ($[0] !== arr || $[1] !== x) {
let t2;
if ($[3] !== x) {
t2 = (i, id) => {
@@ -73,8 +73,8 @@ function Component(t0) {
t2 = $[4];
}
t1 = arr.map(t2);
$[0] = x;
$[1] = arr;
$[0] = arr;
$[1] = x;
$[2] = t1;
} else {
t1 = $[2];
@@ -117,7 +117,7 @@ function _temp(t0) {
t3 = $[5];
}
let t4;
if ($[6] !== x || $[7] !== t1 || $[8] !== t2 || $[9] !== t3) {
if ($[6] !== t1 || $[7] !== t2 || $[8] !== t3 || $[9] !== x) {
t4 = (
<Bar x={x}>
{t1}
@@ -125,10 +125,10 @@ function _temp(t0) {
{t3}
</Bar>
);
$[6] = x;
$[7] = t1;
$[8] = t2;
$[9] = t3;
$[6] = t1;
$[7] = t2;
$[8] = t3;
$[9] = x;
$[10] = t4;
} else {
t4 = $[10];
@@ -140,15 +140,15 @@ function Bar(t0) {
const $ = _c(3);
const { x, children } = t0;
let t1;
if ($[0] !== x || $[1] !== children) {
if ($[0] !== children || $[1] !== x) {
t1 = (
<>
{x}
{children}
</>
);
$[0] = x;
$[1] = children;
$[0] = children;
$[1] = x;
$[2] = t1;
} else {
t1 = $[2];
@@ -50,7 +50,7 @@ function Component(t0) {
const { arr } = t0;
const x = useX();
let t1;
if ($[0] !== x || $[1] !== arr) {
if ($[0] !== arr || $[1] !== x) {
let t2;
if ($[3] !== x) {
t2 = (i, id) => {
@@ -63,8 +63,8 @@ function Component(t0) {
t2 = $[4];
}
t1 = arr.map(t2);
$[0] = x;
$[1] = arr;
$[0] = arr;
$[1] = x;
$[2] = t1;
} else {
t1 = $[2];
@@ -91,10 +91,10 @@ function _temp(t0) {
t1 = $[1];
}
let t2;
if ($[2] !== x || $[3] !== t1) {
if ($[2] !== t1 || $[3] !== x) {
t2 = <Bar x={x}>{t1}</Bar>;
$[2] = x;
$[3] = t1;
$[2] = t1;
$[3] = x;
$[4] = t2;
} else {
t2 = $[4];
@@ -106,15 +106,15 @@ function Bar(t0) {
const $ = _c(3);
const { x, children } = t0;
let t1;
if ($[0] !== x || $[1] !== children) {
if ($[0] !== children || $[1] !== x) {
t1 = (
<>
{x}
{children}
</>
);
$[0] = x;
$[1] = children;
$[0] = children;
$[1] = x;
$[2] = t1;
} else {
t1 = $[2];
@@ -53,23 +53,23 @@ function maybeMutate(x) {}
function Component(props) {
const $ = _c(11);
let Tag;
let T0;
let Tag;
let t0;
if ($[0] !== props.component || $[1] !== props.alternateComponent) {
if ($[0] !== props.alternateComponent || $[1] !== props.component) {
const maybeMutable = new MaybeMutable();
Tag = props.component;
T0 = Tag;
t0 = ((Tag = props.alternateComponent), maybeMutate(maybeMutable));
$[0] = props.component;
$[1] = props.alternateComponent;
$[2] = Tag;
$[3] = T0;
$[0] = props.alternateComponent;
$[1] = props.component;
$[2] = T0;
$[3] = Tag;
$[4] = t0;
} else {
Tag = $[2];
T0 = $[3];
T0 = $[2];
Tag = $[3];
t0 = $[4];
}
let t1;
@@ -44,7 +44,7 @@ function CaptureNotMutate(props) {
}
const idx = t0;
let aliasedElement;
if ($[2] !== props.el || $[3] !== idx) {
if ($[2] !== idx || $[3] !== props.el) {
const element = bar(props.el);
const fn = function () {
@@ -54,8 +54,8 @@ function CaptureNotMutate(props) {
aliasedElement = fn();
mutate(aliasedElement);
$[2] = props.el;
$[3] = idx;
$[2] = idx;
$[3] = props.el;
$[4] = aliasedElement;
} else {
aliasedElement = $[4];
@@ -21,10 +21,10 @@ function App() {
const { foo } = useContext_withSelector(MyContext, _temp);
const { bar } = useContext_withSelector(MyContext, _temp2);
let t0;
if ($[0] !== foo || $[1] !== bar) {
if ($[0] !== bar || $[1] !== foo) {
t0 = <Bar foo={foo} bar={bar} />;
$[0] = foo;
$[1] = bar;
$[0] = bar;
$[1] = foo;
$[2] = t0;
} else {
t0 = $[2];
@@ -19,10 +19,10 @@ function App() {
const $ = _c(3);
const { foo, bar } = useContext_withSelector(MyContext, _temp);
let t0;
if ($[0] !== foo || $[1] !== bar) {
if ($[0] !== bar || $[1] !== foo) {
t0 = <Bar foo={foo} bar={bar} />;
$[0] = foo;
$[1] = bar;
$[0] = bar;
$[1] = foo;
$[2] = t0;
} else {
t0 = $[2];
@@ -60,7 +60,7 @@ function Component() {
t2 = $[3];
}
let t3;
if ($[4] !== t1 || $[5] !== t0) {
if ($[4] !== t0 || $[5] !== t1) {
t3 = (
<div>
{t2}
@@ -68,8 +68,8 @@ function Component() {
{t0}
</div>
);
$[4] = t1;
$[5] = t0;
$[4] = t0;
$[5] = t1;
$[6] = t3;
} else {
t3 = $[6];
@@ -43,11 +43,11 @@ function foo(a, b, c) {
}
const y = t1;
let t2;
if ($[4] !== x || $[5] !== y.method || $[6] !== b) {
if ($[4] !== b || $[5] !== x || $[6] !== y.method) {
t2 = x[y.method](b);
$[4] = x;
$[5] = y.method;
$[6] = b;
$[4] = b;
$[5] = x;
$[6] = y.method;
$[7] = t2;
} else {
t2 = $[7];
@@ -33,11 +33,11 @@ function foo(a, b, c) {
const method = x.method;
let t1;
if ($[2] !== method || $[3] !== x || $[4] !== b) {
if ($[2] !== b || $[3] !== method || $[4] !== x) {
t1 = method.call(x, b);
$[2] = method;
$[3] = x;
$[4] = b;
$[2] = b;
$[3] = method;
$[4] = x;
$[5] = t1;
} else {
t1 = $[5];
@@ -40,10 +40,10 @@ function foo(a, b, c) {
}
const x = t0;
let t1;
if ($[2] !== x || $[3] !== b) {
if ($[2] !== b || $[3] !== x) {
t1 = x.foo(b);
$[2] = x;
$[3] = b;
$[2] = b;
$[3] = x;
$[4] = t1;
} else {
t1 = $[4];
@@ -73,8 +73,8 @@ import { identity, mutate } from "shared-runtime";
function useFoo(t0) {
const $ = _c(4);
const { a, b } = t0;
let z;
let y;
let z;
if ($[0] !== a || $[1] !== b) {
const x = { a };
y = {};
@@ -83,11 +83,11 @@ function useFoo(t0) {
mutate(y);
$[0] = a;
$[1] = b;
$[2] = z;
$[3] = y;
$[2] = y;
$[3] = z;
} else {
z = $[2];
y = $[3];
y = $[2];
z = $[3];
}
if (z[0] !== y) {
throw new Error("oh no!");
@@ -40,7 +40,7 @@ function useHook(t0) {
const { value } = t0;
const [state] = useState(false);
let t1;
if ($[0] !== value || $[1] !== state) {
if ($[0] !== state || $[1] !== value) {
t1 = {
getX() {
return {
@@ -52,8 +52,8 @@ function useHook(t0) {
};
},
};
$[0] = value;
$[1] = state;
$[0] = state;
$[1] = value;
$[2] = t1;
} else {
t1 = $[2];
@@ -63,10 +63,10 @@ function Component(t0) {
t4 = $[3];
}
let t5;
if ($[4] !== t4 || $[5] !== data) {
if ($[4] !== data || $[5] !== t4) {
t5 = <ValidateMemoization inputs={t4} output={data} />;
$[4] = t4;
$[5] = data;
$[4] = data;
$[5] = t4;
$[6] = t5;
} else {
t5 = $[6];
@@ -45,10 +45,10 @@ function Component(props) {
t1 = $[3];
}
let t2;
if ($[4] !== t1 || $[5] !== data) {
if ($[4] !== data || $[5] !== t1) {
t2 = <ValidateMemoization inputs={t1} output={data} />;
$[4] = t1;
$[5] = data;
$[4] = data;
$[5] = t1;
$[6] = t2;
} else {
t2 = $[6];
@@ -60,10 +60,10 @@ function Component(t0) {
t3 = $[3];
}
let t4;
if ($[4] !== t3 || $[5] !== data) {
if ($[4] !== data || $[5] !== t3) {
t4 = <ValidateMemoization inputs={t3} output={data} />;
$[4] = t3;
$[5] = data;
$[4] = data;
$[5] = t3;
$[6] = t4;
} else {
t4 = $[6];
@@ -48,19 +48,19 @@ function Component(props) {
const t1 = props?.items;
let t2;
if ($[3] !== t1 || $[4] !== props.cond) {
if ($[3] !== props.cond || $[4] !== t1) {
t2 = [t1, props.cond];
$[3] = t1;
$[4] = props.cond;
$[3] = props.cond;
$[4] = t1;
$[5] = t2;
} else {
t2 = $[5];
}
let t3;
if ($[6] !== t2 || $[7] !== data) {
if ($[6] !== data || $[7] !== t2) {
t3 = <ValidateMemoization inputs={t2} output={data} />;
$[6] = t2;
$[7] = data;
$[6] = data;
$[7] = t2;
$[8] = t3;
} else {
t3 = $[8];
@@ -48,19 +48,19 @@ function Component(props) {
const t1 = props?.items;
let t2;
if ($[3] !== t1 || $[4] !== props.cond) {
if ($[3] !== props.cond || $[4] !== t1) {
t2 = [t1, props.cond];
$[3] = t1;
$[4] = props.cond;
$[3] = props.cond;
$[4] = t1;
$[5] = t2;
} else {
t2 = $[5];
}
let t3;
if ($[6] !== t2 || $[7] !== data) {
if ($[6] !== data || $[7] !== t2) {
t3 = <ValidateMemoization inputs={t2} output={data} />;
$[6] = t2;
$[7] = data;
$[6] = data;
$[7] = t2;
$[8] = t3;
} else {
t3 = $[8];
@@ -31,8 +31,8 @@ export const FIXTURE_ENTRYPOINT = {
import { c as _c } from "react/compiler-runtime";
function Component(props) {
const $ = _c(4);
let y;
let t0;
let y;
if ($[0] !== props) {
t0 = Symbol.for("react.early_return_sentinel");
bb0: {
@@ -57,11 +57,11 @@ function Component(props) {
}
}
$[0] = props;
$[1] = y;
$[2] = t0;
$[1] = t0;
$[2] = y;
} else {
y = $[1];
t0 = $[2];
t0 = $[1];
y = $[2];
}
if (t0 !== Symbol.for("react.early_return_sentinel")) {
return t0;
@@ -40,7 +40,7 @@ function useFoo(minWidth, otherProp) {
const $ = _c(7);
const [width] = useState(1);
let t0;
if ($[0] !== width || $[1] !== minWidth || $[2] !== otherProp) {
if ($[0] !== minWidth || $[1] !== otherProp || $[2] !== width) {
const x = [];
let t1;
if ($[4] !== minWidth || $[5] !== width) {
@@ -55,9 +55,9 @@ function useFoo(minWidth, otherProp) {
arrayPush(x, otherProp);
t0 = [style, x];
$[0] = width;
$[1] = minWidth;
$[2] = otherProp;
$[0] = minWidth;
$[1] = otherProp;
$[2] = width;
$[3] = t0;
} else {
t0 = $[3];
@@ -42,9 +42,9 @@ import { Stringify } from "shared-runtime";
function Foo(t0) {
const $ = _c(8);
const { arr1, arr2, foo } = t0;
let t1;
let getVal1;
if ($[0] !== arr1 || $[1] !== foo || $[2] !== arr2) {
let t1;
if ($[0] !== arr1 || $[1] !== arr2 || $[2] !== foo) {
const x = [arr1];
let y;
@@ -55,13 +55,13 @@ function Foo(t0) {
t1 = () => [y];
foo ? (y = x.concat(arr2)) : y;
$[0] = arr1;
$[1] = foo;
$[2] = arr2;
$[3] = t1;
$[4] = getVal1;
$[1] = arr2;
$[2] = foo;
$[3] = getVal1;
$[4] = t1;
} else {
t1 = $[3];
getVal1 = $[4];
getVal1 = $[3];
t1 = $[4];
}
const getVal2 = t1;
let t2;
@@ -44,10 +44,10 @@ function Component(t0) {
t3 = $[1];
}
let t4;
if ($[2] !== t3 || $[3] !== propA) {
if ($[2] !== propA || $[3] !== t3) {
t4 = { value: t3, other: propA };
$[2] = t3;
$[3] = propA;
$[2] = propA;
$[3] = t3;
$[4] = t4;
} else {
t4 = $[4];
@@ -34,10 +34,10 @@ function Component(t0) {
const t2 = propB?.x.y;
let t3;
if ($[0] !== t2 || $[1] !== propA) {
if ($[0] !== propA || $[1] !== t2) {
t3 = { value: t2, other: propA };
$[0] = t2;
$[1] = propA;
$[0] = propA;
$[1] = t2;
$[2] = t3;
} else {
t3 = $[2];
@@ -40,7 +40,7 @@ function useFoo(minWidth, otherProp) {
const $ = _c(6);
const [width] = useState(1);
let t0;
if ($[0] !== width || $[1] !== minWidth || $[2] !== otherProp) {
if ($[0] !== minWidth || $[1] !== otherProp || $[2] !== width) {
const x = [];
let t1;
@@ -58,9 +58,9 @@ function useFoo(minWidth, otherProp) {
arrayPush(x, otherProp);
t0 = [style, x];
$[0] = width;
$[1] = minWidth;
$[2] = otherProp;
$[0] = minWidth;
$[1] = otherProp;
$[2] = width;
$[3] = t0;
} else {
t0 = $[3];
@@ -44,7 +44,7 @@ function Foo(t0) {
const { arr1, arr2, foo } = t0;
let t1;
let val1;
if ($[0] !== arr1 || $[1] !== foo || $[2] !== arr2) {
if ($[0] !== arr1 || $[1] !== arr2 || $[2] !== foo) {
const x = [arr1];
let y;
@@ -63,8 +63,8 @@ function Foo(t0) {
foo ? (y = x.concat(arr2)) : y;
t1 = (() => [y])();
$[0] = arr1;
$[1] = foo;
$[2] = arr2;
$[1] = arr2;
$[2] = foo;
$[3] = t1;
$[4] = val1;
} else {
@@ -49,7 +49,7 @@ import { identity, mutate, setProperty } from "shared-runtime";
function PrimitiveAsDepNested(props) {
const $ = _c(5);
let t0;
if ($[0] !== props.b || $[1] !== props.a) {
if ($[0] !== props.a || $[1] !== props.b) {
const x = {};
mutate(x);
const t1 = props.b + 1;
@@ -64,8 +64,8 @@ function PrimitiveAsDepNested(props) {
const y = t2;
setProperty(x, props.a);
t0 = [x, y];
$[0] = props.b;
$[1] = props.a;
$[0] = props.a;
$[1] = props.b;
$[2] = t0;
} else {
t0 = $[2];
@@ -32,15 +32,15 @@ function Component(t0) {
const $ = _c(5);
const { base, start, increment, test } = t0;
let value;
if ($[0] !== base || $[1] !== start || $[2] !== test || $[3] !== increment) {
if ($[0] !== base || $[1] !== increment || $[2] !== start || $[3] !== test) {
value = base;
for (let i = start; i < test; i = i + increment, i) {
value = value + i;
}
$[0] = base;
$[1] = start;
$[2] = test;
$[3] = increment;
$[1] = increment;
$[2] = start;
$[3] = test;
$[4] = value;
} else {
value = $[4];
@@ -34,7 +34,7 @@ import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR
function Component(props) {
const $ = _c(7);
let t0;
if ($[0] !== props.cond || $[1] !== props.a || $[2] !== props.b) {
if ($[0] !== props.a || $[1] !== props.b || $[2] !== props.cond) {
t0 = Symbol.for("react.early_return_sentinel");
bb0: {
const x = [];
@@ -69,9 +69,9 @@ function Component(props) {
break bb0;
}
}
$[0] = props.cond;
$[1] = props.a;
$[2] = props.b;
$[0] = props.a;
$[1] = props.b;
$[2] = props.cond;
$[3] = t0;
} else {
t0 = $[3];
@@ -48,7 +48,7 @@ import { makeArray } from "shared-runtime";
function Component(props) {
const $ = _c(6);
let t0;
if ($[0] !== props.cond || $[1] !== props.a || $[2] !== props.b) {
if ($[0] !== props.a || $[1] !== props.b || $[2] !== props.cond) {
t0 = Symbol.for("react.early_return_sentinel");
bb0: {
const x = [];
@@ -69,9 +69,9 @@ function Component(props) {
break bb0;
}
}
$[0] = props.cond;
$[1] = props.a;
$[2] = props.b;
$[0] = props.a;
$[1] = props.b;
$[2] = props.cond;
$[3] = t0;
} else {
t0 = $[3];
@@ -29,7 +29,7 @@ import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR
function Component(props) {
const $ = _c(3);
let items;
if ($[0] !== props.cond || $[1] !== props.a) {
if ($[0] !== props.a || $[1] !== props.cond) {
let t0;
if (props.cond) {
t0 = [];
@@ -39,8 +39,8 @@ function Component(props) {
items = t0;
items?.push(props.a);
$[0] = props.cond;
$[1] = props.a;
$[0] = props.a;
$[1] = props.cond;
$[2] = items;
} else {
items = $[2];
@@ -63,10 +63,10 @@ function Component(t0) {
t4 = $[3];
}
let t5;
if ($[4] !== t4 || $[5] !== data) {
if ($[4] !== data || $[5] !== t4) {
t5 = <ValidateMemoization inputs={t4} output={data} />;
$[4] = t4;
$[5] = data;
$[4] = data;
$[5] = t4;
$[6] = t5;
} else {
t5 = $[6];
@@ -45,10 +45,10 @@ function Component(props) {
t1 = $[3];
}
let t2;
if ($[4] !== t1 || $[5] !== data) {
if ($[4] !== data || $[5] !== t1) {
t2 = <ValidateMemoization inputs={t1} output={data} />;
$[4] = t1;
$[5] = data;
$[4] = data;
$[5] = t1;
$[6] = t2;
} else {
t2 = $[6];
@@ -60,10 +60,10 @@ function Component(t0) {
t3 = $[3];
}
let t4;
if ($[4] !== t3 || $[5] !== data) {
if ($[4] !== data || $[5] !== t3) {
t4 = <ValidateMemoization inputs={t3} output={data} />;
$[4] = t3;
$[5] = data;
$[4] = data;
$[5] = t3;
$[6] = t4;
} else {
t4 = $[6];
@@ -32,9 +32,9 @@ export const FIXTURE_ENTRYPOINT = {
import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR
function Component(props) {
const $ = _c(6);
let y;
let t0;
if ($[0] !== props.cond || $[1] !== props.a || $[2] !== props.b) {
let y;
if ($[0] !== props.a || $[1] !== props.b || $[2] !== props.cond) {
t0 = Symbol.for("react.early_return_sentinel");
bb0: {
const x = [];
@@ -57,14 +57,14 @@ function Component(props) {
}
}
}
$[0] = props.cond;
$[1] = props.a;
$[2] = props.b;
$[3] = y;
$[4] = t0;
$[0] = props.a;
$[1] = props.b;
$[2] = props.cond;
$[3] = t0;
$[4] = y;
} else {
y = $[3];
t0 = $[4];
t0 = $[3];
y = $[4];
}
if (t0 !== Symbol.for("react.early_return_sentinel")) {
return t0;
@@ -42,7 +42,7 @@ function Component(props) {
}
const x = t0;
let t1;
if ($[1] !== props.cond || $[2] !== props.a) {
if ($[1] !== props.a || $[2] !== props.cond) {
let y;
if (props.cond) {
y = {};
@@ -53,8 +53,8 @@ function Component(props) {
y.x = x;
t1 = [x, y];
$[1] = props.cond;
$[2] = props.a;
$[1] = props.a;
$[2] = props.cond;
$[3] = t1;
} else {
t1 = $[3];
@@ -58,7 +58,7 @@ function useFoo(t0) {
local = $[1];
}
let t1;
if ($[2] !== shouldReadA || $[3] !== local) {
if ($[2] !== local || $[3] !== shouldReadA) {
t1 = (
<Stringify
fn={() => {
@@ -70,8 +70,8 @@ function useFoo(t0) {
shouldInvokeFns={true}
/>
);
$[2] = shouldReadA;
$[3] = local;
$[2] = local;
$[3] = shouldReadA;
$[4] = t1;
} else {
t1 = $[4];
@@ -41,7 +41,7 @@ function Foo(t0) {
const $ = _c(3);
const { a, shouldReadA } = t0;
let t1;
if ($[0] !== shouldReadA || $[1] !== a) {
if ($[0] !== a || $[1] !== shouldReadA) {
t1 = (
<Stringify
fn={() => {
@@ -53,8 +53,8 @@ function Foo(t0) {
shouldInvokeFns={true}
/>
);
$[0] = shouldReadA;
$[1] = a;
$[0] = a;
$[1] = shouldReadA;
$[2] = t1;
} else {
t1 = $[2];
@@ -51,13 +51,13 @@ function Foo(t0) {
const fn = t1;
useIdentity(null);
let x;
if ($[2] !== cond || $[3] !== a.b.c) {
if ($[2] !== a.b.c || $[3] !== cond) {
x = makeArray();
if (cond) {
x.push(identity(a.b.c));
}
$[2] = cond;
$[3] = a.b.c;
$[2] = a.b.c;
$[3] = cond;
$[4] = x;
} else {
x = $[4];
@@ -50,22 +50,22 @@ function Foo(t0) {
const fn = t1;
useIdentity(null);
let arr;
if ($[2] !== cond || $[3] !== a.b?.c.e) {
if ($[2] !== a.b?.c.e || $[3] !== cond) {
arr = makeArray();
if (cond) {
arr.push(identity(a.b?.c.e));
}
$[2] = cond;
$[3] = a.b?.c.e;
$[2] = a.b?.c.e;
$[3] = cond;
$[4] = arr;
} else {
arr = $[4];
}
let t2;
if ($[5] !== fn || $[6] !== arr) {
if ($[5] !== arr || $[6] !== fn) {
t2 = <Stringify fn={fn} arr={arr} shouldInvokeFns={true} />;
$[5] = fn;
$[6] = arr;
$[5] = arr;
$[6] = fn;
$[7] = t2;
} else {
t2 = $[7];
@@ -41,7 +41,7 @@ function Foo(t0) {
const $ = _c(3);
const { a, shouldReadA } = t0;
let t1;
if ($[0] !== shouldReadA || $[1] !== a) {
if ($[0] !== a || $[1] !== shouldReadA) {
t1 = (
<Stringify
objectMethod={{
@@ -55,8 +55,8 @@ function Foo(t0) {
shouldInvokeFns={true}
/>
);
$[0] = shouldReadA;
$[1] = a;
$[0] = a;
$[1] = shouldReadA;
$[2] = t1;
} else {
t1 = $[2];
@@ -24,7 +24,7 @@ import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR
function Component(props) {
const $ = _c(5);
let x;
if ($[0] !== props.items?.length || $[1] !== props.items?.edges) {
if ($[0] !== props.items?.edges || $[1] !== props.items?.length) {
x = [];
x.push(props.items?.length);
let t0;
@@ -36,8 +36,8 @@ function Component(props) {
t0 = $[4];
}
x.push(t0);
$[0] = props.items?.length;
$[1] = props.items?.edges;
$[0] = props.items?.edges;
$[1] = props.items?.length;
$[2] = x;
} else {
x = $[2];
@@ -38,15 +38,15 @@ import { identity } from "shared-runtime";
function usePromoteUnconditionalAccessToDependency(props, other) {
const $ = _c(4);
let x;
if ($[0] !== props.a.a.a || $[1] !== props.a.b || $[2] !== other) {
if ($[0] !== other || $[1] !== props.a.a.a || $[2] !== props.a.b) {
x = {};
x.a = props.a.a.a;
if (identity(other)) {
x.c = props.a.b.c;
}
$[0] = props.a.a.a;
$[1] = props.a.b;
$[2] = other;
$[0] = other;
$[1] = props.a.a.a;
$[2] = props.a.b;
$[3] = x;
} else {
x = $[3];
@@ -39,11 +39,11 @@ function useFoo(props) {
} else {
x = $[1];
}
if ($[2] !== props.cond || $[3] !== props.foo || $[4] !== props.bar) {
if ($[2] !== props.bar || $[3] !== props.cond || $[4] !== props.foo) {
props.cond ? ((x = []), x.push(props.foo)) : ((x = []), x.push(props.bar));
$[2] = props.cond;
$[3] = props.foo;
$[4] = props.bar;
$[2] = props.bar;
$[3] = props.cond;
$[4] = props.foo;
$[5] = x;
} else {
x = $[5];
@@ -35,8 +35,8 @@ function Component(props) {
import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR
function Component(props) {
const $ = _c(8);
let y;
let t0;
let y;
if ($[0] !== props.p0 || $[1] !== props.p2) {
const x = [];
bb0: switch (props.p0) {
@@ -65,19 +65,19 @@ function Component(props) {
t0 = <Component data={x} />;
$[0] = props.p0;
$[1] = props.p2;
$[2] = y;
$[3] = t0;
$[2] = t0;
$[3] = y;
} else {
y = $[2];
t0 = $[3];
t0 = $[2];
y = $[3];
}
const child = t0;
y.push(props.p4);
let t1;
if ($[5] !== y || $[6] !== child) {
if ($[5] !== child || $[6] !== y) {
t1 = <Component data={y}>{child}</Component>;
$[5] = y;
$[6] = child;
$[5] = child;
$[6] = y;
$[7] = t1;
} else {
t1 = $[7];
@@ -30,8 +30,8 @@ function Component(props) {
import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR
function Component(props) {
const $ = _c(8);
let y;
let t0;
let y;
if ($[0] !== props.p0 || $[1] !== props.p2 || $[2] !== props.p3) {
const x = [];
switch (props.p0) {
@@ -48,19 +48,19 @@ function Component(props) {
$[0] = props.p0;
$[1] = props.p2;
$[2] = props.p3;
$[3] = y;
$[4] = t0;
$[3] = t0;
$[4] = y;
} else {
y = $[3];
t0 = $[4];
t0 = $[3];
y = $[4];
}
const child = t0;
y.push(props.p4);
let t1;
if ($[5] !== y || $[6] !== child) {
if ($[5] !== child || $[6] !== y) {
t1 = <Component data={y}>{child}</Component>;
$[5] = y;
$[6] = child;
$[5] = child;
$[6] = y;
$[7] = t1;
} else {
t1 = $[7];
@@ -34,7 +34,7 @@ const { throwInput } = require("shared-runtime");
function Component(props) {
const $ = _c(3);
let x;
if ($[0] !== props.y || $[1] !== props.e) {
if ($[0] !== props.e || $[1] !== props.y) {
try {
const y = [];
y.push(props.y);
@@ -44,8 +44,8 @@ function Component(props) {
e.push(props.e);
x = e;
}
$[0] = props.y;
$[1] = props.e;
$[0] = props.e;
$[1] = props.y;
$[2] = x;
} else {
x = $[2];
@@ -33,7 +33,7 @@ const { throwInput } = require("shared-runtime");
function Component(props) {
const $ = _c(3);
let t0;
if ($[0] !== props.y || $[1] !== props.e) {
if ($[0] !== props.e || $[1] !== props.y) {
t0 = Symbol.for("react.early_return_sentinel");
bb0: {
try {
@@ -47,8 +47,8 @@ function Component(props) {
break bb0;
}
}
$[0] = props.y;
$[1] = props.e;
$[0] = props.e;
$[1] = props.y;
$[2] = t0;
} else {
t0 = $[2];
@@ -39,10 +39,10 @@ function Component(props) {
bb0: {
let y;
if (
$[0] !== props.cond ||
$[1] !== props.a ||
$[2] !== props.cond2 ||
$[3] !== props.b
$[0] !== props.a ||
$[1] !== props.b ||
$[2] !== props.cond ||
$[3] !== props.cond2
) {
y = [];
if (props.cond) {
@@ -54,10 +54,10 @@ function Component(props) {
}
y.push(props.b);
$[0] = props.cond;
$[1] = props.a;
$[2] = props.cond2;
$[3] = props.b;
$[0] = props.a;
$[1] = props.b;
$[2] = props.cond;
$[3] = props.cond2;
$[4] = y;
$[5] = t0;
} else {
@@ -54,10 +54,10 @@ function Component(props) {
}
const c = t0;
let t1;
if ($[3] !== c || $[4] !== a) {
if ($[3] !== a || $[4] !== c) {
t1 = [c, a];
$[3] = c;
$[4] = a;
$[3] = a;
$[4] = c;
$[5] = t1;
} else {
t1 = $[5];
@@ -20,11 +20,11 @@ import { c as _c } from "react/compiler-runtime";
function Component(props) {
const $ = _c(8);
let items;
if ($[0] !== props.key || $[1] !== props.a) {
if ($[0] !== props.a || $[1] !== props.key) {
items = bar();
mutate(items[props.key], props.a);
$[0] = props.key;
$[1] = props.a;
$[0] = props.a;
$[1] = props.key;
$[2] = items;
} else {
items = $[2];
@@ -41,10 +41,10 @@ function Component(props) {
}
const count = t1;
let t2;
if ($[5] !== items || $[6] !== count) {
if ($[5] !== count || $[6] !== items) {
t2 = { items, count };
$[5] = items;
$[6] = count;
$[5] = count;
$[6] = items;
$[7] = t2;
} else {
t2 = $[7];
@@ -40,10 +40,10 @@ function Component(props) {
}
const count = t1;
let t2;
if ($[4] !== items || $[5] !== count) {
if ($[4] !== count || $[5] !== items) {
t2 = { items, count };
$[4] = items;
$[5] = count;
$[4] = count;
$[5] = items;
$[6] = t2;
} else {
t2 = $[6];
@@ -42,8 +42,8 @@ export const FIXTURE_ENTRYPOINT = {
import { c as _c } from "react/compiler-runtime";
function foo(a, b, c) {
const $ = _c(10);
let x;
let t0;
let x;
if ($[0] !== a) {
x = [];
if (a) {
@@ -52,11 +52,11 @@ function foo(a, b, c) {
t0 = <div>{x}</div>;
$[0] = a;
$[1] = x;
$[2] = t0;
$[1] = t0;
$[2] = x;
} else {
x = $[1];
t0 = $[2];
t0 = $[1];
x = $[2];
}
const y = t0;
bb0: switch (b) {
@@ -83,15 +83,15 @@ function foo(a, b, c) {
}
}
let t1;
if ($[7] !== y || $[8] !== x) {
if ($[7] !== x || $[8] !== y) {
t1 = (
<div>
{y}
{x}
</div>
);
$[7] = y;
$[8] = x;
$[7] = x;
$[8] = y;
$[9] = t1;
} else {
t1 = $[9];
@@ -34,7 +34,7 @@ function useFoo(t0) {
const $ = _c(3);
const { obj, objIsNull } = t0;
let x;
if ($[0] !== objIsNull || $[1] !== obj) {
if ($[0] !== obj || $[1] !== objIsNull) {
x = [];
bb0: {
if (objIsNull) {
@@ -45,8 +45,8 @@ function useFoo(t0) {
x.push(obj.b);
}
$[0] = objIsNull;
$[1] = obj;
$[0] = obj;
$[1] = objIsNull;
$[2] = x;
} else {
x = $[2];
@@ -31,9 +31,9 @@ import { c as _c } from "react/compiler-runtime";
function useFoo(t0) {
const $ = _c(4);
const { obj, objIsNull } = t0;
let x;
let t1;
if ($[0] !== objIsNull || $[1] !== obj) {
let x;
if ($[0] !== obj || $[1] !== objIsNull) {
t1 = Symbol.for("react.early_return_sentinel");
bb0: {
x = [];
@@ -46,13 +46,13 @@ function useFoo(t0) {
x.push(obj.b);
}
$[0] = objIsNull;
$[1] = obj;
$[2] = x;
$[3] = t1;
$[0] = obj;
$[1] = objIsNull;
$[2] = t1;
$[3] = x;
} else {
x = $[2];
t1 = $[3];
t1 = $[2];
x = $[3];
}
if (t1 !== Symbol.for("react.early_return_sentinel")) {
return t1;
@@ -38,7 +38,7 @@ function Foo(t0) {
const $ = _c(3);
const { a, shouldReadA } = t0;
let t1;
if ($[0] !== shouldReadA || $[1] !== a.b.c) {
if ($[0] !== a.b.c || $[1] !== shouldReadA) {
t1 = (
<Stringify
fn={() => {
@@ -50,8 +50,8 @@ function Foo(t0) {
shouldInvokeFns={true}
/>
);
$[0] = shouldReadA;
$[1] = a.b.c;
$[0] = a.b.c;
$[1] = shouldReadA;
$[2] = t1;
} else {
t1 = $[2];
@@ -80,10 +80,10 @@ function useFoo(t0) {
x = $[6];
}
let t1;
if ($[7] !== y || $[8] !== x.a.b) {
if ($[7] !== x.a.b || $[8] !== y) {
t1 = [y, x.a.b];
$[7] = y;
$[8] = x.a.b;
$[7] = x.a.b;
$[8] = y;
$[9] = t1;
} else {
t1 = $[9];
@@ -36,7 +36,7 @@ function useFoo(t0) {
const $ = _c(3);
const { obj, objIsNull } = t0;
let x;
if ($[0] !== objIsNull || $[1] !== obj) {
if ($[0] !== obj || $[1] !== objIsNull) {
x = [];
bb0: {
if (objIsNull) {
@@ -45,8 +45,8 @@ function useFoo(t0) {
x.push(obj.a);
}
$[0] = objIsNull;
$[1] = obj;
$[0] = obj;
$[1] = objIsNull;
$[2] = x;
} else {
x = $[2];
@@ -36,7 +36,7 @@ function useFoo(t0) {
const $ = _c(3);
const { obj, objIsNull } = t0;
let x;
if ($[0] !== objIsNull || $[1] !== obj) {
if ($[0] !== obj || $[1] !== objIsNull) {
x = [];
for (let i = 0; i < 5; i++) {
if (objIsNull) {
@@ -45,8 +45,8 @@ function useFoo(t0) {
x.push(obj.a);
}
$[0] = objIsNull;
$[1] = obj;
$[0] = obj;
$[1] = objIsNull;
$[2] = x;
} else {
x = $[2];
@@ -42,8 +42,8 @@ import { identity } from "shared-runtime";
function useFoo(t0) {
const $ = _c(9);
const { input, cond, hasAB } = t0;
let x;
let t1;
let x;
if ($[0] !== cond || $[1] !== hasAB || $[2] !== input) {
t1 = Symbol.for("react.early_return_sentinel");
bb0: {
@@ -77,11 +77,11 @@ function useFoo(t0) {
$[0] = cond;
$[1] = hasAB;
$[2] = input;
$[3] = x;
$[4] = t1;
$[3] = t1;
$[4] = x;
} else {
x = $[3];
t1 = $[4];
t1 = $[3];
x = $[4];
}
if (t1 !== Symbol.for("react.early_return_sentinel")) {
return t1;
@@ -43,8 +43,8 @@ import { identity } from "shared-runtime";
function useFoo(t0) {
const $ = _c(11);
const { input, cond, hasAB } = t0;
let x;
let t1;
let x;
if ($[0] !== cond || $[1] !== hasAB || $[2] !== input) {
t1 = Symbol.for("react.early_return_sentinel");
bb0: {
@@ -88,11 +88,11 @@ function useFoo(t0) {
$[0] = cond;
$[1] = hasAB;
$[2] = input;
$[3] = x;
$[4] = t1;
$[3] = t1;
$[4] = x;
} else {
x = $[3];
t1 = $[4];
t1 = $[3];
x = $[4];
}
if (t1 !== Symbol.for("react.early_return_sentinel")) {
return t1;
@@ -33,9 +33,9 @@ import { c as _c } from "react/compiler-runtime";
function useFoo(t0) {
const $ = _c(4);
const { obj, objIsNull } = t0;
let x;
let t1;
if ($[0] !== objIsNull || $[1] !== obj) {
let x;
if ($[0] !== obj || $[1] !== objIsNull) {
t1 = Symbol.for("react.early_return_sentinel");
bb0: {
x = [];
@@ -46,13 +46,13 @@ function useFoo(t0) {
x.push(obj.b);
}
$[0] = objIsNull;
$[1] = obj;
$[2] = x;
$[3] = t1;
$[0] = obj;
$[1] = objIsNull;
$[2] = t1;
$[3] = x;
} else {
x = $[2];
t1 = $[3];
t1 = $[2];
x = $[3];
}
if (t1 !== Symbol.for("react.early_return_sentinel")) {
return t1;
@@ -39,8 +39,8 @@ import { identity } from "shared-runtime";
function useFoo(t0) {
const $ = _c(6);
const { input, cond } = t0;
let x;
let t1;
let x;
if ($[0] !== cond || $[1] !== input) {
t1 = Symbol.for("react.early_return_sentinel");
bb0: {
@@ -61,11 +61,11 @@ function useFoo(t0) {
}
$[0] = cond;
$[1] = input;
$[2] = x;
$[3] = t1;
$[2] = t1;
$[3] = x;
} else {
x = $[2];
t1 = $[3];
t1 = $[2];
x = $[3];
}
if (t1 !== Symbol.for("react.early_return_sentinel")) {
return t1;

Some files were not shown because too many files have changed in this diff Show More