mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Inline reactive scope dep checks; no more change vars
Reactive scopes are currently preceded by individual variable declarations, one for each of the scope's dependencies. Only after checking independently if each of these dependencies has changed do we then do an "or" to check if we should actually recompute the body of the scope. But that's wasteful: it's more efficient to rely on `||` short-circuiting, and recompute as soon as any input changes. The main reason I can see not to do this is debugging. Having the change variables makes it easy to see what changed. But at this point I think it makes sense to optimize for code size and performance; we can always add back a dev-only mode that uses change variables if that turns out to help debugging.
This commit is contained in:
+8
-19
@@ -237,28 +237,17 @@ function codegenMemoBlockForReactiveScope(
|
||||
): void {
|
||||
const cacheStoreStatements: Array<t.Statement> = [];
|
||||
const cacheLoadStatements: Array<t.Statement> = [];
|
||||
const changeIdentifiers: Array<t.Identifier> = [];
|
||||
const changeExpressions: Array<t.Expression> = [];
|
||||
for (const dep of scope.dependencies) {
|
||||
const index = cx.nextCacheIndex;
|
||||
const changeIdentifier = t.identifier(`c_${index}`);
|
||||
const depValue = codegenDependency(cx, dep);
|
||||
|
||||
changeIdentifiers.push(changeIdentifier);
|
||||
statements.push(
|
||||
t.variableDeclaration("const", [
|
||||
t.variableDeclarator(
|
||||
changeIdentifier,
|
||||
t.binaryExpression(
|
||||
"!==",
|
||||
t.memberExpression(
|
||||
t.identifier("$"),
|
||||
t.numericLiteral(index),
|
||||
true
|
||||
),
|
||||
depValue
|
||||
)
|
||||
),
|
||||
])
|
||||
changeExpressions.push(
|
||||
t.binaryExpression(
|
||||
"!==",
|
||||
t.memberExpression(t.identifier("$"), t.numericLiteral(index), true),
|
||||
depValue
|
||||
)
|
||||
);
|
||||
cacheStoreStatements.push(
|
||||
t.expressionStatement(
|
||||
@@ -336,7 +325,7 @@ function codegenMemoBlockForReactiveScope(
|
||||
)
|
||||
);
|
||||
}
|
||||
let testCondition = (changeIdentifiers as Array<t.Expression>).reduce(
|
||||
let testCondition = (changeExpressions as Array<t.Expression>).reduce(
|
||||
(acc: t.Expression | null, ident: t.Expression) => {
|
||||
if (acc == null) {
|
||||
return ident;
|
||||
|
||||
+1
-2
@@ -19,9 +19,8 @@ function component(a) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let x;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
x = { a };
|
||||
const y = {};
|
||||
|
||||
|
||||
+1
-2
@@ -29,9 +29,8 @@ function mutate(x, y) {}
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function foo(cond) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== cond;
|
||||
let a;
|
||||
if (c_0) {
|
||||
if ($[0] !== cond) {
|
||||
a = {};
|
||||
let b = {};
|
||||
let c = {};
|
||||
|
||||
+3
-8
@@ -25,17 +25,14 @@ import { unstable_useMemoCache as useMemoCache } from "react"; // bar(props.b) i
|
||||
// - y depends on either bar(props.b) or bar(props.b) + 1
|
||||
function AllocatingPrimitiveAsDepNested(props) {
|
||||
const $ = useMemoCache(9);
|
||||
const c_0 = $[0] !== props.b;
|
||||
const c_1 = $[1] !== props.a;
|
||||
let x;
|
||||
let y;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== props.b || $[1] !== props.a) {
|
||||
x = {};
|
||||
mutate(x);
|
||||
const t0 = bar(props.b) + 1;
|
||||
const c_4 = $[4] !== t0;
|
||||
let t1;
|
||||
if (c_4) {
|
||||
if ($[4] !== t0) {
|
||||
t1 = foo(t0);
|
||||
$[4] = t0;
|
||||
$[5] = t1;
|
||||
@@ -52,10 +49,8 @@ function AllocatingPrimitiveAsDepNested(props) {
|
||||
x = $[2];
|
||||
y = $[3];
|
||||
}
|
||||
const c_6 = $[6] !== x;
|
||||
const c_7 = $[7] !== y;
|
||||
let t2;
|
||||
if (c_6 || c_7) {
|
||||
if ($[6] !== x || $[7] !== y) {
|
||||
t2 = [x, y];
|
||||
$[6] = x;
|
||||
$[7] = y;
|
||||
|
||||
+1
-2
@@ -23,9 +23,8 @@ import { unstable_useMemoCache as useMemoCache } from "react"; // bar(props.b) i
|
||||
function AllocatingPrimitiveAsDep(props) {
|
||||
const $ = useMemoCache(2);
|
||||
const t0 = bar(props).b + 1;
|
||||
const c_0 = $[0] !== t0;
|
||||
let t1;
|
||||
if (c_0) {
|
||||
if ($[0] !== t0) {
|
||||
t1 = foo(t0);
|
||||
$[0] = t0;
|
||||
$[1] = t1;
|
||||
|
||||
+1
-2
@@ -16,9 +16,8 @@ import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function Component(props) {
|
||||
const $ = useMemoCache(2);
|
||||
const ref = useRef(null);
|
||||
const c_0 = $[0] !== ref;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== ref) {
|
||||
t0 = <Foo ref={ref} />;
|
||||
$[0] = ref;
|
||||
$[1] = t0;
|
||||
|
||||
+3
-9
@@ -25,16 +25,12 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function foo(a, b, c) {
|
||||
const $ = useMemoCache(10);
|
||||
const c_0 = $[0] !== a;
|
||||
const c_1 = $[1] !== b;
|
||||
const c_2 = $[2] !== c;
|
||||
let x;
|
||||
let z;
|
||||
if (c_0 || c_1 || c_2) {
|
||||
if ($[0] !== a || $[1] !== b || $[2] !== c) {
|
||||
x = [a];
|
||||
const c_5 = $[5] !== b;
|
||||
let t0;
|
||||
if (c_5) {
|
||||
if ($[5] !== b) {
|
||||
t0 = [null, b];
|
||||
$[5] = b;
|
||||
$[6] = t0;
|
||||
@@ -54,10 +50,8 @@ function foo(a, b, c) {
|
||||
x = $[3];
|
||||
z = $[4];
|
||||
}
|
||||
const c_7 = $[7] !== x;
|
||||
const c_8 = $[8] !== z;
|
||||
let t1;
|
||||
if (c_7 || c_8) {
|
||||
if ($[7] !== x || $[8] !== z) {
|
||||
t1 = [x, z];
|
||||
$[7] = x;
|
||||
$[8] = z;
|
||||
|
||||
+3
-7
@@ -20,9 +20,8 @@ function Component(props) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function Component(props) {
|
||||
const $ = useMemoCache(7);
|
||||
const c_0 = $[0] !== props.x;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== props.x) {
|
||||
t0 = foo(props.x);
|
||||
$[0] = props.x;
|
||||
$[1] = t0;
|
||||
@@ -30,10 +29,8 @@ function Component(props) {
|
||||
t0 = $[1];
|
||||
}
|
||||
const x = t0;
|
||||
const c_2 = $[2] !== props;
|
||||
const c_3 = $[3] !== x;
|
||||
let t1;
|
||||
if (c_2 || c_3) {
|
||||
if ($[2] !== props || $[3] !== x) {
|
||||
t1 = function () {
|
||||
const arr = [...bar(props)];
|
||||
return arr.at(x);
|
||||
@@ -45,9 +42,8 @@ function Component(props) {
|
||||
t1 = $[4];
|
||||
}
|
||||
const fn = t1;
|
||||
const c_5 = $[5] !== fn;
|
||||
let t2;
|
||||
if (c_5) {
|
||||
if ($[5] !== fn) {
|
||||
t2 = fn();
|
||||
$[5] = fn;
|
||||
$[6] = t2;
|
||||
|
||||
+4
-9
@@ -23,18 +23,16 @@ import { unstable_useMemoCache as useMemoCache } from "react"; // arrayInstance.
|
||||
// - mutate on lvalue
|
||||
function ArrayAtTest(props) {
|
||||
const $ = useMemoCache(9);
|
||||
const c_0 = $[0] !== props.x;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== props.x) {
|
||||
t0 = foo(props.x);
|
||||
$[0] = props.x;
|
||||
$[1] = t0;
|
||||
} else {
|
||||
t0 = $[1];
|
||||
}
|
||||
const c_2 = $[2] !== t0;
|
||||
let t1;
|
||||
if (c_2) {
|
||||
if ($[2] !== t0) {
|
||||
t1 = [t0];
|
||||
$[2] = t0;
|
||||
$[3] = t1;
|
||||
@@ -42,13 +40,10 @@ function ArrayAtTest(props) {
|
||||
t1 = $[3];
|
||||
}
|
||||
const arr = t1;
|
||||
const c_4 = $[4] !== props.y;
|
||||
const c_5 = $[5] !== arr;
|
||||
let t3;
|
||||
if (c_4 || c_5) {
|
||||
const c_7 = $[7] !== props.y;
|
||||
if ($[4] !== props.y || $[5] !== arr) {
|
||||
let t2;
|
||||
if (c_7) {
|
||||
if ($[7] !== props.y) {
|
||||
t2 = bar(props.y);
|
||||
$[7] = props.y;
|
||||
$[8] = t2;
|
||||
|
||||
+1
-3
@@ -21,10 +21,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function Component(props) {
|
||||
const $ = useMemoCache(3);
|
||||
const c_0 = $[0] !== props.foo;
|
||||
const c_1 = $[1] !== props.bar;
|
||||
let t0;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== props.foo || $[1] !== props.bar) {
|
||||
t0 = [0, ...props.foo, null, ...props.bar, "z"];
|
||||
$[0] = props.foo;
|
||||
$[1] = props.bar;
|
||||
|
||||
+2
-5
@@ -28,9 +28,8 @@ function Component(props) {
|
||||
t0 = $[0];
|
||||
t1 = $[1];
|
||||
}
|
||||
const c_2 = $[2] !== props.value;
|
||||
let t2;
|
||||
if (c_2) {
|
||||
if ($[2] !== props.value) {
|
||||
t2 = [t0, t1, props.value];
|
||||
$[2] = props.value;
|
||||
$[3] = t2;
|
||||
@@ -47,10 +46,8 @@ function Component(props) {
|
||||
}
|
||||
const y = x.join(t3);
|
||||
foo(y);
|
||||
const c_5 = $[5] !== x;
|
||||
const c_6 = $[6] !== y;
|
||||
let t4;
|
||||
if (c_5 || c_6) {
|
||||
if ($[5] !== x || $[6] !== y) {
|
||||
t4 = [x, y];
|
||||
$[5] = x;
|
||||
$[6] = y;
|
||||
|
||||
+1
-2
@@ -24,9 +24,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function Component(props) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== props.a;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== props.a) {
|
||||
const item = { a: props.a };
|
||||
const items = [item];
|
||||
t0 = items.map((item_0) => item_0);
|
||||
|
||||
+2
-4
@@ -30,9 +30,8 @@ function Component(props) {
|
||||
t0 = $[0];
|
||||
}
|
||||
const f = t0;
|
||||
const c_1 = $[1] !== props.items;
|
||||
let t1;
|
||||
if (c_1) {
|
||||
if ($[1] !== props.items) {
|
||||
t1 = [...props.items].map(f);
|
||||
$[1] = props.items;
|
||||
$[2] = t1;
|
||||
@@ -40,9 +39,8 @@ function Component(props) {
|
||||
t1 = $[2];
|
||||
}
|
||||
const x = t1;
|
||||
const c_3 = $[3] !== x;
|
||||
let t2;
|
||||
if (c_3) {
|
||||
if ($[3] !== x) {
|
||||
t2 = [x, f];
|
||||
$[3] = x;
|
||||
$[4] = t2;
|
||||
|
||||
+3
-7
@@ -23,9 +23,8 @@ import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(t16) {
|
||||
const $ = useMemoCache(7);
|
||||
const [a, b] = t16;
|
||||
const c_0 = $[0] !== a;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
t0 = { a };
|
||||
$[0] = a;
|
||||
$[1] = t0;
|
||||
@@ -33,9 +32,8 @@ function component(t16) {
|
||||
t0 = $[1];
|
||||
}
|
||||
const y = t0;
|
||||
const c_2 = $[2] !== b;
|
||||
let t1;
|
||||
if (c_2) {
|
||||
if ($[2] !== b) {
|
||||
t1 = { b };
|
||||
$[2] = b;
|
||||
$[3] = t1;
|
||||
@@ -43,10 +41,8 @@ function component(t16) {
|
||||
t1 = $[3];
|
||||
}
|
||||
const z = t1;
|
||||
const c_4 = $[4] !== y;
|
||||
const c_5 = $[5] !== z;
|
||||
let t2;
|
||||
if (c_4 || c_5) {
|
||||
if ($[4] !== y || $[5] !== z) {
|
||||
t2 = [y, z];
|
||||
$[4] = y;
|
||||
$[5] = z;
|
||||
|
||||
+2
-7
@@ -23,10 +23,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function Component(props) {
|
||||
const $ = useMemoCache(7);
|
||||
const c_0 = $[0] !== props.a;
|
||||
const c_1 = $[1] !== props.b;
|
||||
let t0;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== props.a || $[1] !== props.b) {
|
||||
t0 = [props.a, props.b, "hello"];
|
||||
$[0] = props.a;
|
||||
$[1] = props.b;
|
||||
@@ -37,11 +35,8 @@ function Component(props) {
|
||||
const a = t0;
|
||||
const x = a.length;
|
||||
const y = a.push;
|
||||
const c_3 = $[3] !== a;
|
||||
const c_4 = $[4] !== x;
|
||||
const c_5 = $[5] !== y;
|
||||
let t1;
|
||||
if (c_3 || c_4 || c_5) {
|
||||
if ($[3] !== a || $[4] !== x || $[5] !== y) {
|
||||
t1 = { a, x, y, z: a.concat };
|
||||
$[3] = a;
|
||||
$[4] = x;
|
||||
|
||||
+3
-10
@@ -24,11 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function Component(props) {
|
||||
const $ = useMemoCache(11);
|
||||
const c_0 = $[0] !== props.a;
|
||||
const c_1 = $[1] !== props.b;
|
||||
let t0;
|
||||
let a;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== props.a || $[1] !== props.b) {
|
||||
a = [props.a, props.b, "hello"];
|
||||
t0 = a.push(42);
|
||||
$[0] = props.a;
|
||||
@@ -40,10 +38,8 @@ function Component(props) {
|
||||
a = $[3];
|
||||
}
|
||||
const x = t0;
|
||||
const c_4 = $[4] !== a;
|
||||
const c_5 = $[5] !== props.c;
|
||||
let t1;
|
||||
if (c_4 || c_5) {
|
||||
if ($[4] !== a || $[5] !== props.c) {
|
||||
t1 = a.at(props.c);
|
||||
$[4] = a;
|
||||
$[5] = props.c;
|
||||
@@ -52,11 +48,8 @@ function Component(props) {
|
||||
t1 = $[6];
|
||||
}
|
||||
const y = t1;
|
||||
const c_7 = $[7] !== a;
|
||||
const c_8 = $[8] !== x;
|
||||
const c_9 = $[9] !== y;
|
||||
let t2;
|
||||
if (c_7 || c_8 || c_9) {
|
||||
if ($[7] !== a || $[8] !== x || $[9] !== y) {
|
||||
t2 = { a, x, y };
|
||||
$[7] = a;
|
||||
$[8] = x;
|
||||
|
||||
+3
-7
@@ -24,9 +24,8 @@ import { unstable_useMemoCache as useMemoCache } from "react"; // arrayInstance.
|
||||
// - mutate on receiver
|
||||
function Component(props) {
|
||||
const $ = useMemoCache(8);
|
||||
const c_0 = $[0] !== props.x;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== props.x) {
|
||||
t0 = foo(props.x);
|
||||
$[0] = props.x;
|
||||
$[1] = t0;
|
||||
@@ -34,9 +33,8 @@ function Component(props) {
|
||||
t0 = $[1];
|
||||
}
|
||||
const x = t0;
|
||||
const c_2 = $[2] !== props.y;
|
||||
let t1;
|
||||
if (c_2) {
|
||||
if ($[2] !== props.y) {
|
||||
t1 = { y: props.y };
|
||||
$[2] = props.y;
|
||||
$[3] = t1;
|
||||
@@ -44,10 +42,8 @@ function Component(props) {
|
||||
t1 = $[3];
|
||||
}
|
||||
const y = t1;
|
||||
const c_4 = $[4] !== x;
|
||||
const c_5 = $[5] !== y;
|
||||
let arr;
|
||||
if (c_4 || c_5) {
|
||||
if ($[4] !== x || $[5] !== y) {
|
||||
arr = [];
|
||||
let t2;
|
||||
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
|
||||
+1
-2
@@ -17,9 +17,8 @@ import { unstable_useMemoCache as useMemoCache } from "react"; // @gating
|
||||
const ErrorView = isForgetEnabled_Fixtures()
|
||||
? (error, _retry) => {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== error;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== error) {
|
||||
t0 = <MessageBox error={error} />;
|
||||
$[0] = error;
|
||||
$[1] = t0;
|
||||
|
||||
+1
-2
@@ -24,9 +24,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function Component(props) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== props.x;
|
||||
let x;
|
||||
if (c_0) {
|
||||
if ($[0] !== props.x) {
|
||||
x = [props.x];
|
||||
|
||||
x[0] = x[0] * 2;
|
||||
|
||||
+1
-2
@@ -23,9 +23,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function g(props) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== props.c;
|
||||
let a;
|
||||
if (c_0) {
|
||||
if ($[0] !== props.c) {
|
||||
a = { b: { c: props.c } };
|
||||
a.b.c = a.b.c + 1;
|
||||
a.b.c = a.b.c * 2;
|
||||
|
||||
+1
-2
@@ -16,9 +16,8 @@ async function Component(props) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
async function Component(props) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== props.id;
|
||||
let x;
|
||||
if (c_0) {
|
||||
if ($[0] !== props.id) {
|
||||
x = [];
|
||||
await populateData(props.id, x);
|
||||
$[0] = props.id;
|
||||
|
||||
+2
-4
@@ -15,9 +15,8 @@ async function Component(props) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
async function Component(props) {
|
||||
const $ = useMemoCache(4);
|
||||
const c_0 = $[0] !== props.id;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== props.id) {
|
||||
t0 = await load(props.id);
|
||||
$[0] = props.id;
|
||||
$[1] = t0;
|
||||
@@ -25,9 +24,8 @@ async function Component(props) {
|
||||
t0 = $[1];
|
||||
}
|
||||
const user = t0;
|
||||
const c_2 = $[2] !== user.name;
|
||||
let t1;
|
||||
if (c_2) {
|
||||
if ($[2] !== user.name) {
|
||||
t1 = <div>{user.name}</div>;
|
||||
$[2] = user.name;
|
||||
$[3] = t1;
|
||||
|
||||
+4
-8
@@ -33,9 +33,8 @@ function Component(props) {
|
||||
const $ = useMemoCache(4);
|
||||
const [x] = useState(0);
|
||||
let t35;
|
||||
const c_0 = $[0] !== x;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== x) {
|
||||
t0 = calculateExpensiveNumber(x);
|
||||
$[0] = x;
|
||||
$[1] = t0;
|
||||
@@ -44,9 +43,8 @@ function Component(props) {
|
||||
}
|
||||
t35 = t0;
|
||||
const expensiveNumber = t35;
|
||||
const c_2 = $[2] !== expensiveNumber;
|
||||
let t1;
|
||||
if (c_2) {
|
||||
if ($[2] !== expensiveNumber) {
|
||||
t1 = <div>{expensiveNumber}</div>;
|
||||
$[2] = expensiveNumber;
|
||||
$[3] = t1;
|
||||
@@ -60,9 +58,8 @@ function Component2(props) {
|
||||
const $ = useMemoCache(4);
|
||||
const [x] = useState(0);
|
||||
let t35;
|
||||
const c_0 = $[0] !== x;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== x) {
|
||||
t0 = calculateExpensiveNumber(x);
|
||||
$[0] = x;
|
||||
$[1] = t0;
|
||||
@@ -71,9 +68,8 @@ function Component2(props) {
|
||||
}
|
||||
t35 = t0;
|
||||
const expensiveNumber = t35;
|
||||
const c_2 = $[2] !== expensiveNumber;
|
||||
let t1;
|
||||
if (c_2) {
|
||||
if ($[2] !== expensiveNumber) {
|
||||
t1 = <div>{expensiveNumber}</div>;
|
||||
$[2] = expensiveNumber;
|
||||
$[3] = t1;
|
||||
|
||||
+4
-8
@@ -35,9 +35,8 @@ function Component(props) {
|
||||
const $ = useMemoCache(4);
|
||||
const [x] = useState(0);
|
||||
let t35;
|
||||
const c_0 = $[0] !== x;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== x) {
|
||||
t0 = calculateExpensiveNumber(x);
|
||||
$[0] = x;
|
||||
$[1] = t0;
|
||||
@@ -46,9 +45,8 @@ function Component(props) {
|
||||
}
|
||||
t35 = t0;
|
||||
const expensiveNumber = t35;
|
||||
const c_2 = $[2] !== expensiveNumber;
|
||||
let t1;
|
||||
if (c_2) {
|
||||
if ($[2] !== expensiveNumber) {
|
||||
t1 = <div>{expensiveNumber}</div>;
|
||||
$[2] = expensiveNumber;
|
||||
$[3] = t1;
|
||||
@@ -62,9 +60,8 @@ function Component2(props) {
|
||||
const $ = useMemoCache(4);
|
||||
const [x] = useState(0);
|
||||
let t35;
|
||||
const c_0 = $[0] !== x;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== x) {
|
||||
t0 = calculateExpensiveNumber(x);
|
||||
$[0] = x;
|
||||
$[1] = t0;
|
||||
@@ -73,9 +70,8 @@ function Component2(props) {
|
||||
}
|
||||
t35 = t0;
|
||||
const expensiveNumber = t35;
|
||||
const c_2 = $[2] !== expensiveNumber;
|
||||
let t1;
|
||||
if (c_2) {
|
||||
if ($[2] !== expensiveNumber) {
|
||||
t1 = <div>{expensiveNumber}</div>;
|
||||
$[2] = expensiveNumber;
|
||||
$[3] = t1;
|
||||
|
||||
+1
-2
@@ -32,9 +32,8 @@ function Component(props) {
|
||||
let t39;
|
||||
t39 = calculateExpensiveNumber(x);
|
||||
const expensiveNumber = t39;
|
||||
const c_0 = $[0] !== expensiveNumber;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== expensiveNumber) {
|
||||
t0 = <div>{expensiveNumber}</div>;
|
||||
$[0] = expensiveNumber;
|
||||
$[1] = t0;
|
||||
|
||||
+1
-2
@@ -30,9 +30,8 @@ function App(t23) {
|
||||
|
||||
hasDeps ? null : [text];
|
||||
let t44;
|
||||
const c_0 = $[0] !== text;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== text) {
|
||||
t0 = text.toUpperCase();
|
||||
$[0] = text;
|
||||
$[1] = t0;
|
||||
|
||||
+1
-2
@@ -23,9 +23,8 @@ import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(t) {
|
||||
const $ = useMemoCache(2);
|
||||
const { a } = t;
|
||||
const c_0 = $[0] !== a;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
t0 = { a };
|
||||
$[0] = a;
|
||||
$[1] = t0;
|
||||
|
||||
+1
-3
@@ -15,10 +15,8 @@ function Component(props) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function Component(props) {
|
||||
const $ = useMemoCache(3);
|
||||
const c_0 = $[0] !== props.a;
|
||||
const c_1 = $[1] !== props.b;
|
||||
let t0;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== props.a || $[1] !== props.b) {
|
||||
t0 = foo(...props.a, null, ...props.b);
|
||||
$[0] = props.a;
|
||||
$[1] = props.b;
|
||||
|
||||
+2
-4
@@ -20,13 +20,11 @@ function Component(props) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function Component(props) {
|
||||
const $ = useMemoCache(4);
|
||||
const c_0 = $[0] !== props;
|
||||
let t1;
|
||||
if (c_0) {
|
||||
if ($[0] !== props) {
|
||||
const x = makeFunction(props);
|
||||
const c_2 = $[2] !== props.text;
|
||||
let t0;
|
||||
if (c_2) {
|
||||
if ($[2] !== props.text) {
|
||||
t0 = (
|
||||
<div>
|
||||
<span>{props.text}</span>
|
||||
|
||||
+1
-2
@@ -28,9 +28,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let x;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
x = { a };
|
||||
|
||||
const q = x;
|
||||
|
||||
+1
-2
@@ -30,9 +30,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let x;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
x = { a };
|
||||
const f0 = function () {
|
||||
const q = x;
|
||||
|
||||
+1
-2
@@ -48,9 +48,8 @@ function getNativeLogFunction(level) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function getNativeLogFunction(level) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== level;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== level) {
|
||||
t0 = function () {
|
||||
let str = undefined;
|
||||
if (arguments.length === 1 && typeof arguments[0] === "string") {
|
||||
|
||||
+1
-2
@@ -26,9 +26,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let z;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
z = { a };
|
||||
|
||||
(function () {
|
||||
|
||||
+1
-2
@@ -28,9 +28,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let z;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
z = { a };
|
||||
const f0 = function () {
|
||||
const f1 = function () {
|
||||
|
||||
+2
-4
@@ -24,9 +24,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(4);
|
||||
const c_0 = $[0] !== a;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
t0 = { a };
|
||||
$[0] = a;
|
||||
$[1] = t0;
|
||||
@@ -34,9 +33,8 @@ function component(a) {
|
||||
t0 = $[1];
|
||||
}
|
||||
const z = t0;
|
||||
const c_2 = $[2] !== z;
|
||||
let t1;
|
||||
if (c_2) {
|
||||
if ($[2] !== z) {
|
||||
t1 = () => {
|
||||
console.log(z);
|
||||
};
|
||||
|
||||
+1
-3
@@ -31,10 +31,8 @@ import { mutate } from "shared-runtime";
|
||||
|
||||
function component(foo, bar) {
|
||||
const $ = useMemoCache(3);
|
||||
const c_0 = $[0] !== foo;
|
||||
const c_1 = $[1] !== bar;
|
||||
let x;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== foo || $[1] !== bar) {
|
||||
x = { foo };
|
||||
const y = { bar };
|
||||
|
||||
|
||||
+1
-3
@@ -23,10 +23,8 @@ function component(foo, bar) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(foo, bar) {
|
||||
const $ = useMemoCache(3);
|
||||
const c_0 = $[0] !== foo;
|
||||
const c_1 = $[1] !== bar;
|
||||
let x;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== foo || $[1] !== bar) {
|
||||
x = { foo };
|
||||
const y = { bar };
|
||||
const f0 = function () {
|
||||
|
||||
+1
-3
@@ -31,10 +31,8 @@ const { mutate } = require("shared-runtime");
|
||||
|
||||
function component(foo, bar) {
|
||||
const $ = useMemoCache(3);
|
||||
const c_0 = $[0] !== foo;
|
||||
const c_1 = $[1] !== bar;
|
||||
let x;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== foo || $[1] !== bar) {
|
||||
x = { foo };
|
||||
const y = { bar };
|
||||
|
||||
|
||||
+1
-3
@@ -23,10 +23,8 @@ function component(foo, bar) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(foo, bar) {
|
||||
const $ = useMemoCache(3);
|
||||
const c_0 = $[0] !== foo;
|
||||
const c_1 = $[1] !== bar;
|
||||
let x;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== foo || $[1] !== bar) {
|
||||
x = { foo };
|
||||
const y = { bar };
|
||||
const f0 = function () {
|
||||
|
||||
+1
-3
@@ -31,10 +31,8 @@ const { mutate } = require("shared-runtime");
|
||||
|
||||
function component(foo, bar) {
|
||||
const $ = useMemoCache(3);
|
||||
const c_0 = $[0] !== foo;
|
||||
const c_1 = $[1] !== bar;
|
||||
let y;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== foo || $[1] !== bar) {
|
||||
const x = { foo };
|
||||
y = { bar };
|
||||
|
||||
|
||||
+1
-3
@@ -23,10 +23,8 @@ function component(foo, bar) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(foo, bar) {
|
||||
const $ = useMemoCache(3);
|
||||
const c_0 = $[0] !== foo;
|
||||
const c_1 = $[1] !== bar;
|
||||
let y;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== foo || $[1] !== bar) {
|
||||
const x = { foo };
|
||||
y = { bar };
|
||||
const f0 = function () {
|
||||
|
||||
+1
-3
@@ -31,10 +31,8 @@ const { mutate } = require("shared-runtime");
|
||||
|
||||
function component(foo, bar) {
|
||||
const $ = useMemoCache(3);
|
||||
const c_0 = $[0] !== foo;
|
||||
const c_1 = $[1] !== bar;
|
||||
let y;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== foo || $[1] !== bar) {
|
||||
const x = { foo };
|
||||
y = { bar };
|
||||
|
||||
|
||||
+1
-3
@@ -23,10 +23,8 @@ function component(foo, bar) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(foo, bar) {
|
||||
const $ = useMemoCache(3);
|
||||
const c_0 = $[0] !== foo;
|
||||
const c_1 = $[1] !== bar;
|
||||
let y;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== foo || $[1] !== bar) {
|
||||
const x = { foo };
|
||||
y = { bar };
|
||||
const f0 = function () {
|
||||
|
||||
+1
-2
@@ -29,9 +29,8 @@ const { mutate } = require("shared-runtime");
|
||||
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
const x = { a };
|
||||
y = {};
|
||||
|
||||
|
||||
+1
-2
@@ -21,9 +21,8 @@ function component(a) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
const x = { a };
|
||||
y = {};
|
||||
const f0 = function () {
|
||||
|
||||
+1
-2
@@ -29,9 +29,8 @@ const { mutate } = require("shared-runtime");
|
||||
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
const x = { a };
|
||||
y = {};
|
||||
|
||||
|
||||
+1
-2
@@ -21,9 +21,8 @@ function component(a) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
const x = { a };
|
||||
y = {};
|
||||
const f0 = function () {
|
||||
|
||||
+1
-2
@@ -30,9 +30,8 @@ import { mutate } from "shared-runtime";
|
||||
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
const x = { a };
|
||||
y = {};
|
||||
|
||||
|
||||
+1
-2
@@ -22,9 +22,8 @@ function component(a) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
const x = { a };
|
||||
y = {};
|
||||
const f0 = function () {
|
||||
|
||||
+1
-2
@@ -30,9 +30,8 @@ const { mutate } = require("shared-runtime");
|
||||
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
const x = { a };
|
||||
y = {};
|
||||
|
||||
|
||||
+1
-2
@@ -22,9 +22,8 @@ function component(a) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
const x = { a };
|
||||
y = {};
|
||||
const f0 = function () {
|
||||
|
||||
+2
-5
@@ -27,9 +27,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a, b) {
|
||||
const $ = useMemoCache(5);
|
||||
const c_0 = $[0] !== b;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== b) {
|
||||
t0 = { b };
|
||||
$[0] = b;
|
||||
$[1] = t0;
|
||||
@@ -37,10 +36,8 @@ function component(a, b) {
|
||||
t0 = $[1];
|
||||
}
|
||||
const y = t0;
|
||||
const c_2 = $[2] !== a;
|
||||
const c_3 = $[3] !== y.b;
|
||||
let z;
|
||||
if (c_2 || c_3) {
|
||||
if ($[2] !== a || $[3] !== y.b) {
|
||||
z = { a };
|
||||
const x = function () {
|
||||
z.a = 2;
|
||||
|
||||
+1
-2
@@ -26,9 +26,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a, b) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
t0 = { a };
|
||||
$[0] = a;
|
||||
$[1] = t0;
|
||||
|
||||
+1
-2
@@ -25,9 +25,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
y = { b: { a } };
|
||||
const x = function () {
|
||||
y.b.a = 2;
|
||||
|
||||
+1
-3
@@ -27,10 +27,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a, b) {
|
||||
const $ = useMemoCache(3);
|
||||
const c_0 = $[0] !== a;
|
||||
const c_1 = $[1] !== b;
|
||||
let z;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== a || $[1] !== b) {
|
||||
z = { a };
|
||||
const y = { b };
|
||||
const x = function () {
|
||||
|
||||
+1
-2
@@ -29,9 +29,8 @@ const { mutate } = require("shared-runtime");
|
||||
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
const x = { a };
|
||||
y = {};
|
||||
|
||||
|
||||
+1
-2
@@ -21,9 +21,8 @@ function component(a) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
const x = { a };
|
||||
y = {};
|
||||
const f0 = function () {
|
||||
|
||||
+2
-4
@@ -24,9 +24,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(4);
|
||||
const c_0 = $[0] !== a;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
t0 = { a };
|
||||
$[0] = a;
|
||||
$[1] = t0;
|
||||
@@ -34,9 +33,8 @@ function component(a) {
|
||||
t0 = $[1];
|
||||
}
|
||||
const z = t0;
|
||||
const c_2 = $[2] !== z;
|
||||
let t1;
|
||||
if (c_2) {
|
||||
if ($[2] !== z) {
|
||||
t1 = function () {
|
||||
console.log(z);
|
||||
};
|
||||
|
||||
+1
-2
@@ -26,9 +26,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function bar(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
const x = [a];
|
||||
y = {};
|
||||
|
||||
|
||||
+1
-2
@@ -27,9 +27,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function bar(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
const x = [a];
|
||||
y = {};
|
||||
const f0 = function () {
|
||||
|
||||
+1
-3
@@ -28,10 +28,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function bar(a, b) {
|
||||
const $ = useMemoCache(3);
|
||||
const c_0 = $[0] !== a;
|
||||
const c_1 = $[1] !== b;
|
||||
let y;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== a || $[1] !== b) {
|
||||
const x = [a, b];
|
||||
y = {};
|
||||
let t;
|
||||
|
||||
+1
-3
@@ -29,10 +29,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function bar(a, b) {
|
||||
const $ = useMemoCache(3);
|
||||
const c_0 = $[0] !== a;
|
||||
const c_1 = $[1] !== b;
|
||||
let y;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== a || $[1] !== b) {
|
||||
const x = [a, b];
|
||||
y = {};
|
||||
let t;
|
||||
|
||||
+1
-2
@@ -26,9 +26,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function bar(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
const x = [a];
|
||||
y = {};
|
||||
|
||||
|
||||
+1
-2
@@ -27,9 +27,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function bar(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
const x = [a];
|
||||
y = {};
|
||||
const f0 = function () {
|
||||
|
||||
+1
-2
@@ -26,9 +26,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function bar(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
const x = [a];
|
||||
y = {};
|
||||
|
||||
|
||||
+1
-2
@@ -27,9 +27,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function bar(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
const x = [a];
|
||||
y = {};
|
||||
const f0 = function () {
|
||||
|
||||
+3
-7
@@ -25,9 +25,8 @@ function component(a, b) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a, b) {
|
||||
const $ = useMemoCache(7);
|
||||
const c_0 = $[0] !== a;
|
||||
let z;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
z = { a };
|
||||
|
||||
mutate(z);
|
||||
@@ -38,9 +37,8 @@ function component(a, b) {
|
||||
}
|
||||
|
||||
let y = z;
|
||||
const c_2 = $[2] !== b;
|
||||
let t0;
|
||||
if (c_2) {
|
||||
if ($[2] !== b) {
|
||||
t0 = { b };
|
||||
$[2] = b;
|
||||
$[3] = t0;
|
||||
@@ -48,10 +46,8 @@ function component(a, b) {
|
||||
t0 = $[3];
|
||||
}
|
||||
const z_0 = t0;
|
||||
const c_4 = $[4] !== y;
|
||||
const c_5 = $[5] !== z_0;
|
||||
let t1;
|
||||
if (c_4 || c_5) {
|
||||
if ($[4] !== y || $[5] !== z_0) {
|
||||
t1 = { y, z: z_0 };
|
||||
$[4] = y;
|
||||
$[5] = z_0;
|
||||
|
||||
+2
-5
@@ -25,9 +25,8 @@ function component(a, b) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react"; // @debug
|
||||
function component(a, b) {
|
||||
const $ = useMemoCache(5);
|
||||
const c_0 = $[0] !== a;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
t0 = { a };
|
||||
$[0] = a;
|
||||
$[1] = t0;
|
||||
@@ -36,10 +35,8 @@ function component(a, b) {
|
||||
}
|
||||
const z = t0;
|
||||
const y = b;
|
||||
const c_2 = $[2] !== y;
|
||||
const c_3 = $[3] !== z;
|
||||
let t1;
|
||||
if (c_2 || c_3) {
|
||||
if ($[2] !== y || $[3] !== z) {
|
||||
t1 = function () {
|
||||
if (y) {
|
||||
maybeMutate(z);
|
||||
|
||||
+1
-2
@@ -25,9 +25,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let t;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
t = { a };
|
||||
const x = function x() {
|
||||
t.foo();
|
||||
|
||||
+1
-2
@@ -21,9 +21,8 @@ function Foo(props) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function Foo(props) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== props.router.location;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== props.router.location) {
|
||||
t0 = (reason) => {
|
||||
log(props.router.location);
|
||||
};
|
||||
|
||||
+3
-7
@@ -23,9 +23,8 @@ import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(t26) {
|
||||
const $ = useMemoCache(7);
|
||||
const { mutator } = t26;
|
||||
const c_0 = $[0] !== mutator;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== mutator) {
|
||||
t0 = () => {
|
||||
mutator.poke();
|
||||
};
|
||||
@@ -35,9 +34,8 @@ function component(t26) {
|
||||
t0 = $[1];
|
||||
}
|
||||
const poke = t0;
|
||||
const c_2 = $[2] !== mutator.user;
|
||||
let t1;
|
||||
if (c_2) {
|
||||
if ($[2] !== mutator.user) {
|
||||
t1 = () => {
|
||||
mutator.user.hide();
|
||||
};
|
||||
@@ -47,10 +45,8 @@ function component(t26) {
|
||||
t1 = $[3];
|
||||
}
|
||||
const hide = t1;
|
||||
const c_4 = $[4] !== poke;
|
||||
const c_5 = $[5] !== hide;
|
||||
let t2;
|
||||
if (c_4 || c_5) {
|
||||
if ($[4] !== poke || $[5] !== hide) {
|
||||
t2 = <Foo poke={poke} hide={hide} />;
|
||||
$[4] = poke;
|
||||
$[5] = hide;
|
||||
|
||||
+1
-2
@@ -21,9 +21,8 @@ function component(a, b) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a, b) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
t0 = { a };
|
||||
$[0] = a;
|
||||
$[1] = t0;
|
||||
|
||||
+3
-6
@@ -16,9 +16,8 @@ function component(a, b) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a, b) {
|
||||
const $ = useMemoCache(6);
|
||||
const c_0 = $[0] !== a;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
t0 = { a };
|
||||
$[0] = a;
|
||||
$[1] = t0;
|
||||
@@ -26,9 +25,8 @@ function component(a, b) {
|
||||
t0 = $[1];
|
||||
}
|
||||
const z = t0;
|
||||
const c_2 = $[2] !== z;
|
||||
let t1;
|
||||
if (c_2) {
|
||||
if ($[2] !== z) {
|
||||
t1 = () => <Foo>{z}</Foo>;
|
||||
$[2] = z;
|
||||
$[3] = t1;
|
||||
@@ -36,9 +34,8 @@ function component(a, b) {
|
||||
t1 = $[3];
|
||||
}
|
||||
const p = t1;
|
||||
const c_4 = $[4] !== p;
|
||||
let t2;
|
||||
if (c_4) {
|
||||
if ($[4] !== p) {
|
||||
t2 = p();
|
||||
$[4] = p;
|
||||
$[5] = t2;
|
||||
|
||||
+1
-2
@@ -21,9 +21,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function StoreLandingUnseenGiftModalContainer(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
const giftsSeen = { a };
|
||||
t0 = ((gift) => (gift.id ? giftsSeen[gift.id] : false))();
|
||||
$[0] = a;
|
||||
|
||||
+2
-4
@@ -27,9 +27,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(4);
|
||||
const c_0 = $[0] !== a;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
t0 = { a };
|
||||
$[0] = a;
|
||||
$[1] = t0;
|
||||
@@ -37,9 +36,8 @@ function component(a) {
|
||||
t0 = $[1];
|
||||
}
|
||||
const z = t0;
|
||||
const c_2 = $[2] !== z;
|
||||
let t1;
|
||||
if (c_2) {
|
||||
if ($[2] !== z) {
|
||||
t1 = function () {
|
||||
console.log(z);
|
||||
};
|
||||
|
||||
+2
-4
@@ -24,9 +24,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(4);
|
||||
const c_0 = $[0] !== a;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
t0 = { a };
|
||||
$[0] = a;
|
||||
$[1] = t0;
|
||||
@@ -34,9 +33,8 @@ function component(a) {
|
||||
t0 = $[1];
|
||||
}
|
||||
const z = t0;
|
||||
const c_2 = $[2] !== z.a;
|
||||
let t1;
|
||||
if (c_2) {
|
||||
if ($[2] !== z.a) {
|
||||
t1 = function () {
|
||||
console.log(z.a);
|
||||
};
|
||||
|
||||
+1
-2
@@ -24,9 +24,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
t0 = { a: { a } };
|
||||
$[0] = a;
|
||||
$[1] = t0;
|
||||
|
||||
+2
-4
@@ -26,9 +26,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(4);
|
||||
const c_0 = $[0] !== a;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
t0 = { a: { a } };
|
||||
$[0] = a;
|
||||
$[1] = t0;
|
||||
@@ -36,9 +35,8 @@ function component(a) {
|
||||
t0 = $[1];
|
||||
}
|
||||
const z = t0;
|
||||
const c_2 = $[2] !== z.a.a;
|
||||
let t1;
|
||||
if (c_2) {
|
||||
if ($[2] !== z.a.a) {
|
||||
t1 = function () {
|
||||
(function () {
|
||||
console.log(z.a.a);
|
||||
|
||||
+2
-4
@@ -24,9 +24,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(4);
|
||||
const c_0 = $[0] !== a;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
t0 = { a: { a } };
|
||||
$[0] = a;
|
||||
$[1] = t0;
|
||||
@@ -34,9 +33,8 @@ function component(a) {
|
||||
t0 = $[1];
|
||||
}
|
||||
const z = t0;
|
||||
const c_2 = $[2] !== z.a.a;
|
||||
let t1;
|
||||
if (c_2) {
|
||||
if ($[2] !== z.a.a) {
|
||||
t1 = function () {
|
||||
console.log(z.a.a);
|
||||
};
|
||||
|
||||
+1
-2
@@ -20,9 +20,8 @@ function component(a) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
const x = { a };
|
||||
y = 1;
|
||||
|
||||
|
||||
+2
-4
@@ -26,9 +26,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(4);
|
||||
const c_0 = $[0] !== a;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
t0 = { a };
|
||||
$[0] = a;
|
||||
$[1] = t0;
|
||||
@@ -36,9 +35,8 @@ function component(a) {
|
||||
t0 = $[1];
|
||||
}
|
||||
const z = t0;
|
||||
const c_2 = $[2] !== z;
|
||||
let t1;
|
||||
if (c_2) {
|
||||
if ($[2] !== z) {
|
||||
t1 = function () {
|
||||
console.log(z);
|
||||
};
|
||||
|
||||
+2
-4
@@ -26,9 +26,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a) {
|
||||
const $ = useMemoCache(4);
|
||||
const c_0 = $[0] !== a;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== a) {
|
||||
t0 = { a };
|
||||
$[0] = a;
|
||||
$[1] = t0;
|
||||
@@ -36,9 +35,8 @@ function component(a) {
|
||||
t0 = $[1];
|
||||
}
|
||||
const z = t0;
|
||||
const c_2 = $[2] !== z;
|
||||
let t1;
|
||||
if (c_2) {
|
||||
if ($[2] !== z) {
|
||||
t1 = function () {
|
||||
(function () {
|
||||
console.log(z);
|
||||
|
||||
+1
-2
@@ -19,9 +19,8 @@ import { unstable_useMemoCache as useMemoCache } from "react"; // @enableEmitFre
|
||||
function useFoo(props) {
|
||||
if (__DEV__) useRenderCounter("useFoo");
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== props.x;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== props.x) {
|
||||
t0 = foo(props.x);
|
||||
$[0] = props.x;
|
||||
$[1] = __DEV__ ? makeReadOnly(t0, "useFoo") : t0;
|
||||
|
||||
+2
-5
@@ -24,10 +24,8 @@ import { unstable_useMemoCache as useMemoCache } from "react"; // @enableEmitFre
|
||||
|
||||
function MyComponentName(props) {
|
||||
const $ = useMemoCache(5);
|
||||
const c_0 = $[0] !== props.a;
|
||||
const c_1 = $[1] !== props.b;
|
||||
let x;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== props.a || $[1] !== props.b) {
|
||||
x = {};
|
||||
foo(x, props.a);
|
||||
foo(x, props.b);
|
||||
@@ -37,9 +35,8 @@ function MyComponentName(props) {
|
||||
} else {
|
||||
x = $[2];
|
||||
}
|
||||
const c_3 = $[3] !== x;
|
||||
let y;
|
||||
if (c_3) {
|
||||
if ($[3] !== x) {
|
||||
y = [];
|
||||
y.push(x);
|
||||
$[3] = x;
|
||||
|
||||
+2
-4
@@ -30,9 +30,8 @@ const Bar = isForgetEnabled_Fixtures()
|
||||
? function Bar(props) {
|
||||
if (__DEV__) useRenderCounter("Bar");
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== props.bar;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== props.bar) {
|
||||
t0 = <div>{props.bar}</div>;
|
||||
$[0] = props.bar;
|
||||
$[1] = t0;
|
||||
@@ -54,9 +53,8 @@ const Foo = isForgetEnabled_Fixtures()
|
||||
? function Foo(props) {
|
||||
if (__DEV__) useRenderCounter("Foo");
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== props.bar;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== props.bar) {
|
||||
t0 = <Foo>{props.bar}</Foo>;
|
||||
$[0] = props.bar;
|
||||
$[1] = t0;
|
||||
|
||||
+2
-4
@@ -29,9 +29,8 @@ import { unstable_useMemoCache as useMemoCache } from "react"; // @instrumentFor
|
||||
function Bar(props) {
|
||||
if (__DEV__) useRenderCounter("Bar");
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== props.bar;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== props.bar) {
|
||||
t0 = <div>{props.bar}</div>;
|
||||
$[0] = props.bar;
|
||||
$[1] = t0;
|
||||
@@ -48,9 +47,8 @@ function NoForget(props) {
|
||||
function Foo(props) {
|
||||
if (__DEV__) useRenderCounter("Foo");
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== props.bar;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== props.bar) {
|
||||
t0 = <Foo>{props.bar}</Foo>;
|
||||
$[0] = props.bar;
|
||||
$[1] = t0;
|
||||
|
||||
+1
-2
@@ -17,9 +17,8 @@ import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
export default function Foo(t7) {
|
||||
const $ = useMemoCache(2);
|
||||
const { bar } = t7;
|
||||
const c_0 = $[0] !== bar;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== bar) {
|
||||
t0 = <Bar bar={bar} />;
|
||||
$[0] = bar;
|
||||
$[1] = t0;
|
||||
|
||||
+3
-8
@@ -45,10 +45,8 @@ function Component(props) {
|
||||
const $ = useMemoCache(8);
|
||||
const items = props.items;
|
||||
const maxItems = props.maxItems;
|
||||
const c_0 = $[0] !== maxItems;
|
||||
const c_1 = $[1] !== items;
|
||||
let renderedItems;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== maxItems || $[1] !== items) {
|
||||
renderedItems = [];
|
||||
const seen = new Set();
|
||||
const max = Math.max(0, maxItems);
|
||||
@@ -72,19 +70,16 @@ function Component(props) {
|
||||
}
|
||||
|
||||
const count = renderedItems.length;
|
||||
const c_3 = $[3] !== count;
|
||||
let t0;
|
||||
if (c_3) {
|
||||
if ($[3] !== count) {
|
||||
t0 = <h1>{count} Items</h1>;
|
||||
$[3] = count;
|
||||
$[4] = t0;
|
||||
} else {
|
||||
t0 = $[4];
|
||||
}
|
||||
const c_5 = $[5] !== t0;
|
||||
const c_6 = $[6] !== renderedItems;
|
||||
let t1;
|
||||
if (c_5 || c_6) {
|
||||
if ($[5] !== t0 || $[6] !== renderedItems) {
|
||||
t1 = (
|
||||
<div>
|
||||
{t0}
|
||||
|
||||
+1
-4
@@ -15,11 +15,8 @@ function Component(props) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function Component(props) {
|
||||
const $ = useMemoCache(4);
|
||||
const c_0 = $[0] !== props.method;
|
||||
const c_1 = $[1] !== props.a;
|
||||
const c_2 = $[2] !== props.b;
|
||||
let t0;
|
||||
if (c_0 || c_1 || c_2) {
|
||||
if ($[0] !== props.method || $[1] !== props.a || $[2] !== props.b) {
|
||||
t0 = foo[props.method](...props.a, null, ...props.b);
|
||||
$[0] = props.method;
|
||||
$[1] = props.a;
|
||||
|
||||
+1
-2
@@ -23,9 +23,8 @@ function Component(props) {
|
||||
const a = foo();
|
||||
|
||||
const t0 = a[props.a] + 1;
|
||||
const c_0 = $[0] !== t0;
|
||||
let t1;
|
||||
if (c_0) {
|
||||
if ($[0] !== t0) {
|
||||
t1 = bar(t0);
|
||||
$[0] = t0;
|
||||
$[1] = t1;
|
||||
|
||||
+1
-3
@@ -18,10 +18,8 @@ function component(a, b) {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function component(a, b) {
|
||||
const $ = useMemoCache(3);
|
||||
const c_0 = $[0] !== a;
|
||||
const c_1 = $[1] !== b;
|
||||
let x;
|
||||
if (c_0 || c_1) {
|
||||
if ($[0] !== a || $[1] !== b) {
|
||||
const y = { a };
|
||||
x = { b };
|
||||
x.y = y;
|
||||
|
||||
+1
-2
@@ -25,9 +25,8 @@ function component() {
|
||||
t0 = $[0];
|
||||
}
|
||||
const handler = t0;
|
||||
const c_1 = $[1] !== handler;
|
||||
let t1;
|
||||
if (c_1) {
|
||||
if ($[1] !== handler) {
|
||||
t1 = <Foo handler={handler} />;
|
||||
$[1] = handler;
|
||||
$[2] = t1;
|
||||
|
||||
+1
-2
@@ -29,9 +29,8 @@ import { unstable_useMemoCache as useMemoCache } from "react"; // To preserve th
|
||||
|
||||
function Component(props) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== props.a;
|
||||
let x;
|
||||
if (c_0) {
|
||||
if ($[0] !== props.a) {
|
||||
x = [];
|
||||
x.push(props.a?.b);
|
||||
$[0] = props.a;
|
||||
|
||||
+6
-5
@@ -35,12 +35,13 @@ import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
*/
|
||||
function Component(props) {
|
||||
const $ = useMemoCache(5);
|
||||
const c_0 = $[0] !== props.a;
|
||||
const c_1 = $[1] !== props.b;
|
||||
const c_2 = $[2] !== props.c;
|
||||
const c_3 = $[3] !== props.d;
|
||||
let a;
|
||||
if (c_0 || c_1 || c_2 || c_3) {
|
||||
if (
|
||||
$[0] !== props.a ||
|
||||
$[1] !== props.b ||
|
||||
$[2] !== props.c ||
|
||||
$[3] !== props.d
|
||||
) {
|
||||
a = [];
|
||||
a.push(props.a);
|
||||
bb1: {
|
||||
|
||||
+4
-10
@@ -67,11 +67,8 @@ import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
*/
|
||||
function ComponentA(props) {
|
||||
const $ = useMemoCache(4);
|
||||
const c_0 = $[0] !== props.a;
|
||||
const c_1 = $[1] !== props.b;
|
||||
const c_2 = $[2] !== props.d;
|
||||
let a_DEBUG;
|
||||
if (c_0 || c_1 || c_2) {
|
||||
if ($[0] !== props.a || $[1] !== props.b || $[2] !== props.d) {
|
||||
a_DEBUG = [];
|
||||
a_DEBUG.push(props.a);
|
||||
if (props.b) {
|
||||
@@ -94,9 +91,8 @@ function ComponentA(props) {
|
||||
*/
|
||||
function ComponentB(props) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== props;
|
||||
let a;
|
||||
if (c_0) {
|
||||
if ($[0] !== props) {
|
||||
a = [];
|
||||
a.push(props.a);
|
||||
if (props.b) {
|
||||
@@ -117,9 +113,8 @@ function ComponentB(props) {
|
||||
*/
|
||||
function ComponentC(props) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== props;
|
||||
let a;
|
||||
if (c_0) {
|
||||
if ($[0] !== props) {
|
||||
a = [];
|
||||
a.push(props.a);
|
||||
if (props.b) {
|
||||
@@ -141,9 +136,8 @@ function ComponentC(props) {
|
||||
*/
|
||||
function ComponentD(props) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== props;
|
||||
let a;
|
||||
if (c_0) {
|
||||
if ($[0] !== props) {
|
||||
a = [];
|
||||
a.push(props.a);
|
||||
if (props.b) {
|
||||
|
||||
+4
-10
@@ -37,10 +37,9 @@ function mayMutate() {}
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function ComponentA(props) {
|
||||
const $ = useMemoCache(6);
|
||||
const c_0 = $[0] !== props;
|
||||
let a;
|
||||
let b;
|
||||
if (c_0) {
|
||||
if ($[0] !== props) {
|
||||
a = [];
|
||||
b = [];
|
||||
if (b) {
|
||||
@@ -56,10 +55,8 @@ function ComponentA(props) {
|
||||
a = $[1];
|
||||
b = $[2];
|
||||
}
|
||||
const c_3 = $[3] !== a;
|
||||
const c_4 = $[4] !== b;
|
||||
let t0;
|
||||
if (c_3 || c_4) {
|
||||
if ($[3] !== a || $[4] !== b) {
|
||||
t0 = <Foo a={a} b={b} />;
|
||||
$[3] = a;
|
||||
$[4] = b;
|
||||
@@ -72,10 +69,9 @@ function ComponentA(props) {
|
||||
|
||||
function ComponentB(props) {
|
||||
const $ = useMemoCache(6);
|
||||
const c_0 = $[0] !== props;
|
||||
let a;
|
||||
let b;
|
||||
if (c_0) {
|
||||
if ($[0] !== props) {
|
||||
a = [];
|
||||
b = [];
|
||||
if (mayMutate(b)) {
|
||||
@@ -91,10 +87,8 @@ function ComponentB(props) {
|
||||
a = $[1];
|
||||
b = $[2];
|
||||
}
|
||||
const c_3 = $[3] !== a;
|
||||
const c_4 = $[4] !== b;
|
||||
let t0;
|
||||
if (c_3 || c_4) {
|
||||
if ($[3] !== a || $[4] !== b) {
|
||||
t0 = <Foo a={a} b={b} />;
|
||||
$[3] = a;
|
||||
$[4] = b;
|
||||
|
||||
+1
-2
@@ -32,9 +32,8 @@ import { shallowCopy } from "shared-runtime";
|
||||
|
||||
function Component(props) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== props;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== props) {
|
||||
t0 = shallowCopy(props);
|
||||
$[0] = props;
|
||||
$[1] = t0;
|
||||
|
||||
+1
-2
@@ -24,9 +24,8 @@ export const FIXTURE_ENTRYPOINT = {
|
||||
import { unstable_useMemoCache as useMemoCache } from "react";
|
||||
function Component(props) {
|
||||
const $ = useMemoCache(2);
|
||||
const c_0 = $[0] !== props.foo;
|
||||
let x;
|
||||
if (c_0) {
|
||||
if ($[0] !== props.foo) {
|
||||
x = {};
|
||||
x.foo = x.foo + x.bar;
|
||||
x.foo(props.foo);
|
||||
|
||||
+1
-2
@@ -39,9 +39,8 @@ function Test() {
|
||||
const $ = useMemoCache(2);
|
||||
const { tab } = useFoo();
|
||||
const currentTab = tab === CONST_STRING0 ? CONST_STRING0 : CONST_STRING1;
|
||||
const c_0 = $[0] !== currentTab;
|
||||
let t0;
|
||||
if (c_0) {
|
||||
if ($[0] !== currentTab) {
|
||||
t0 = <Text value={currentTab} />;
|
||||
$[0] = currentTab;
|
||||
$[1] = t0;
|
||||
|
||||
+1
-3
@@ -32,10 +32,8 @@ function component() {
|
||||
t0 = $[0];
|
||||
}
|
||||
const handler = t0;
|
||||
const c_1 = $[1] !== handler;
|
||||
const c_2 = $[2] !== x;
|
||||
let t1;
|
||||
if (c_1 || c_2) {
|
||||
if ($[1] !== handler || $[2] !== x) {
|
||||
t1 = <input onChange={handler} value={x} />;
|
||||
$[1] = handler;
|
||||
$[2] = x;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user