diff --git a/compiler/packages/babel-plugin-react-forget/src/HIR/Environment.ts b/compiler/packages/babel-plugin-react-forget/src/HIR/Environment.ts index 2b396e425f..b7eacef613 100644 --- a/compiler/packages/babel-plugin-react-forget/src/HIR/Environment.ts +++ b/compiler/packages/babel-plugin-react-forget/src/HIR/Environment.ts @@ -217,6 +217,7 @@ export const DEFAULT_ENVIRONMENT_CONFIG: Readonly = { memoizeJsxElements: true, validateHooksUsage: true, + enableMergeConsecutiveScopes: true, assertValidMutableRanges: false, bailoutOnHoleyArrays: false, @@ -224,7 +225,6 @@ export const DEFAULT_ENVIRONMENT_CONFIG: Readonly = { enableAssumeHooksFollowRulesOfReact: false, enableEmitFreeze: null, enableForest: false, - enableMergeConsecutiveScopes: false, validateFrozenLambdas: false, validateNoSetStateInRender: false, diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/array-at-mutate-after-capture.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/array-at-mutate-after-capture.expect.md index 5f6fb257bb..121d085be1 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/array-at-mutate-after-capture.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/array-at-mutate-after-capture.expect.md @@ -21,22 +21,15 @@ function Component(props) { import { unstable_useMemoCache as useMemoCache } from "react"; // x's mutable range should extend to `mutate(y)` function Component(props) { - const $ = useMemoCache(2); + const $ = useMemoCache(1); let t0; if ($[0] === Symbol.for("react.memo_cache_sentinel")) { - t0 = {}; + t0 = [42, {}]; $[0] = t0; } else { t0 = $[0]; } - let t1; - if ($[1] === Symbol.for("react.memo_cache_sentinel")) { - t1 = [42, t0]; - $[1] = t1; - } else { - t1 = $[1]; - } - const x = t1; + const x = t0; const idx = foo(props.b); const y = x.at(idx); mutate(y); diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/array-join.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/array-join.expect.md index 9bc2c32d5f..0ce1b81ccc 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/array-join.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/array-join.expect.md @@ -18,17 +18,14 @@ import { unstable_useMemoCache as useMemoCache } from "react"; function Component(props) { const $ = useMemoCache(8); let t0; + let t1; if ($[0] === Symbol.for("react.memo_cache_sentinel")) { t0 = {}; - $[0] = t0; - } else { - t0 = $[0]; - } - let t1; - if ($[1] === Symbol.for("react.memo_cache_sentinel")) { t1 = []; + $[0] = t0; $[1] = t1; } else { + t0 = $[0]; t1 = $[1]; } const c_2 = $[2] !== props.value; diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/assignment-variations-complex-lvalue-array.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/assignment-variations-complex-lvalue-array.expect.md index 2816a588df..451f29f572 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/assignment-variations-complex-lvalue-array.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/assignment-variations-complex-lvalue-array.expect.md @@ -22,22 +22,15 @@ export const FIXTURE_ENTRYPOINT = { ```javascript import { unstable_useMemoCache as useMemoCache } from "react"; function foo() { - const $ = useMemoCache(2); + const $ = useMemoCache(1); let t0; if ($[0] === Symbol.for("react.memo_cache_sentinel")) { - t0 = [1]; + t0 = [[1]]; $[0] = t0; } else { t0 = $[0]; } - let t1; - if ($[1] === Symbol.for("react.memo_cache_sentinel")) { - t1 = [t0]; - $[1] = t1; - } else { - t1 = $[1]; - } - const a = t1; + const a = t0; const first = a.at(0); first.set(0, 2); return a; diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/call-with-independently-memoizable-arg.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/call-with-independently-memoizable-arg.expect.md index d1b337c83b..ac3985eaff 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/call-with-independently-memoizable-arg.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/call-with-independently-memoizable-arg.expect.md @@ -19,36 +19,31 @@ function Component(props) { ```javascript import { unstable_useMemoCache as useMemoCache } from "react"; function Component(props) { - const $ = useMemoCache(6); + const $ = useMemoCache(4); const c_0 = $[0] !== props; - let t2; + let t1; if (c_0) { const x = makeFunction(props); const c_2 = $[2] !== props.text; let t0; if (c_2) { - t0 = {props.text}; + t0 = ( +
+ {props.text} +
+ ); $[2] = props.text; $[3] = t0; } else { t0 = $[3]; } - const c_4 = $[4] !== t0; - let t1; - if (c_4) { - t1 =
{t0}
; - $[4] = t0; - $[5] = t1; - } else { - t1 = $[5]; - } - t2 = x(t1); + t1 = x(t0); $[0] = props; - $[1] = t2; + $[1] = t1; } else { - t2 = $[1]; + t1 = $[1]; } - const y = t2; + const y = t1; return y; } diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/capturing-nested-member-call.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/capturing-nested-member-call.expect.md index 890c59291d..9725ed6b7c 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/capturing-nested-member-call.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/capturing-nested-member-call.expect.md @@ -23,26 +23,17 @@ export const FIXTURE_ENTRYPOINT = { ```javascript import { unstable_useMemoCache as useMemoCache } from "react"; function component(a) { - const $ = useMemoCache(4); + const $ = useMemoCache(2); const c_0 = $[0] !== a; let t0; if (c_0) { - t0 = { a }; + t0 = { a: { a } }; $[0] = a; $[1] = t0; } else { t0 = $[1]; } - const c_2 = $[2] !== t0; - let t1; - if (c_2) { - t1 = { a: t0 }; - $[2] = t0; - $[3] = t1; - } else { - t1 = $[3]; - } - const z = t1; + const z = t0; return z; } diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/capturing-nested-member-expr-in-nested-func.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/capturing-nested-member-expr-in-nested-func.expect.md index 81376cbacc..ec43972dd2 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/capturing-nested-member-expr-in-nested-func.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/capturing-nested-member-expr-in-nested-func.expect.md @@ -25,40 +25,31 @@ export const FIXTURE_ENTRYPOINT = { ```javascript import { unstable_useMemoCache as useMemoCache } from "react"; function component(a) { - const $ = useMemoCache(6); + const $ = useMemoCache(4); const c_0 = $[0] !== a; let t0; if (c_0) { - t0 = { a }; + t0 = { a: { a } }; $[0] = a; $[1] = t0; } else { t0 = $[1]; } - const c_2 = $[2] !== t0; + const z = t0; + const c_2 = $[2] !== z.a.a; let t1; if (c_2) { - t1 = { a: t0 }; - $[2] = t0; - $[3] = t1; - } else { - t1 = $[3]; - } - const z = t1; - const c_4 = $[4] !== z.a.a; - let t2; - if (c_4) { - t2 = function () { + t1 = function () { (function () { console.log(z.a.a); })(); }; - $[4] = z.a.a; - $[5] = t2; + $[2] = z.a.a; + $[3] = t1; } else { - t2 = $[5]; + t1 = $[3]; } - const x = t2; + const x = t1; return x; } diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/capturing-nested-member-expr.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/capturing-nested-member-expr.expect.md index de186ace24..2be79b9fcb 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/capturing-nested-member-expr.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/capturing-nested-member-expr.expect.md @@ -23,38 +23,29 @@ export const FIXTURE_ENTRYPOINT = { ```javascript import { unstable_useMemoCache as useMemoCache } from "react"; function component(a) { - const $ = useMemoCache(6); + const $ = useMemoCache(4); const c_0 = $[0] !== a; let t0; if (c_0) { - t0 = { a }; + t0 = { a: { a } }; $[0] = a; $[1] = t0; } else { t0 = $[1]; } - const c_2 = $[2] !== t0; + const z = t0; + const c_2 = $[2] !== z.a.a; let t1; if (c_2) { - t1 = { a: t0 }; - $[2] = t0; + t1 = function () { + console.log(z.a.a); + }; + $[2] = z.a.a; $[3] = t1; } else { t1 = $[3]; } - const z = t1; - const c_4 = $[4] !== z.a.a; - let t2; - if (c_4) { - t2 = function () { - console.log(z.a.a); - }; - $[4] = z.a.a; - $[5] = t2; - } else { - t2 = $[5]; - } - const x = t2; + const x = t1; return x; } diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/computed-call-evaluation-order.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/computed-call-evaluation-order.expect.md index e42a29559f..d12d2a8959 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/computed-call-evaluation-order.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/computed-call-evaluation-order.expect.md @@ -30,7 +30,7 @@ export const FIXTURE_ENTRYPOINT = { ```javascript import { unstable_useMemoCache as useMemoCache } from "react"; // Should print A, B, arg, original function Component() { - const $ = useMemoCache(3); + const $ = useMemoCache(2); let t0; if ($[0] === Symbol.for("react.memo_cache_sentinel")) { t0 = (o) => { @@ -41,23 +41,16 @@ function Component() { t0 = $[0]; } const changeF = t0; - let t1; - if ($[1] === Symbol.for("react.memo_cache_sentinel")) { - t1 = () => console.log("original"); - $[1] = t1; - } else { - t1 = $[1]; - } let x; - if ($[2] === Symbol.for("react.memo_cache_sentinel")) { - x = { f: t1 }; + if ($[1] === Symbol.for("react.memo_cache_sentinel")) { + x = { f: () => console.log("original") }; (console.log("A"), x)[(console.log("B"), "f")]( (changeF(x), console.log("arg"), 1) ); - $[2] = x; + $[1] = x; } else { - x = $[2]; + x = $[1]; } return x; } diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/fbtparam-text-must-use-expression-container.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/fbtparam-text-must-use-expression-container.expect.md index c8de7c1070..986ed8c2f8 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/fbtparam-text-must-use-expression-container.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/fbtparam-text-must-use-expression-container.expect.md @@ -25,22 +25,19 @@ import { unstable_useMemoCache as useMemoCache } from "react"; import fbt from "fbt"; function Component(props) { - const $ = useMemoCache(2); + const $ = useMemoCache(1); let t0; if ($[0] === Symbol.for("react.memo_cache_sentinel")) { - t0 = fbt._("{value}%", [fbt._param("value", "0")], { hk: "10F5Cc" }); + t0 = ( + + ); $[0] = t0; } else { t0 = $[0]; } - let t1; - if ($[1] === Symbol.for("react.memo_cache_sentinel")) { - t1 = ; - $[1] = t1; - } else { - t1 = $[1]; - } - return t1; + return t0; } ``` diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/fbtparam-with-jsx-element-content.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/fbtparam-with-jsx-element-content.expect.md index c73d301680..67fd35327e 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/fbtparam-with-jsx-element-content.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/fbtparam-with-jsx-element-content.expect.md @@ -29,36 +29,40 @@ import { unstable_useMemoCache as useMemoCache } from "react"; import fbt from "fbt"; function Component(t39) { - const $ = useMemoCache(6); + const $ = useMemoCache(4); const { name, data, icon } = t39; const c_0 = $[0] !== name; const c_1 = $[1] !== icon; const c_2 = $[2] !== data; let t0; if (c_0 || c_1 || c_2) { - t0 = fbt._( - "{item author}{icon}{=m2}", - [ - fbt._param( - "item author", + t0 = ( + + {fbt._( + "{item author}{icon}{=m2}", + [ + fbt._param( + "item author", - {name} - ), - fbt._param( - "icon", + {name} + ), + fbt._param( + "icon", - icon - ), - fbt._implicitParam( - "=m2", - - {fbt._("{item details}", [fbt._param("item details", data)], { - hk: "4jLfVq", - })} - - ), - ], - { hk: "2HLm2j" } + icon + ), + fbt._implicitParam( + "=m2", + + {fbt._("{item details}", [fbt._param("item details", data)], { + hk: "4jLfVq", + })} + + ), + ], + { hk: "2HLm2j" } + )} + ); $[0] = name; $[1] = icon; @@ -67,16 +71,7 @@ function Component(t39) { } else { t0 = $[3]; } - const c_4 = $[4] !== t0; - let t1; - if (c_4) { - t1 = {t0}; - $[4] = t0; - $[5] = t1; - } else { - t1 = $[5]; - } - return t1; + return t0; } ``` diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/fbtparam-with-jsx-fragment-value.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/fbtparam-with-jsx-fragment-value.expect.md index 936bde3853..38c76f4e25 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/fbtparam-with-jsx-fragment-value.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/fbtparam-with-jsx-fragment-value.expect.md @@ -27,28 +27,25 @@ import fbt from "fbt"; import { identity } from "shared-runtime"; function Component(props) { - const $ = useMemoCache(4); + const $ = useMemoCache(2); const c_0 = $[0] !== props.text; let t0; if (c_0) { - t0 = fbt._("{value}%", [fbt._param("value", <>{identity(props.text)})], { - hk: "10F5Cc", - }); + t0 = ( + {identity(props.text)})], + { hk: "10F5Cc" } + )} + /> + ); $[0] = props.text; $[1] = t0; } else { t0 = $[1]; } - const c_2 = $[2] !== t0; - let t1; - if (c_2) { - t1 = ; - $[2] = t0; - $[3] = t1; - } else { - t1 = $[3]; - } - return t1; + return t0; } ``` diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/function-declaration-reassign.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/function-declaration-reassign.expect.md index 605d4248d4..fe9932b3cb 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/function-declaration-reassign.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/function-declaration-reassign.expect.md @@ -23,24 +23,17 @@ export const FIXTURE_ENTRYPOINT = { ```javascript import { unstable_useMemoCache as useMemoCache } from "react"; function component() { - const $ = useMemoCache(2); - let t0; + const $ = useMemoCache(1); + let x; if ($[0] === Symbol.for("react.memo_cache_sentinel")) { - t0 = function x(a) { + x = function x(a) { a.foo(); }; - $[0] = t0; - } else { - t0 = $[0]; - } - let x; - if ($[1] === Symbol.for("react.memo_cache_sentinel")) { - x = t0; x = {}; - $[1] = x; + $[0] = x; } else { - x = $[1]; + x = $[0]; } return x; } diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/inner-memo-value-not-promoted-to-outer-scope-static.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/inner-memo-value-not-promoted-to-outer-scope-static.expect.md index 76109bdee7..cf254f62a9 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/inner-memo-value-not-promoted-to-outer-scope-static.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/inner-memo-value-not-promoted-to-outer-scope-static.expect.md @@ -21,7 +21,7 @@ function Component(props) { ```javascript import { unstable_useMemoCache as useMemoCache } from "react"; function Component(props) { - const $ = useMemoCache(11); + const $ = useMemoCache(9); let t1; let T2; let t3; @@ -62,38 +62,22 @@ function Component(props) { } let t7; if ($[8] === Symbol.for("react.memo_cache_sentinel")) { - t7 = {t1}; + t7 = ( + + {t6} + + {t3} + {t0} + {t4} + {t1} + + + ); $[8] = t7; } else { t7 = $[8]; } - let t8; - if ($[9] === Symbol.for("react.memo_cache_sentinel")) { - t8 = ( - - {t3} - {t0} - {t4} - {t7} - - ); - $[9] = t8; - } else { - t8 = $[9]; - } - let t9; - if ($[10] === Symbol.for("react.memo_cache_sentinel")) { - t9 = ( - - {t6} - {t8} - - ); - $[10] = t9; - } else { - t9 = $[10]; - } - return t9; + return t7; } ``` diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/jsx-fragment.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/jsx-fragment.expect.md index fa634342d3..d2ba9cbde0 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/jsx-fragment.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/jsx-fragment.expect.md @@ -26,36 +26,34 @@ export const FIXTURE_ENTRYPOINT = { ```javascript import { unstable_useMemoCache as useMemoCache } from "react"; function Foo(props) { - const $ = useMemoCache(4); + const $ = useMemoCache(3); let t0; if ($[0] === Symbol.for("react.memo_cache_sentinel")) { - t0 = <>Text; + t0 = ( +
+ <>Text +
+ ); $[0] = t0; } else { t0 = $[0]; } + const c_1 = $[1] !== props.greeting; let t1; - if ($[1] === Symbol.for("react.memo_cache_sentinel")) { - t1 =
{t0}
; - $[1] = t1; - } else { - t1 = $[1]; - } - const c_2 = $[2] !== props.greeting; - let t2; - if (c_2) { - t2 = ( + if (c_1) { + t1 = ( <> - Hello {props.greeting} {t1} + Hello {props.greeting} {t0} ); - $[2] = props.greeting; - $[3] = t2; + $[1] = props.greeting; + $[2] = t1; } else { - t2 = $[3]; + t1 = $[2]; } - return t2; + return t1; } + export const FIXTURE_ENTRYPOINT = { fn: Foo, params: ["TodoAdd"], diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/jsx-member-expression.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/jsx-member-expression.expect.md index 5064c05324..4572807f1f 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/jsx-member-expression.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/jsx-member-expression.expect.md @@ -17,22 +17,19 @@ function Component(props) { ```javascript import { unstable_useMemoCache as useMemoCache } from "react"; function Component(props) { - const $ = useMemoCache(2); + const $ = useMemoCache(1); let t0; if ($[0] === Symbol.for("react.memo_cache_sentinel")) { - t0 = ; + t0 = ( + + + + ); $[0] = t0; } else { t0 = $[0]; } - let t1; - if ($[1] === Symbol.for("react.memo_cache_sentinel")) { - t1 = {t0}; - $[1] = t1; - } else { - t1 = $[1]; - } - return t1; + return t0; } ``` diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/jsx-ternary-local-variable.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/jsx-ternary-local-variable.expect.md index d234d17c75..9529acd2d1 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/jsx-ternary-local-variable.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/jsx-ternary-local-variable.expect.md @@ -24,36 +24,18 @@ import { unstable_useMemoCache as useMemoCache } from "react"; import { RenderPropAsChild, StaticText1, StaticText2 } from "shared-runtime"; function Component(props) { - const $ = useMemoCache(6); + const $ = useMemoCache(2); const Foo = props.showText1 ? StaticText1 : StaticText2; const c_0 = $[0] !== Foo; let t0; if (c_0) { - t0 = () => ; + t0 = ]} />; $[0] = Foo; $[1] = t0; } else { t0 = $[1]; } - const c_2 = $[2] !== t0; - let t1; - if (c_2) { - t1 = [t0]; - $[2] = t0; - $[3] = t1; - } else { - t1 = $[3]; - } - const c_4 = $[4] !== t1; - let t2; - if (c_4) { - t2 = ; - $[4] = t1; - $[5] = t2; - } else { - t2 = $[5]; - } - return t2; + return t0; } export const FIXTURE_ENTRYPOINT = { diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/lambda-with-fbt.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/lambda-with-fbt.expect.md index 8df18e36a1..33448e7e3a 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/lambda-with-fbt.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/lambda-with-fbt.expect.md @@ -42,7 +42,7 @@ import { unstable_useMemoCache as useMemoCache } from "react"; import { fbt } from "fbt"; function Component() { - const $ = useMemoCache(4); + const $ = useMemoCache(3); let t0; if ($[0] === Symbol.for("react.memo_cache_sentinel")) { t0 = () => { @@ -80,19 +80,16 @@ function Component() { } let t2; if ($[2] === Symbol.for("react.memo_cache_sentinel")) { - t2 =