@samitouri / QOS-React-1 / commits / 7e3be125e8

Use unique name for c import local identifier

ghstack-source-id: 93055b972fd91572edf8ba51c980006dfdfcd314 Pull Request resolved: https://github.com/facebook/react-forget/pull/2961

Joe Savona committed May 13, 2024 at 12:56 UTC 7e3be125e8b9bd6608d2532c9ec5997eac35267b
748 files changed +1699 -1565
compiler/apps/playground/__tests__/e2e/__snapshots__/page.spec.ts/default-input.txt
+1 -1
@@ -1,5 +1,5 @@
1 function MyApp() {
2 -  const $ = useMemoCache(1);
2 +  const $ = _c(1);
3   let t0;
4   if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
5     t0 = <div>Hello World</div>;
compiler/apps/playground/__tests__/e2e/__snapshots__/page.spec.ts/user-input.txt
+1 -1
@@ -1,5 +1,5 @@
1 function TestComponent(t0) {
2 -  const $ = useMemoCache(2);
2 +  const $ = _c(2);
3   const { x } = t0;
4   let t1;
5   if ($[0] !== x) {
compiler/apps/playground/components/Editor/EditorImpl.tsx
+1
@@ -202,6 +202,7 @@ function compile(source: string): CompilerOutput {
202 customHooks: new Map([...COMMON_HOOKS]),
203 },
204 getReactFunctionType(id),
205 + "_c",
206 null,
207 null,
208 null,
compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Imports.ts
+23 -41
@@ -10,7 +10,6 @@ import * as t from "@babel/types";
10 import { CompilerError } from "../CompilerError";
11 import { ExternalFunction, GeneratedSource } from "../HIR";
12 import { getOrInsertDefault } from "../Utils/utils";
13 -import { PluginOptions } from "./Options";
13
14 export function addImportsToProgram(
15 path: NodePath<t.Program>,
@@ -78,28 +77,12 @@ function isNonNamespacedImport(
77 );
78 }
79
81 -function findExistingImports(
80 +function hasExistingNonNamespacedImportOfModule(
81 program: NodePath<t.Program>,
82 moduleName: string
84 -): {
85 - didInsertUseMemoCache: boolean;
86 - hasExistingImport: boolean;
87 -} {
88 - let didInsertUseMemoCache = false;
83 +): boolean {
84 let hasExistingImport = false;
85 program.traverse({
91 - CallExpression(callExprPath) {
92 - const callee = callExprPath.get("callee");
93 - const args = callExprPath.get("arguments");
94 - if (
95 - callee.isIdentifier() &&
96 - callee.node.name === "useMemoCache" &&
97 - args.length === 1 &&
98 - args[0].isNumericLiteral()
99 - ) {
100 - didInsertUseMemoCache = true;
101 - }
102 - },
86 ImportDeclaration(importDeclPath) {
87 if (isNonNamespacedImport(importDeclPath, moduleName)) {
88 hasExistingImport = true;
@@ -107,19 +90,17 @@ function findExistingImports(
90 },
91 });
92
110 - return {
111 - didInsertUseMemoCache,
112 - hasExistingImport,
113 - };
93 + return hasExistingImport;
94 }
95
96 /*
97 * If an existing import of React exists (ie `import {useMemo} from 'react'`), inject useMemoCache
98 * into the list of destructured variables.
99 */
120 -function updateExistingImportDeclaration(
100 +function addMemoCacheFunctionSpecifierToExistingImport(
101 program: NodePath<t.Program>,
122 - moduleName: string
102 + moduleName: string,
103 + identifierName: string
104 ): boolean {
105 let didInsertUseMemoCache = false;
106 program.traverse({
@@ -130,7 +111,7 @@ function updateExistingImportDeclaration(
111 ) {
112 importDeclPath.pushContainer(
113 "specifiers",
133 - t.importSpecifier(t.identifier("useMemoCache"), t.identifier("c"))
114 + t.importSpecifier(t.identifier(identifierName), t.identifier("c"))
115 );
116 didInsertUseMemoCache = true;
117 }
@@ -139,29 +120,25 @@ function updateExistingImportDeclaration(
120 return didInsertUseMemoCache;
121 }
122
142 -export function updateUseMemoCacheImport(
123 +export function updateMemoCacheFunctionImport(
124 program: NodePath<t.Program>,
144 - options: PluginOptions
125 + moduleName: string,
126 + useMemoCacheIdentifier: string
127 ): void {
146 - const moduleName = options.runtimeModule ?? "react/compiler-runtime";
128 /*
129 * If there isn't already an import of * as React, insert it so useMemoCache doesn't
130 * throw
131 */
151 - const { didInsertUseMemoCache, hasExistingImport } = findExistingImports(
132 + const hasExistingImport = hasExistingNonNamespacedImportOfModule(
133 program,
134 moduleName
135 );
136
156 - if (!didInsertUseMemoCache) {
157 - // useMemoCache was not generated, nothing to do
158 - return;
159 - }
160 -
137 if (hasExistingImport) {
162 - const didUpdateImport = updateExistingImportDeclaration(
138 + const didUpdateImport = addMemoCacheFunctionSpecifierToExistingImport(
139 program,
164 - moduleName
140 + moduleName,
141 + useMemoCacheIdentifier
142 );
143 if (!didUpdateImport) {
144 throw new Error(
@@ -169,18 +146,23 @@ export function updateUseMemoCacheImport(
146 );
147 }
148 } else {
172 - addUseMemoCacheImportDeclaration(program, moduleName);
149 + addMemoCacheFunctionImportDeclaration(
150 + program,
151 + moduleName,
152 + useMemoCacheIdentifier
153 + );
154 }
155 }
156
176 -function addUseMemoCacheImportDeclaration(
157 +function addMemoCacheFunctionImportDeclaration(
158 program: NodePath<t.Program>,
178 - moduleName: string
159 + moduleName: string,
160 + localName: string
161 ): void {
162 program.unshiftContainer(
163 "body",
164 t.importDeclaration(
183 - [t.importSpecifier(t.identifier("useMemoCache"), t.identifier("c"))],
165 + [t.importSpecifier(t.identifier(localName), t.identifier("c"))],
166 t.stringLiteral(moduleName)
167 )
168 );
compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts
+13 -3
@@ -104,7 +104,7 @@ export function* run(
104 >,
105 config: EnvironmentConfig,
106 fnType: ReactFunctionType,
107 -
107 + useMemoCacheIdentifier: string,
108 logger: Logger | null,
109 filename: string | null,
110 code: string | null
@@ -116,7 +116,8 @@ export function* run(
116 contextIdentifiers,
117 logger,
118 filename,
119 - code
119 + code,
120 + useMemoCacheIdentifier
121 );
122 yield {
123 kind: "debug",
@@ -453,11 +454,20 @@ export function compileFn(
454 >,
455 config: EnvironmentConfig,
456 fnType: ReactFunctionType,
457 + useMemoCacheIdentifier: string,
458 logger: Logger | null,
459 filename: string | null,
460 code: string | null
461 ): CodegenFunction {
460 - let generator = run(func, config, fnType, logger, filename, code);
462 + let generator = run(
463 + func,
464 + config,
465 + fnType,
466 + useMemoCacheIdentifier,
467 + logger,
468 + filename,
469 + code
470 + );
471 while (true) {
472 const next = generator.next();
473 if (next.done) {
compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts
+44 -12
@@ -23,7 +23,7 @@ import { isComponentDeclaration } from "../Utils/ComponentDeclaration";
23 import { isHookDeclaration } from "../Utils/HookDeclaration";
24 import { assertExhaustive } from "../Utils/utils";
25 import { insertGatedFunctionDeclaration } from "./Gating";
26 -import { addImportsToProgram, updateUseMemoCacheImport } from "./Imports";
26 +import { addImportsToProgram, updateMemoCacheFunctionImport } from "./Imports";
27 import { PluginOptions, parsePluginOptions } from "./Options";
28 import { compileFn } from "./Pipeline";
29 import {
@@ -248,6 +248,11 @@ export function compileProgram(
248 }
249
250 const environment = parseEnvironmentConfig(pass.opts.environment ?? {});
251 + const useMemoCacheIdentifier = program.scope.generateUidIdentifier("c");
252 + const moduleName = options.runtimeModule ?? "react/compiler-runtime";
253 + if (hasMemoCacheFunctionImport(program, moduleName)) {
254 + return;
255 + }
256
257 /*
258 * Record lint errors and critical errors as depending on Forget's config,
@@ -313,6 +318,7 @@ export function compileProgram(
318 fn,
319 config,
320 fnType,
321 + useMemoCacheIdentifier.name,
322 options.logger,
323 pass.filename,
324 pass.code
@@ -436,7 +442,21 @@ export function compileProgram(
442
443 // Forget compiled the component, we need to update existing imports of useMemoCache
444 if (compiledFns.length > 0) {
439 - updateUseMemoCacheImport(program, options);
445 + let needsMemoCacheFunctionImport = false;
446 + for (const fn of compiledFns) {
447 + if (fn.compiledFn.memoSlotsUsed > 0) {
448 + needsMemoCacheFunctionImport = true;
449 + break;
450 + }
451 + }
452 +
453 + if (needsMemoCacheFunctionImport) {
454 + updateMemoCacheFunctionImport(
455 + program,
456 + moduleName,
457 + useMemoCacheIdentifier.name
458 + );
459 + }
460 addImportsToProgram(program, externalFunctions);
461 }
462 }
@@ -445,9 +465,6 @@ function getReactFunctionType(
465 fn: BabelFn,
466 pass: CompilerPass
467 ): ReactFunctionType | null {
448 - if (hasUseMemoCacheCall(fn)) {
449 - return null;
450 - }
468 const hookPattern = pass.opts.environment?.hookPattern ?? null;
469 if (fn.node.body.type === "BlockStatement") {
470 // Opt-outs disable compilation regardless of mode
@@ -508,15 +525,30 @@ function getReactFunctionType(
525 }
526 }
527
511 -function hasUseMemoCacheCall(
512 - fn: NodePath<
513 - t.FunctionDeclaration | t.FunctionExpression | t.ArrowFunctionExpression
514 - >
528 +/**
529 + * Returns true if the program contains an `import {c} from "<moduleName>"` declaration,
530 + * regardless of the local name of the 'c' specifier and the presence of other specifiers
531 + * in the same declaration.
532 + */
533 +function hasMemoCacheFunctionImport(
534 + program: NodePath<t.Program>,
535 + moduleName: string
536 ): boolean {
537 let hasUseMemoCache = false;
517 - fn.traverse({
518 - Identifier(path) {
519 - if (path.node.name === "useMemoCache") {
538 + program.traverse({
539 + ImportSpecifier(path) {
540 + const imported = path.get("imported");
541 + let importedName: string | null = null;
542 + if (imported.isIdentifier()) {
543 + importedName = imported.node.name;
544 + } else if (imported.isStringLiteral()) {
545 + importedName = imported.node.value;
546 + }
547 + if (
548 + importedName === "c" &&
549 + path.parentPath.isImportDeclaration() &&
550 + path.parentPath.get("source").node.value === moduleName
551 + ) {
552 hasUseMemoCache = true;
553 }
554 },
compiler/packages/babel-plugin-react-compiler/src/HIR/Environment.ts
+4 -1
@@ -437,6 +437,7 @@ export class Environment {
437 code: string | null;
438 config: EnvironmentConfig;
439 fnType: ReactFunctionType;
440 + useMemoCacheIdentifier: string;
441
442 #contextIdentifiers: Set<t.Identifier>;
443 #hoistedIdentifiers: Set<t.Identifier>;
@@ -447,13 +448,15 @@ export class Environment {
448 contextIdentifiers: Set<t.Identifier>,
449 logger: Logger | null,
450 filename: string | null,
450 - code: string | null
451 + code: string | null,
452 + useMemoCacheIdentifier: string
453 ) {
454 this.fnType = fnType;
455 this.config = config;
456 this.filename = filename;
457 this.code = code;
458 this.logger = logger;
459 + this.useMemoCacheIdentifier = useMemoCacheIdentifier;
460 this.#shapes = new Map(DEFAULT_SHAPES);
461 this.#globals = new Map(DEFAULT_GLOBALS);
462
compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts
+1 -1
@@ -125,7 +125,7 @@ export function codegenFunction(
125 t.variableDeclaration("const", [
126 t.variableDeclarator(
127 t.identifier(cx.synthesizeName("$")),
128 - t.callExpression(t.identifier("useMemoCache"), [
128 + t.callExpression(t.identifier(fn.env.useMemoCacheIdentifier), [
129 t.numericLiteral(cacheCount),
130 ])
131 ),
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/alias-capture-in-method-receiver-and-mutate.expect.md
+2 -2
@@ -27,11 +27,11 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 import { makeObject_Primitives, mutate } from "shared-runtime";
32
33 function Component() {
34 - const $ = useMemoCache(1);
34 + const $ = _c(1);
35 let t0;
36 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
37 const a = makeObject_Primitives();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/alias-capture-in-method-receiver.expect.md
+2 -2
@@ -18,9 +18,9 @@ function Component() {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Component() {
23 - const $ = useMemoCache(2);
23 + const $ = _c(2);
24 let t0;
25 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
26 t0 = someObj();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/alias-computed-load.expect.md
+2 -2
@@ -16,9 +16,9 @@ function component(a) {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function component(a) {
21 - const $ = useMemoCache(2);
21 + const $ = _c(2);
22 let x;
23 if ($[0] !== a) {
24 x = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/alias-nested-member-path-mutate.expect.md
+2 -2
@@ -17,9 +17,9 @@ function component() {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime";
20 +import { c as _c } from "react/compiler-runtime";
21 function component() {
22 - const $ = useMemoCache(1);
22 + const $ = _c(1);
23 let x;
24 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
25 const z = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/alias-nested-member-path.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function component() {
27 - const $ = useMemoCache(2);
27 + const $ = _c(2);
28 let t0;
29 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
30 t0 = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/alias-while.expect.md
+2 -2
@@ -26,9 +26,9 @@ function mutate(x, y) {}
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react/compiler-runtime";
29 +import { c as _c } from "react/compiler-runtime";
30 function foo(cond) {
31 - const $ = useMemoCache(2);
31 + const $ = _c(2);
32 let a;
33 if ($[0] !== cond) {
34 a = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/align-scopes-within-nested-valueblock-in-array.expect.md
+2 -2
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
40 +import { c as _c } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
41
42 import { Stringify, identity, makeArray, mutate } from "shared-runtime";
43
@@ -52,7 +52,7 @@ import { Stringify, identity, makeArray, mutate } from "shared-runtime";
52 * handles this correctly.
53 */
54 function Foo(t0) {
55 - const $ = useMemoCache(4);
55 + const $ = _c(4);
56 const { cond1, cond2 } = t0;
57 const arr = makeArray({ a: 2 }, 2, []);
58 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allocating-logical-expression-instruction-scope.expect.md
+2 -2
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 /**
29 * This is a weird case as data has type `BuiltInMixedReadonly`.
30 * The only scoped value we currently infer in this program is the
@@ -33,7 +33,7 @@ import { c as useMemoCache } from "react/compiler-runtime";
33 import { useFragment } from "shared-runtime";
34
35 function Foo() {
36 - const $ = useMemoCache(4);
36 + const $ = _c(4);
37 const data = useFragment();
38 let t0;
39 if ($[0] !== data) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allocating-primitive-as-dep-nested-scope.expect.md
+2 -2
@@ -19,12 +19,12 @@ function AllocatingPrimitiveAsDepNested(props) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime"; // bar(props.b) is an allocating expression that produces a primitive, which means
22 +import { c as _c } from "react/compiler-runtime"; // bar(props.b) is an allocating expression that produces a primitive, which means
23 // that Forget should memoize it.
24 // Correctness:
25 // - y depends on either bar(props.b) or bar(props.b) + 1
26 function AllocatingPrimitiveAsDepNested(props) {
27 - const $ = useMemoCache(9);
27 + const $ = _c(9);
28 let x;
29 let y;
30 if ($[0] !== props.b || $[1] !== props.a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allocating-primitive-as-dep.expect.md
+2 -2
@@ -16,12 +16,12 @@ function AllocatingPrimitiveAsDep(props) {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime"; // bar(props.b) is an allocating expression that produces a primitive, which means
19 +import { c as _c } from "react/compiler-runtime"; // bar(props.b) is an allocating expression that produces a primitive, which means
20 // that Forget should memoize it.
21 // Correctness:
22 // - y depends on either bar(props.b) or bar(props.b) + 1
23 function AllocatingPrimitiveAsDep(props) {
24 - const $ = useMemoCache(2);
24 + const $ = _c(2);
25 const t0 = bar(props).b + 1;
26 let t1;
27 if ($[0] !== t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allow-global-reassignment-in-effect-indirect.expect.md
+2 -2
@@ -33,13 +33,13 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react/compiler-runtime";
36 +import { c as _c } from "react/compiler-runtime";
37 import { useEffect, useState } from "react";
38
39 let someGlobal = false;
40
41 function Component() {
42 - const $ = useMemoCache(7);
42 + const $ = _c(7);
43 const [state, setState] = useState(someGlobal);
44 let t0;
45 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allow-global-reassignment-in-effect.expect.md
+2 -2
@@ -30,13 +30,13 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react/compiler-runtime";
33 +import { c as _c } from "react/compiler-runtime";
34 import { useEffect, useState } from "react";
35
36 let someGlobal = false;
37
38 function Component() {
39 - const $ = useMemoCache(6);
39 + const $ = _c(6);
40 const [state, setState] = useState(someGlobal);
41 let t0;
42 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allow-mutate-global-in-effect-fixpoint.expect.md
+2 -2
@@ -40,13 +40,13 @@ export const FIXTURE_ENTRYPOINT = {
40 ## Code
41
42 ```javascript
43 -import { c as useMemoCache } from "react/compiler-runtime";
43 +import { c as _c } from "react/compiler-runtime";
44 import { useEffect, useState } from "react";
45
46 let someGlobal = { value: null };
47
48 function Component() {
49 - const $ = useMemoCache(6);
49 + const $ = _c(6);
50 const [state, setState] = useState(someGlobal);
51
52 let x = someGlobal;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allow-passing-refs-as-props.expect.md
+2 -2
@@ -12,9 +12,9 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime";
15 +import { c as _c } from "react/compiler-runtime";
16 function Component(props) {
17 - const $ = useMemoCache(2);
17 + const $ = _c(2);
18 const ref = useRef(null);
19 let t0;
20 if ($[0] !== ref) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-access-assignment.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function foo(a, b, c) {
27 - const $ = useMemoCache(10);
27 + const $ = _c(10);
28 let x;
29 let z;
30 if ($[0] !== a || $[1] !== b || $[2] !== c) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-at-closure.expect.md
+2 -2
@@ -17,9 +17,9 @@ function Component(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime";
20 +import { c as _c } from "react/compiler-runtime";
21 function Component(props) {
22 - const $ = useMemoCache(7);
22 + const $ = _c(7);
23 let t0;
24 if ($[0] !== props.x) {
25 t0 = foo(props.x);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-at-effect.expect.md
+2 -2
@@ -17,12 +17,12 @@ function ArrayAtTest(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime"; // arrayInstance.at should have the following effects:
20 +import { c as _c } from "react/compiler-runtime"; // arrayInstance.at should have the following effects:
21 // - read on arg0
22 // - read on receiver
23 // - mutate on lvalue
24 function ArrayAtTest(props) {
25 - const $ = useMemoCache(9);
25 + const $ = _c(9);
26 let t0;
27 if ($[0] !== props.x) {
28 t0 = foo(props.x);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-at-mutate-after-capture.expect.md
+2 -2
@@ -18,10 +18,10 @@ function Component(props) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime"; // x's mutable range should extend to `mutate(y)`
21 +import { c as _c } from "react/compiler-runtime"; // x's mutable range should extend to `mutate(y)`
22
23 function Component(props) {
24 - const $ = useMemoCache(2);
24 + const $ = _c(2);
25 let x;
26 if ($[0] !== props.b) {
27 x = [42, {}];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-expression-spread.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Component(props) {
23 - const $ = useMemoCache(3);
23 + const $ = _c(3);
24 let t0;
25 if ($[0] !== props.foo || $[1] !== props.bar) {
26 t0 = [0, ...props.foo, null, ...props.bar, "z"];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-join.expect.md
+2 -2
@@ -14,9 +14,9 @@ function Component(props) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react/compiler-runtime";
17 +import { c as _c } from "react/compiler-runtime";
18 function Component(props) {
19 - const $ = useMemoCache(8);
19 + const $ = _c(8);
20 let t0;
21 let t1;
22 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-map-captures-receiver-noAlias.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function Component(props) {
26 - const $ = useMemoCache(6);
26 + const $ = _c(6);
27 let t0;
28 if ($[0] !== props.a) {
29 t0 = { a: props.a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-map-frozen-array-noAlias.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function Component(props) {
25 - const $ = useMemoCache(3);
25 + const $ = _c(3);
26 let t0;
27 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28 t0 = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-map-frozen-array.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function Component(props) {
25 - const $ = useMemoCache(3);
25 + const $ = _c(3);
26 let t0;
27 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28 t0 = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-map-mutable-array-mutating-lambda-noAlias.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function Component(props) {
27 - const $ = useMemoCache(3);
27 + const $ = _c(3);
28 let t0;
29 let x;
30 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-map-mutable-array-mutating-lambda.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function Component(props) {
27 - const $ = useMemoCache(3);
27 + const $ = _c(3);
28 let t0;
29 let x;
30 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-map-mutable-array-non-mutating-lambda-mutated-result.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function Component(props) {
27 - const $ = useMemoCache(1);
27 + const $ = _c(1);
28 let t0;
29 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
30 const x = [{}];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-map-noAlias-escaping-function.expect.md
+2 -2
@@ -19,9 +19,9 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function Component(props) {
24 - const $ = useMemoCache(5);
24 + const $ = _c(5);
25 let t0;
26 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
27 t0 = (item) => item;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-pattern-params.expect.md
+2 -2
@@ -19,9 +19,9 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function component(t0) {
24 - const $ = useMemoCache(7);
24 + const $ = _c(7);
25 const [a, b] = t0;
26 let t1;
27 if ($[0] !== a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-properties.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function Component(props) {
25 - const $ = useMemoCache(7);
25 + const $ = _c(7);
26 let t0;
27 if ($[0] !== props.a || $[1] !== props.b) {
28 t0 = [props.a, props.b, "hello"];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-property-call.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function Component(props) {
26 - const $ = useMemoCache(11);
26 + const $ = _c(11);
27 let t0;
28 let a;
29 if ($[0] !== props.a || $[1] !== props.b) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-push-effect.expect.md
+2 -2
@@ -19,11 +19,11 @@ function Component(props) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime"; // arrayInstance.push should have the following effects:
22 +import { c as _c } from "react/compiler-runtime"; // arrayInstance.push should have the following effects:
23 // - read on all args (rest parameter)
24 // - mutate on receiver
25 function Component(props) {
26 - const $ = useMemoCache(8);
26 + const $ = _c(8);
27 let t0;
28 if ($[0] !== props.x) {
29 t0 = foo(props.x);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/arrow-expr-directive.expect.md
+2 -2
@@ -17,10 +17,10 @@ function Component() {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime";
20 +import { c as _c } from "react/compiler-runtime";
21 function Component() {
22 "use strict";
23 - const $ = useMemoCache(3);
23 + const $ = _c(3);
24
25 const [count, setCount] = React.useState(0);
26 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/arrow-function-expr-gating-test.expect.md
+2 -2
@@ -13,10 +13,10 @@ export default ErrorView;
13
14 ```javascript
15 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
16 -import { c as useMemoCache } from "react/compiler-runtime"; // @gating
16 +import { c as _c } from "react/compiler-runtime"; // @gating
17 const ErrorView = isForgetEnabled_Fixtures()
18 ? (error, _retry) => {
19 - const $ = useMemoCache(2);
19 + const $ = _c(2);
20 let t0;
21 if ($[0] !== error) {
22 t0 = <MessageBox error={error} />;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/arrow-function-one-line-directive.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function useFoo() {
26 - const $ = useMemoCache(1);
26 + const $ = _c(1);
27 let t0;
28 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
29 t0 = () => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/assignment-expression-computed.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function Component(props) {
26 - const $ = useMemoCache(2);
26 + const $ = _c(2);
27 let x;
28 if ($[0] !== props.x) {
29 x = [props.x];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/assignment-expression-nested-path.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function g(props) {
25 - const $ = useMemoCache(2);
25 + const $ = _c(2);
26 let a;
27 if ($[0] !== props.c) {
28 a = { b: { c: props.c } };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/assignment-in-nested-if.expect.md
+2 -2
@@ -19,9 +19,9 @@ function useBar(props) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function useBar(props) {
24 - const $ = useMemoCache(1);
24 + const $ = _c(1);
25 let z;
26 if (props.a) {
27 if (props.b) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/assignment-variations-complex-lvalue-array.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function foo() {
25 - const $ = useMemoCache(1);
25 + const $ = _c(1);
26 let a;
27 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28 a = [[1]];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/assignment-variations-complex-lvalue.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function g() {
25 - const $ = useMemoCache(1);
25 + const $ = _c(1);
26 let x;
27 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28 x = { y: { z: 1 } };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/await-side-effecting-promise.expect.md
+2 -2
@@ -13,9 +13,9 @@ async function Component(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react/compiler-runtime";
16 +import { c as _c } from "react/compiler-runtime";
17 async function Component(props) {
18 - const $ = useMemoCache(2);
18 + const $ = _c(2);
19 let x;
20 if ($[0] !== props.id) {
21 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/await.expect.md
+2 -2
@@ -12,9 +12,9 @@ async function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime";
15 +import { c as _c } from "react/compiler-runtime";
16 async function Component(props) {
17 - const $ = useMemoCache(4);
17 + const $ = _c(4);
18 let t0;
19 if ($[0] !== props.id) {
20 t0 = await load(props.id);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/babel-existing-react-import.expect.md
+3 -3
@@ -23,11 +23,11 @@ function Component2(props) {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import { useState, useMemo } from "react";
28
29 function Component(props) {
30 - const $ = useMemoCache(4);
30 + const $ = _c(4);
31 const [x] = useState(0);
32 let t0;
33 let t1;
@@ -52,7 +52,7 @@ function Component(props) {
52 }
53
54 function Component2(props) {
55 - const $ = useMemoCache(4);
55 + const $ = _c(4);
56 const [x] = useState(0);
57 let t0;
58 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/babel-existing-react-kitchensink-import.expect.md
+3 -3
@@ -24,12 +24,12 @@ function Component2(props) {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import * as React from "react";
29 import { useState, useMemo } from "react";
30
31 function Component(props) {
32 - const $ = useMemoCache(4);
32 + const $ = _c(4);
33 const [x] = useState(0);
34 let t0;
35 let t1;
@@ -54,7 +54,7 @@ function Component(props) {
54 }
55
56 function Component2(props) {
57 - const $ = useMemoCache(4);
57 + const $ = _c(4);
58 const [x] = useState(0);
59 let t0;
60 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/babel-existing-react-namespace-import.expect.md
+2 -2
@@ -22,12 +22,12 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 import * as React from "react";
27 import { calculateExpensiveNumber } from "shared-runtime";
28
29 function Component(props) {
30 - const $ = useMemoCache(4);
30 + const $ = _c(4);
31 const [x] = React.useState(0);
32 let t0;
33 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/block-scoping-switch-variable-scoping.expect.md
+2 -2
@@ -30,11 +30,11 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react/compiler-runtime";
33 +import { c as _c } from "react/compiler-runtime";
34 import { useMemo } from "react";
35
36 function Component(props) {
37 - const $ = useMemoCache(2);
37 + const $ = _c(2);
38 let t0;
39 let t1;
40 if ($[0] !== props.value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/bug-invalid-reactivity-value-block.expect.md
+2 -2
@@ -46,7 +46,7 @@ export const FIXTURE_ENTRYPOINT = {
46 ## Code
47
48 ```javascript
49 -import { c as useMemoCache } from "react/compiler-runtime";
49 +import { c as _c } from "react/compiler-runtime";
50 import {
51 CONST_TRUE,
52 identity,
@@ -65,7 +65,7 @@ import {
65 */
66
67 function Foo() {
68 - const $ = useMemoCache(1);
68 + const $ = _c(1);
69 const obj = makeObject_Primitives();
70
71 useNoAlias();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/builtin-jsx-tag-lowered-between-mutations.expect.md
+2 -2
@@ -12,9 +12,9 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime";
15 +import { c as _c } from "react/compiler-runtime";
16 function Component(props) {
17 - const $ = useMemoCache(1);
17 + const $ = _c(1);
18 let t0;
19 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
20 const maybeMutable = new MaybeMutable();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/call-args-assignment.expect.md
+2 -2
@@ -13,9 +13,9 @@ function Component(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react/compiler-runtime";
16 +import { c as _c } from "react/compiler-runtime";
17 function Component(props) {
18 - const $ = useMemoCache(1);
18 + const $ = _c(1);
19 let x;
20 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
21 x = makeObject();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/call-args-destructuring-assignment.expect.md
+2 -2
@@ -13,9 +13,9 @@ function Component(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react/compiler-runtime";
16 +import { c as _c } from "react/compiler-runtime";
17 function Component(props) {
18 - const $ = useMemoCache(1);
18 + const $ = _c(1);
19 let x;
20 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
21 x = makeObject();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/call-spread.expect.md
+2 -2
@@ -12,9 +12,9 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime";
15 +import { c as _c } from "react/compiler-runtime";
16 function Component(props) {
17 - const $ = useMemoCache(3);
17 + const $ = _c(3);
18 let t0;
19 if ($[0] !== props.a || $[1] !== props.b) {
20 t0 = foo(...props.a, null, ...props.b);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/call-with-independently-memoizable-arg.expect.md
+2 -2
@@ -17,9 +17,9 @@ function Component(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime";
20 +import { c as _c } from "react/compiler-runtime";
21 function Component(props) {
22 - const $ = useMemoCache(4);
22 + const $ = _c(4);
23 let t0;
24 if ($[0] !== props) {
25 const x = makeFunction(props);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/call.expect.md
+2 -2
@@ -18,11 +18,11 @@ function Component(props) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function foo() {}
23
24 function Component(props) {
25 - const $ = useMemoCache(1);
25 + const $ = _c(1);
26 let t0;
27 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28 const a = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capture-indirect-mutate-alias-iife.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function component(a) {
29 - const $ = useMemoCache(2);
29 + const $ = _c(2);
30 let x;
31 if ($[0] !== a) {
32 x = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capture-indirect-mutate-alias.expect.md
+2 -2
@@ -27,9 +27,9 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 function component(a) {
32 - const $ = useMemoCache(2);
32 + const $ = _c(2);
33 let x;
34 if ($[0] !== a) {
35 x = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capture-param-mutate.expect.md
+2 -2
@@ -45,9 +45,9 @@ function getNativeLogFunction(level) {
45 ## Code
46
47 ```javascript
48 -import { c as useMemoCache } from "react/compiler-runtime";
48 +import { c as _c } from "react/compiler-runtime";
49 function getNativeLogFunction(level) {
50 - const $ = useMemoCache(2);
50 + const $ = _c(2);
51 let t0;
52 if ($[0] !== level) {
53 t0 = function () {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capture-ref-for-later-mutation.expect.md
+2 -2
@@ -31,12 +31,12 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react/compiler-runtime";
34 +import { c as _c } from "react/compiler-runtime";
35 import { useRef } from "react";
36 import { addOne } from "shared-runtime";
37
38 function useKeyCommand() {
39 - const $ = useMemoCache(2);
39 + const $ = _c(2);
40 const currentPosition = useRef(0);
41 const handleKey = (direction) => () => {
42 const position = currentPosition.current;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capture_mutate-across-fns-iife.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function component(a) {
27 - const $ = useMemoCache(2);
27 + const $ = _c(2);
28 let z;
29 if ($[0] !== a) {
30 z = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capture_mutate-across-fns.expect.md
+2 -2
@@ -25,9 +25,9 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 function component(a) {
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 let z;
32 if ($[0] !== a) {
33 z = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-arrow-function-1.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function component(a) {
26 - const $ = useMemoCache(4);
26 + const $ = _c(4);
27 let t0;
28 if ($[0] !== a) {
29 t0 = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-fun-alias-captured-mutate-2-iife.expect.md
+2 -2
@@ -26,11 +26,11 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react/compiler-runtime";
29 +import { c as _c } from "react/compiler-runtime";
30 import { mutate } from "shared-runtime";
31
32 function component(foo, bar) {
33 - const $ = useMemoCache(3);
33 + const $ = _c(3);
34 let x;
35 if ($[0] !== foo || $[1] !== bar) {
36 x = { foo };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-fun-alias-captured-mutate-2.expect.md
+2 -2
@@ -20,9 +20,9 @@ function component(foo, bar) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function component(foo, bar) {
25 - const $ = useMemoCache(3);
25 + const $ = _c(3);
26 let x;
27 if ($[0] !== foo || $[1] !== bar) {
28 x = { foo };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-fun-alias-captured-mutate-arr-2-iife.expect.md
+2 -2
@@ -26,11 +26,11 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react/compiler-runtime";
29 +import { c as _c } from "react/compiler-runtime";
30 const { mutate } = require("shared-runtime");
31
32 function component(foo, bar) {
33 - const $ = useMemoCache(3);
33 + const $ = _c(3);
34 let x;
35 if ($[0] !== foo || $[1] !== bar) {
36 x = { foo };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-fun-alias-captured-mutate-arr-2.expect.md
+2 -2
@@ -20,9 +20,9 @@ function component(foo, bar) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function component(foo, bar) {
25 - const $ = useMemoCache(3);
25 + const $ = _c(3);
26 let x;
27 if ($[0] !== foo || $[1] !== bar) {
28 x = { foo };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-captured-mutate-arr-iife.expect.md
+2 -2
@@ -26,11 +26,11 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react/compiler-runtime";
29 +import { c as _c } from "react/compiler-runtime";
30 const { mutate } = require("shared-runtime");
31
32 function component(foo, bar) {
33 - const $ = useMemoCache(3);
33 + const $ = _c(3);
34 let y;
35 if ($[0] !== foo || $[1] !== bar) {
36 const x = { foo };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-captured-mutate-arr.expect.md
+2 -2
@@ -20,9 +20,9 @@ function component(foo, bar) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function component(foo, bar) {
25 - const $ = useMemoCache(3);
25 + const $ = _c(3);
26 let y;
27 if ($[0] !== foo || $[1] !== bar) {
28 const x = { foo };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-captured-mutate-iife.expect.md
+2 -2
@@ -26,11 +26,11 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react/compiler-runtime";
29 +import { c as _c } from "react/compiler-runtime";
30 const { mutate } = require("shared-runtime");
31
32 function component(foo, bar) {
33 - const $ = useMemoCache(3);
33 + const $ = _c(3);
34 let y;
35 if ($[0] !== foo || $[1] !== bar) {
36 const x = { foo };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-captured-mutate.expect.md
+2 -2
@@ -20,9 +20,9 @@ function component(foo, bar) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function component(foo, bar) {
25 - const $ = useMemoCache(3);
25 + const $ = _c(3);
26 let y;
27 if ($[0] !== foo || $[1] !== bar) {
28 const x = { foo };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-computed-mutate-iife.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 const { mutate } = require("shared-runtime");
29
30 function component(a) {
31 - const $ = useMemoCache(2);
31 + const $ = _c(2);
32 let y;
33 if ($[0] !== a) {
34 const x = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-computed-mutate.expect.md
+2 -2
@@ -18,9 +18,9 @@ function component(a) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function component(a) {
23 - const $ = useMemoCache(2);
23 + const $ = _c(2);
24 let y;
25 if ($[0] !== a) {
26 const x = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-mutate-iife.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 const { mutate } = require("shared-runtime");
29
30 function component(a) {
31 - const $ = useMemoCache(2);
31 + const $ = _c(2);
32 let y;
33 if ($[0] !== a) {
34 const x = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-mutate.expect.md
+2 -2
@@ -18,9 +18,9 @@ function component(a) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function component(a) {
23 - const $ = useMemoCache(2);
23 + const $ = _c(2);
24 let y;
25 if ($[0] !== a) {
26 const x = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-receiver-computed-mutate-iife.expect.md
+2 -2
@@ -25,11 +25,11 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 import { mutate } from "shared-runtime";
30
31 function component(a) {
32 - const $ = useMemoCache(2);
32 + const $ = _c(2);
33 let y;
34 if ($[0] !== a) {
35 const x = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-receiver-computed-mutate.expect.md
+2 -2
@@ -19,9 +19,9 @@ function component(a) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function component(a) {
24 - const $ = useMemoCache(2);
24 + const $ = _c(2);
25 let y;
26 if ($[0] !== a) {
27 const x = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-receiver-mutate-iife.expect.md
+2 -2
@@ -25,11 +25,11 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 const { mutate } = require("shared-runtime");
30
31 function component(a) {
32 - const $ = useMemoCache(2);
32 + const $ = _c(2);
33 let y;
34 if ($[0] !== a) {
35 const x = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-receiver-mutate.expect.md
+2 -2
@@ -19,9 +19,9 @@ function component(a) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function component(a) {
24 - const $ = useMemoCache(2);
24 + const $ = _c(2);
25 let y;
26 if ($[0] !== a) {
27 const x = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-mutate-2.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function component(a, b) {
29 - const $ = useMemoCache(5);
29 + const $ = _c(5);
30 let t0;
31 if ($[0] !== b) {
32 t0 = { b };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-mutate-3.expect.md
+2 -2
@@ -23,9 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function component(a, b) {
28 - const $ = useMemoCache(2);
28 + const $ = _c(2);
29 let t0;
30 if ($[0] !== a) {
31 t0 = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-mutate-nested.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function component(a) {
27 - const $ = useMemoCache(2);
27 + const $ = _c(2);
28 let y;
29 if ($[0] !== a) {
30 y = { b: { a } };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-mutate.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function component(a, b) {
29 - const $ = useMemoCache(3);
29 + const $ = _c(3);
30 let z;
31 if ($[0] !== a || $[1] !== b) {
32 z = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-simple-alias-iife.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 const { mutate } = require("shared-runtime");
29
30 function component(a) {
31 - const $ = useMemoCache(2);
31 + const $ = _c(2);
32 let y;
33 if ($[0] !== a) {
34 const x = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-simple-alias.expect.md
+2 -2
@@ -18,9 +18,9 @@ function component(a) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function component(a) {
23 - const $ = useMemoCache(2);
23 + const $ = _c(2);
24 let y;
25 if ($[0] !== a) {
26 const x = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-1.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function component(a) {
26 - const $ = useMemoCache(4);
26 + const $ = _c(4);
27 let t0;
28 if ($[0] !== a) {
29 t0 = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-2-iife.expect.md
+2 -2
@@ -23,9 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function bar(a) {
28 - const $ = useMemoCache(2);
28 + const $ = _c(2);
29 let y;
30 if ($[0] !== a) {
31 const x = [a];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-2.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function bar(a) {
29 - const $ = useMemoCache(2);
29 + const $ = _c(2);
30 let y;
31 if ($[0] !== a) {
32 const x = [a];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-3-iife.expect.md
+2 -2
@@ -27,9 +27,9 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 function bar(a, b) {
32 - const $ = useMemoCache(3);
32 + const $ = _c(3);
33 let y;
34 if ($[0] !== a || $[1] !== b) {
35 const x = [a, b];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-3.expect.md
+2 -2
@@ -28,9 +28,9 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime";
31 +import { c as _c } from "react/compiler-runtime";
32 function bar(a, b) {
33 - const $ = useMemoCache(3);
33 + const $ = _c(3);
34 let y;
35 if ($[0] !== a || $[1] !== b) {
36 const x = [a, b];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-4-iife.expect.md
+2 -2
@@ -23,9 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function bar(a) {
28 - const $ = useMemoCache(2);
28 + const $ = _c(2);
29 let y;
30 if ($[0] !== a) {
31 const x = [a];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-4.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function bar(a) {
29 - const $ = useMemoCache(2);
29 + const $ = _c(2);
30 let y;
31 if ($[0] !== a) {
32 const x = [a];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-iife.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function bar(a) {
27 - const $ = useMemoCache(2);
27 + const $ = _c(2);
28 let y;
29 if ($[0] !== a) {
30 const x = [a];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function bar(a) {
29 - const $ = useMemoCache(2);
29 + const $ = _c(2);
30 let y;
31 if ($[0] !== a) {
32 const x = [a];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-capture-ref-before-rename.expect.md
+2 -2
@@ -22,9 +22,9 @@ function component(a, b) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function component(a, b) {
27 - const $ = useMemoCache(7);
27 + const $ = _c(7);
28 let z;
29 if ($[0] !== a) {
30 z = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-conditional-capture-mutate.expect.md
+2 -2
@@ -22,9 +22,9 @@ function component(a, b) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime"; // @debug
25 +import { c as _c } from "react/compiler-runtime"; // @debug
26 function component(a, b) {
27 - const $ = useMemoCache(5);
27 + const $ = _c(5);
28 let t0;
29 if ($[0] !== a) {
30 t0 = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-decl.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function component(a) {
27 - const $ = useMemoCache(2);
27 + const $ = _c(2);
28 let t;
29 if ($[0] !== a) {
30 t = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-member-expr-arguments.expect.md
+2 -2
@@ -18,9 +18,9 @@ function Foo(props) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Foo(props) {
23 - const $ = useMemoCache(2);
23 + const $ = _c(2);
24 let t0;
25 if ($[0] !== props.router.location) {
26 t0 = (reason) => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-member-expr-call.expect.md
+2 -2
@@ -19,9 +19,9 @@ function component({ mutator }) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function component(t0) {
24 - const $ = useMemoCache(7);
24 + const $ = _c(7);
25 const { mutator } = t0;
26 let t1;
27 if ($[0] !== mutator) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-renamed-ref.expect.md
+2 -2
@@ -18,9 +18,9 @@ function component(a, b) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function component(a, b) {
23 - const $ = useMemoCache(2);
23 + const $ = _c(2);
24 let t0;
25 if ($[0] !== a) {
26 t0 = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-runs-inference.expect.md
+2 -2
@@ -13,9 +13,9 @@ function component(a, b) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react/compiler-runtime";
16 +import { c as _c } from "react/compiler-runtime";
17 function component(a, b) {
18 - const $ = useMemoCache(6);
18 + const $ = _c(6);
19 let t0;
20 if ($[0] !== a) {
21 t0 = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-shadow-captured.expect.md
+2 -2
@@ -16,9 +16,9 @@ function component(a) {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function component(a) {
21 - const $ = useMemoCache(1);
21 + const $ = _c(1);
22 let t0;
23 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
24 t0 = function () {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-skip-computed-path.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function StoreLandingUnseenGiftModalContainer(a) {
23 - const $ = useMemoCache(2);
23 + const $ = _c(2);
24 let t0;
25 if ($[0] !== a) {
26 const giftsSeen = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-within-block.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function component(a) {
29 - const $ = useMemoCache(4);
29 + const $ = _c(4);
30 let t0;
31 if ($[0] !== a) {
32 t0 = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-member-expr.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function component(a) {
26 - const $ = useMemoCache(4);
26 + const $ = _c(4);
27 let t0;
28 if ($[0] !== a) {
29 t0 = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-nested-member-call.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function component(a) {
26 - const $ = useMemoCache(2);
26 + const $ = _c(2);
27 let t0;
28 if ($[0] !== a) {
29 t0 = { a: { a } };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-nested-member-expr-in-nested-func.expect.md
+2 -2
@@ -23,9 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function component(a) {
28 - const $ = useMemoCache(4);
28 + const $ = _c(4);
29 let t0;
30 if ($[0] !== a) {
31 t0 = { a: { a } };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-nested-member-expr.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function component(a) {
26 - const $ = useMemoCache(4);
26 + const $ = _c(4);
27 let t0;
28 if ($[0] !== a) {
29 t0 = { a: { a } };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-reference-changes-type.expect.md
+2 -2
@@ -17,9 +17,9 @@ function component(a) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime";
20 +import { c as _c } from "react/compiler-runtime";
21 function component(a) {
22 - const $ = useMemoCache(2);
22 + const $ = _c(2);
23 let y;
24 if ($[0] !== a) {
25 const x = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-variable-in-nested-block.expect.md
+2 -2
@@ -23,9 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function component(a) {
28 - const $ = useMemoCache(4);
28 + const $ = _c(4);
29 let t0;
30 if ($[0] !== a) {
31 t0 = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-variable-in-nested-function.expect.md
+2 -2
@@ -23,9 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function component(a) {
28 - const $ = useMemoCache(4);
28 + const $ = _c(4);
29 let t0;
30 if ($[0] !== a) {
31 t0 = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/chained-assignment-context-variable.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import { makeArray } from "shared-runtime";
29
30 function Component() {
31 - const $ = useMemoCache(3);
31 + const $ = _c(3);
32 let x;
33 let y;
34 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/chained-assignment-expressions.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function foo() {
27 - const $ = useMemoCache(1);
27 + const $ = _c(1);
28 let z;
29 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
30 const x = { x: 0 };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/codegen-emit-imports-same-source.expect.md
+2 -2
@@ -18,12 +18,12 @@ import {
18 shouldInstrument,
19 makeReadOnly,
20 } from "react-compiler-runtime";
21 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableEmitFreeze @instrumentForget
21 +import { c as _c } from "react/compiler-runtime"; // @enableEmitFreeze @instrumentForget
22
23 function useFoo(props) {
24 if (__DEV__ && shouldInstrument)
25 useRenderCounter("useFoo", "/codegen-emit-imports-same-source.ts");
26 - const $ = useMemoCache(2);
26 + const $ = _c(2);
27 let t0;
28 if ($[0] !== props.x) {
29 t0 = foo(props.x);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/codegen-emit-make-read-only.expect.md
+2 -2
@@ -20,10 +20,10 @@ function MyComponentName(props) {
20
21 ```javascript
22 import { makeReadOnly } from "react-compiler-runtime";
23 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableEmitFreeze true
23 +import { c as _c } from "react/compiler-runtime"; // @enableEmitFreeze true
24
25 function MyComponentName(props) {
26 - const $ = useMemoCache(5);
26 + const $ = _c(5);
27 let x;
28 if ($[0] !== props.a || $[1] !== props.b) {
29 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/codegen-instrument-forget-gating-test.expect.md
+3 -3
@@ -25,13 +25,13 @@ function Foo(props) {
25 ```javascript
26 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
27 import { useRenderCounter, shouldInstrument } from "react-compiler-runtime";
28 -import { c as useMemoCache } from "react/compiler-runtime"; // @instrumentForget @compilationMode(annotation) @gating
28 +import { c as _c } from "react/compiler-runtime"; // @instrumentForget @compilationMode(annotation) @gating
29 const Bar = isForgetEnabled_Fixtures()
30 ? function Bar(props) {
31 "use forget";
32 if (__DEV__ && shouldInstrument)
33 useRenderCounter("Bar", "/codegen-instrument-forget-gating-test.ts");
34 - const $ = useMemoCache(2);
34 + const $ = _c(2);
35 let t0;
36 if ($[0] !== props.bar) {
37 t0 = <div>{props.bar}</div>;
@@ -55,7 +55,7 @@ const Foo = isForgetEnabled_Fixtures()
55 "use forget";
56 if (__DEV__ && shouldInstrument)
57 useRenderCounter("Foo", "/codegen-instrument-forget-gating-test.ts");
58 - const $ = useMemoCache(2);
58 + const $ = _c(2);
59 let t0;
60 if ($[0] !== props.bar) {
61 t0 = <Foo>{props.bar}</Foo>;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/codegen-instrument-forget-test.expect.md
+3 -3
@@ -24,13 +24,13 @@ function Foo(props) {
24
25 ```javascript
26 import { useRenderCounter, shouldInstrument } from "react-compiler-runtime";
27 -import { c as useMemoCache } from "react/compiler-runtime"; // @instrumentForget @compilationMode(annotation)
27 +import { c as _c } from "react/compiler-runtime"; // @instrumentForget @compilationMode(annotation)
28
29 function Bar(props) {
30 "use forget";
31 if (__DEV__ && shouldInstrument)
32 useRenderCounter("Bar", "/codegen-instrument-forget-test.ts");
33 - const $ = useMemoCache(2);
33 + const $ = _c(2);
34 let t0;
35 if ($[0] !== props.bar) {
36 t0 = <div>{props.bar}</div>;
@@ -50,7 +50,7 @@ function Foo(props) {
50 "use forget";
51 if (__DEV__ && shouldInstrument)
52 useRenderCounter("Foo", "/codegen-instrument-forget-test.ts");
53 - const $ = useMemoCache(2);
53 + const $ = _c(2);
54 let t0;
55 if ($[0] !== props.bar) {
56 t0 = <Foo>{props.bar}</Foo>;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/component-declaration-basic.flow.expect.md
+2 -2
@@ -13,9 +13,9 @@ function shouldNotCompile() {}
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react/compiler-runtime";
16 +import { c as _c } from "react/compiler-runtime";
17 export default function Foo(t0) {
18 - const $ = useMemoCache(2);
18 + const $ = _c(2);
19 const { bar } = t0;
20 let t1;
21 if ($[0] !== bar) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/component-inner-function-with-many-args.expect.md
+2 -2
@@ -19,10 +19,10 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 import { Stringify } from "shared-runtime";
24 function Component(props) {
25 - const $ = useMemoCache(3);
25 + const $ = _c(3);
26 let t0;
27 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28 t0 = (x, y, z) => x + y + z;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/component.expect.md
+2 -2
@@ -40,9 +40,9 @@ export const FIXTURE_ENTRYPOINT = {
40 ## Code
41
42 ```javascript
43 -import { c as useMemoCache } from "react/compiler-runtime";
43 +import { c as _c } from "react/compiler-runtime";
44 function Component(props) {
45 - const $ = useMemoCache(8);
45 + const $ = _c(8);
46 const items = props.items;
47 const maxItems = props.maxItems;
48 let renderedItems;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/computed-call-evaluation-order.expect.md
+2 -2
@@ -28,9 +28,9 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime"; // Should print A, B, arg, original
31 +import { c as _c } from "react/compiler-runtime"; // Should print A, B, arg, original
32 function Component() {
33 - const $ = useMemoCache(2);
33 + const $ = _c(2);
34 let t0;
35 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
36 t0 = (o) => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/computed-call-spread.expect.md
+2 -2
@@ -12,9 +12,9 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime";
15 +import { c as _c } from "react/compiler-runtime";
16 function Component(props) {
17 - const $ = useMemoCache(4);
17 + const $ = _c(4);
18 let t0;
19 if ($[0] !== props.method || $[1] !== props.a || $[2] !== props.b) {
20 t0 = foo[props.method](...props.a, null, ...props.b);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/computed-load-primitive-as-dependency.expect.md
+2 -2
@@ -17,9 +17,9 @@ function Component(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime";
20 +import { c as _c } from "react/compiler-runtime";
21 function Component(props) {
22 - const $ = useMemoCache(2);
22 + const $ = _c(2);
23 const a = foo();
24
25 const t0 = a[props.a] + 1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/computed-store-alias.expect.md
+2 -2
@@ -15,9 +15,9 @@ function component(a, b) {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react/compiler-runtime";
18 +import { c as _c } from "react/compiler-runtime";
19 function component(a, b) {
20 - const $ = useMemoCache(3);
20 + const $ = _c(3);
21 let x;
22 if ($[0] !== a || $[1] !== b) {
23 const y = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/concise-arrow-expr.expect.md
+2 -2
@@ -13,9 +13,9 @@ function component() {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react/compiler-runtime";
16 +import { c as _c } from "react/compiler-runtime";
17 function component() {
18 - const $ = useMemoCache(2);
18 + const $ = _c(2);
19 const [x, setX] = useState(0);
20 let t0;
21 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/conditional-break-labeled.expect.md
+2 -2
@@ -29,12 +29,12 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime";
32 +import { c as _c } from "react/compiler-runtime";
33 /**
34 * props.b *does* influence `a`
35 */
36 function Component(props) {
37 - const $ = useMemoCache(2);
37 + const $ = _c(2);
38 let a;
39 if ($[0] !== props) {
40 a = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/conditional-early-return.expect.md
+5 -5
@@ -66,12 +66,12 @@ export const FIXTURE_ENTRYPOINT = {
66 ## Code
67
68 ```javascript
69 -import { c as useMemoCache } from "react/compiler-runtime";
69 +import { c as _c } from "react/compiler-runtime";
70 /**
71 * props.b does *not* influence `a`
72 */
73 function ComponentA(props) {
74 - const $ = useMemoCache(3);
74 + const $ = _c(3);
75 let a_DEBUG;
76 let t0;
77 if ($[0] !== props) {
@@ -103,7 +103,7 @@ function ComponentA(props) {
103 * props.b *does* influence `a`
104 */
105 function ComponentB(props) {
106 - const $ = useMemoCache(2);
106 + const $ = _c(2);
107 let a;
108 if ($[0] !== props) {
109 a = [];
@@ -125,7 +125,7 @@ function ComponentB(props) {
125 * props.b *does* influence `a`, but only in a way that is never observable
126 */
127 function ComponentC(props) {
128 - const $ = useMemoCache(3);
128 + const $ = _c(3);
129 let a;
130 let t0;
131 if ($[0] !== props) {
@@ -158,7 +158,7 @@ function ComponentC(props) {
158 * props.b *does* influence `a`
159 */
160 function ComponentD(props) {
161 - const $ = useMemoCache(3);
161 + const $ = _c(3);
162 let a;
163 let t0;
164 if ($[0] !== props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/conditional-on-mutable.expect.md
+3 -3
@@ -34,9 +34,9 @@ function mayMutate() {}
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react/compiler-runtime";
37 +import { c as _c } from "react/compiler-runtime";
38 function ComponentA(props) {
39 - const $ = useMemoCache(6);
39 + const $ = _c(6);
40 let a;
41 let b;
42 if ($[0] !== props) {
@@ -68,7 +68,7 @@ function ComponentA(props) {
68 }
69
70 function ComponentB(props) {
71 - const $ = useMemoCache(6);
71 + const $ = _c(6);
72 let a;
73 let b;
74 if ($[0] !== props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/conflicting-dollar-sign-variable.expect.md
+2 -2
@@ -20,11 +20,11 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 import { identity } from "shared-runtime";
25
26 function Component(props) {
27 - const $0 = useMemoCache(1);
27 + const $0 = _c(1);
28 let t0;
29 if ($0[0] === Symbol.for("react.memo_cache_sentinel")) {
30 const $ = identity("jQuery");
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/consecutive-use-memo.expect.md
+2 -2
@@ -21,12 +21,12 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 import { useMemo } from "react";
26 import { identity } from "shared-runtime";
27
28 function useHook(t0) {
29 - const $ = useMemoCache(7);
29 + const $ = _c(7);
30 const { a, b } = t0;
31 let t1;
32 let t2;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/console-readonly.expect.md
+2 -2
@@ -27,11 +27,11 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 import { shallowCopy } from "shared-runtime";
32
33 function Component(props) {
34 - const $ = useMemoCache(2);
34 + const $ = _c(2);
35 let t0;
36 if ($[0] !== props) {
37 t0 = shallowCopy(props);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/const-propagation-into-function-expression-global.expect.md
+2 -2
@@ -16,9 +16,9 @@ function foo() {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function foo() {
21 - const $ = useMemoCache(2);
21 + const $ = _c(2);
22 let t0;
23 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
24 t0 = () => <Child x={GLOBAL_IS_X} />;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/const-propagation-phi-nodes.expect.md
+2 -2
@@ -26,9 +26,9 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react/compiler-runtime";
29 +import { c as _c } from "react/compiler-runtime";
30 function useFoo(setOne) {
31 - const $ = useMemoCache(4);
31 + const $ = _c(4);
32 let x;
33 let y;
34 let z;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constant-computed.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function Component(props) {
26 - const $ = useMemoCache(2);
26 + const $ = _c(2);
27 let x;
28 if ($[0] !== props.foo) {
29 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constant-prop-to-object-method.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import { identity } from "shared-runtime";
29
30 function Foo() {
31 - const $ = useMemoCache(1);
31 + const $ = _c(1);
32 let t0;
33 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
34 const x = {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constant-propagate-global-phis-constant.expect.md
+2 -2
@@ -26,7 +26,7 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react/compiler-runtime";
29 +import { c as _c } from "react/compiler-runtime";
30 import { CONST_STRING0, Text } from "shared-runtime";
31 function useFoo() {
32 "use no forget";
@@ -34,7 +34,7 @@ function useFoo() {
34 }
35
36 function Test() {
37 - const $ = useMemoCache(1);
37 + const $ = _c(1);
38 const { tab } = useFoo();
39 tab === CONST_STRING0 ? CONST_STRING0 : CONST_STRING0;
40 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constant-propagate-global-phis.expect.md
+2 -2
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 import { CONST_STRING0, CONST_STRING1, Text } from "shared-runtime";
32
33 function useFoo() {
@@ -36,7 +36,7 @@ function useFoo() {
36 }
37
38 function Test() {
39 - const $ = useMemoCache(2);
39 + const $ = _c(2);
40 const { tab } = useFoo();
41 const currentTab = tab === CONST_STRING0 ? CONST_STRING0 : CONST_STRING1;
42 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constant-propagation-into-function-expressions.expect.md
+2 -2
@@ -15,9 +15,9 @@ function Component(props) {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react/compiler-runtime";
18 +import { c as _c } from "react/compiler-runtime";
19 function Component(props) {
20 - const $ = useMemoCache(2);
20 + const $ = _c(2);
21 let t0;
22 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
23 t0 = () => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constructor.expect.md
+2 -2
@@ -18,11 +18,11 @@ function Component(props) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Foo() {}
23
24 function Component(props) {
25 - const $ = useMemoCache(1);
25 + const $ = _c(1);
26 let t0;
27 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28 const a = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/context-variable-as-jsx-element-tag.expect.md
+2 -2
@@ -25,12 +25,12 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 import { useMemo } from "react";
30 import { Stringify } from "shared-runtime";
31
32 function Component(props) {
33 - const $ = useMemoCache(3);
33 + const $ = _c(3);
34 let Component;
35 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
36 Component = Stringify;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/context-variable-only-chained-assign.expect.md
+2 -2
@@ -27,11 +27,11 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 import { identity, invoke } from "shared-runtime";
32
33 function foo() {
34 - const $ = useMemoCache(1);
34 + const $ = _c(1);
35 let t0;
36 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
37 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/context-variable-reactive-explicit-control-flow.expect.md
+2 -2
@@ -26,11 +26,11 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react/compiler-runtime";
29 +import { c as _c } from "react/compiler-runtime";
30 import { invoke } from "shared-runtime";
31
32 function Component(t0) {
33 - const $ = useMemoCache(2);
33 + const $ = _c(2);
34 const { shouldReassign } = t0;
35 let x;
36 if ($[0] !== shouldReassign) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/context-variable-reactive-implicit-control-flow.expect.md
+2 -2
@@ -27,14 +27,14 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 import { conditionalInvoke } from "shared-runtime";
32
33 // same as context-variable-reactive-explicit-control-flow.js, but make
34 // the control flow implicit
35
36 function Component(t0) {
37 - const $ = useMemoCache(2);
37 + const $ = _c(2);
38 const { shouldReassign } = t0;
39 let x;
40 if ($[0] !== shouldReassign) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/context-variable-reassigned-objectmethod.expect.md
+2 -2
@@ -27,11 +27,11 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 import { invoke } from "shared-runtime";
32
33 function Component(t0) {
34 - const $ = useMemoCache(2);
34 + const $ = _c(2);
35 const { cond } = t0;
36 let x;
37 if ($[0] !== cond) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/context-variable-reassigned-outside-of-lambda.expect.md
+2 -2
@@ -23,11 +23,11 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import { Stringify } from "shared-runtime";
28
29 function Component(props) {
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 let callback;
32 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
33 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/context-variable-reassigned-reactive-capture.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import { invoke } from "shared-runtime";
29
30 function Component(t0) {
31 - const $ = useMemoCache(2);
31 + const $ = _c(2);
32 const { value } = t0;
33 let x;
34 if ($[0] !== value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/context-variable-reassigned-two-lambdas.expect.md
+2 -2
@@ -32,11 +32,11 @@ export const FIXTURE_ENTRYPOINT = {
32 ## Code
33
34 ```javascript
35 -import { c as useMemoCache } from "react/compiler-runtime";
35 +import { c as _c } from "react/compiler-runtime";
36 import { conditionalInvoke } from "shared-runtime";
37
38 function Component(t0) {
39 - const $ = useMemoCache(3);
39 + const $ = _c(3);
40 const { doReassign1, doReassign2 } = t0;
41 let x;
42 if ($[0] !== doReassign1 || $[1] !== doReassign2) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/controlled-input.expect.md
+2 -2
@@ -20,10 +20,10 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 import { useState } from "react";
25 function component() {
26 - const $ = useMemoCache(3);
26 + const $ = _c(3);
27 const [x, setX] = useState(0);
28 let t0;
29 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/createElement-freeze.expect.md
+2 -2
@@ -22,12 +22,12 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 import React from "react";
27 import { shallowCopy } from "shared-runtime";
28
29 function Component(props) {
30 - const $ = useMemoCache(5);
30 + const $ = _c(5);
31 let t0;
32 if ($[0] !== props.width) {
33 t0 = { style: { width: props.width } };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/debugger-memoized.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function Component(props) {
25 - const $ = useMemoCache(2);
25 + const $ = _c(2);
26 let x;
27 if ($[0] !== props.value) {
28 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/declare-reassign-variable-in-closure.expect.md
+2 -2
@@ -23,9 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function Component(p) {
28 - const $ = useMemoCache(1);
28 + const $ = _c(1);
29 let x;
30 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
31 const foo = () => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/declare-reassign-variable-in-function-declaration.expect.md
+2 -2
@@ -16,9 +16,9 @@ function Component() {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function Component() {
21 - const $ = useMemoCache(2);
21 + const $ = _c(2);
22 let t0;
23 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
24 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/deeply-nested-function-expressions-with-params.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function Foo() {
29 - const $ = useMemoCache(1);
29 + const $ = _c(1);
30 let t0;
31 let t1;
32 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/default-param-array-with-unary.expect.md
+2 -2
@@ -16,9 +16,9 @@ export const FIXTURE_ENTRYPOINT = {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function Component(t0) {
21 - const $ = useMemoCache(2);
21 + const $ = _c(2);
22 let t1;
23 if ($[0] !== t0) {
24 t1 = t0 === undefined ? [-1, 1] : t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/default-param-calls-global-function.expect.md
+2 -2
@@ -18,11 +18,11 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 import { identity } from "shared-runtime";
23
24 function Component(t0) {
25 - const $ = useMemoCache(2);
25 + const $ = _c(2);
26 let t1;
27 if ($[0] !== t0) {
28 t1 = t0 === undefined ? identity([() => {}, true, 42, "hello"]) : t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/default-param-with-empty-callback.expect.md
+2 -2
@@ -16,9 +16,9 @@ export const FIXTURE_ENTRYPOINT = {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function Component(t0) {
21 - const $ = useMemoCache(2);
21 + const $ = _c(2);
22 let t1;
23 if ($[0] !== t0) {
24 t1 = t0 === undefined ? () => {} : t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/default-param-with-reorderable-callback.expect.md
+2 -2
@@ -16,9 +16,9 @@ export const FIXTURE_ENTRYPOINT = {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function Component(t0) {
21 - const $ = useMemoCache(2);
21 + const $ = _c(2);
22 let t1;
23 if ($[0] !== t0) {
24 t1 = t0 === undefined ? () => [-1, true, 42, "hello"] : t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/delete-computed-property.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function Component(props) {
25 - const $ = useMemoCache(3);
25 + const $ = _c(3);
26 let x;
27 if ($[0] !== props.a || $[1] !== props.b) {
28 x = { a: props.a, b: props.b };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/delete-property.expect.md
+2 -2
@@ -19,9 +19,9 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function Component(props) {
24 - const $ = useMemoCache(3);
24 + const $ = _c(3);
25 let x;
26 if ($[0] !== props.a || $[1] !== props.b) {
27 x = { a: props.a, b: props.b };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/dependencies-outputs.expect.md
+2 -2
@@ -28,9 +28,9 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime";
31 +import { c as _c } from "react/compiler-runtime";
32 function foo(a, b) {
33 - const $ = useMemoCache(5);
33 + const $ = _c(5);
34 let x;
35 if ($[0] !== a) {
36 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/dependencies.expect.md
+2 -2
@@ -29,9 +29,9 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime";
32 +import { c as _c } from "react/compiler-runtime";
33 function foo(x, y, z) {
34 - const $ = useMemoCache(3);
34 + const $ = _c(3);
35 const items = [z];
36 items.push(x);
37 let items2;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-array-assignment-to-context-var.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import { identity } from "shared-runtime";
29
30 function Component(props) {
31 - const $ = useMemoCache(4);
31 + const $ = _c(4);
32 let x;
33 if ($[0] !== props.value) {
34 const [t0] = props.value;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-array-declaration-to-context-var.expect.md
+2 -2
@@ -23,11 +23,11 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import { identity } from "shared-runtime";
28
29 function Component(props) {
30 - const $ = useMemoCache(4);
30 + const $ = _c(4);
31 let x;
32 if ($[0] !== props.value) {
33 const [t0] = props.value;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-capture-global.expect.md
+2 -2
@@ -19,10 +19,10 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 let someGlobal = {};
24 function component(a) {
25 - const $ = useMemoCache(2);
25 + const $ = _c(2);
26 let t0;
27 if ($[0] !== a) {
28 t0 = { a, someGlobal };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-default-array-with-unary.expect.md
+2 -2
@@ -17,9 +17,9 @@ export const FIXTURE_ENTRYPOINT = {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime";
20 +import { c as _c } from "react/compiler-runtime";
21 function Component(props) {
22 - const $ = useMemoCache(2);
22 + const $ = _c(2);
23 const [t0] = props.value;
24 let t1;
25 if ($[0] !== t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-in-branch-ssa.expect.md
+2 -2
@@ -34,9 +34,9 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react/compiler-runtime";
37 +import { c as _c } from "react/compiler-runtime";
38 function useFoo(props) {
39 - const $ = useMemoCache(9);
39 + const $ = _c(9);
40
41 let x = null;
42 let y = null;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-mixed-property-key-types.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function foo() {
27 - const $ = useMemoCache(2);
27 + const $ = _c(2);
28 let t0;
29 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
30 t0 = { "data-foo-bar": 1, a: 2, data: 3 };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-object-assignment-to-context-var.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import { identity } from "shared-runtime";
29
30 function Component(props) {
31 - const $ = useMemoCache(4);
31 + const $ = _c(4);
32 let x;
33 if ($[0] !== props) {
34 const { x: t0 } = props;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-object-declaration-to-context-var.expect.md
+2 -2
@@ -23,11 +23,11 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import { identity } from "shared-runtime";
28
29 function Component(props) {
30 - const $ = useMemoCache(4);
30 + const $ = _c(4);
31 let x;
32 if ($[0] !== props) {
33 const { x: t0 } = props;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-string-literal-invalid-identifier-property-key.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function foo() {
23 - const $ = useMemoCache(1);
23 + const $ = _c(1);
24 let t0;
25 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
26 t0 = { "data-foo-bar": 1 };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-string-literal-property-key.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function foo() {
23 - const $ = useMemoCache(1);
23 + const $ = _c(1);
24 let t0;
25 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
26 t0 = { data: 1 };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-array-default.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Component(props) {
23 - const $ = useMemoCache(2);
23 + const $ = _c(2);
24 const [t0] = props.y;
25 let t1;
26 if ($[0] !== t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-assignment-array-default.expect.md
+2 -2
@@ -23,9 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function Component(props) {
28 - const $ = useMemoCache(2);
28 + const $ = _c(2);
29 let x;
30 if (props.cond) {
31 const [t0] = props.y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-assignment.expect.md
+2 -2
@@ -32,9 +32,9 @@ export const FIXTURE_ENTRYPOINT = {
32 ## Code
33
34 ```javascript
35 -import { c as useMemoCache } from "react/compiler-runtime";
35 +import { c as _c } from "react/compiler-runtime";
36 function foo(a, b, c) {
37 - const $ = useMemoCache(5);
37 + const $ = _c(5);
38 let d;
39 let g;
40 let n;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-mixed-scope-and-local-variables-with-default.expect.md
+2 -2
@@ -44,7 +44,7 @@ export const FIXTURE_ENTRYPOINT = {
44 ## Code
45
46 ```javascript
47 -import { c as useMemoCache } from "react/compiler-runtime";
47 +import { c as _c } from "react/compiler-runtime";
48 import { Stringify, graphql } from "shared-runtime";
49
50 function useFragment(_arg1, _arg2) {
@@ -56,7 +56,7 @@ function useFragment(_arg1, _arg2) {
56 }
57
58 function Component(props) {
59 - const $ = useMemoCache(14);
59 + const $ = _c(14);
60 const post = useFragment(graphql`...`, props.post);
61 let media;
62 let allUrls;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-mixed-scope-declarations-and-locals.expect.md
+2 -2
@@ -28,9 +28,9 @@ function Component(props) {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime";
31 +import { c as _c } from "react/compiler-runtime";
32 function Component(props) {
33 - const $ = useMemoCache(8);
33 + const $ = _c(8);
34 const post = useFragment(graphql`...`, props.post);
35 let media;
36 let onClick;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-object-default.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Component(props) {
23 - const $ = useMemoCache(2);
23 + const $ = _c(2);
24 const { x: t0 } = props.y;
25 let t1;
26 if ($[0] !== t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-object-pattern-within-rest.expect.md
+2 -2
@@ -17,9 +17,9 @@ export const FIXTURE_ENTRYPOINT = {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime";
20 +import { c as _c } from "react/compiler-runtime";
21 function Component(props) {
22 - const $ = useMemoCache(6);
22 + const $ = _c(6);
23 let t0;
24 let y;
25 if ($[0] !== props.value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-property-inference.expect.md
+2 -2
@@ -15,9 +15,9 @@ function Component(props) {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react/compiler-runtime";
18 +import { c as _c } from "react/compiler-runtime";
19 function Component(props) {
20 - const $ = useMemoCache(5);
20 + const $ = _c(5);
21 let x;
22 if ($[0] !== props.value) {
23 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-same-property-identifier-names.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import { identity } from "shared-runtime";
29
30 function Component(props) {
31 - const $ = useMemoCache(5);
31 + const $ = _c(5);
32 const { x: t0, sameName: renamed } = props;
33 const { destructured } = t0;
34 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-with-typecast-as-default-value.flow.expect.md
+2 -2
@@ -17,9 +17,9 @@ export const FIXTURE_ENTRYPOINT = {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime";
20 +import { c as _c } from "react/compiler-runtime";
21 function Component(props) {
22 - const $ = useMemoCache(2);
22 + const $ = _c(2);
23 const [t0] = props.y;
24 let t1;
25 if ($[0] !== t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring.expect.md
+2 -2
@@ -33,9 +33,9 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react/compiler-runtime";
36 +import { c as _c } from "react/compiler-runtime";
37 function foo(a, b, c) {
38 - const $ = useMemoCache(18);
38 + const $ = _c(18);
39 let t0;
40 let d;
41 let h;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/do-while-compound-test.expect.md
+2 -2
@@ -23,9 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function Component(props) {
28 - const $ = useMemoCache(2);
28 + const $ = _c(2);
29 let ret;
30 if ($[0] !== props) {
31 const x = [1, 2, 3];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/do-while-conditional-break.expect.md
+2 -2
@@ -18,9 +18,9 @@ function Component(props) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Component(props) {
23 - const $ = useMemoCache(2);
23 + const $ = _c(2);
24 let x;
25 if ($[0] !== props) {
26 x = [0, 1, 2, 3];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/do-while-continue.expect.md
+2 -2
@@ -27,9 +27,9 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 function Component() {
32 - const $ = useMemoCache(1);
32 + const $ = _c(1);
33 let ret;
34 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
35 const x = [0, 1, 2, 3];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/do-while-early-unconditional-break.expect.md
+2 -2
@@ -16,9 +16,9 @@ function Component(props) {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function Component(props) {
21 - const $ = useMemoCache(1);
21 + const $ = _c(1);
22 let x;
23 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
24 x = [1, 2, 3];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/do-while-simple.expect.md
+2 -2
@@ -23,9 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function Component() {
28 - const $ = useMemoCache(1);
28 + const $ = _c(1);
29 let ret;
30 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
31 const x = [1, 2, 3];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/drop-methodcall-usecallback.expect.md
+2 -2
@@ -21,11 +21,11 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 import * as React from "react";
26
27 function Component(props) {
28 - const $ = useMemoCache(4);
28 + const $ = _c(4);
29 let t0;
30 if ($[0] !== props.value) {
31 t0 = () => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/drop-methodcall-usememo.expect.md
+2 -2
@@ -23,11 +23,11 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import * as React from "react";
28
29 function Component(props) {
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 let t0;
32 let x;
33 if ($[0] !== props.value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/early-return-nested-early-return-within-reactive-scope.expect.md
+2 -2
@@ -29,9 +29,9 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime";
32 +import { c as _c } from "react/compiler-runtime";
33 function Component(props) {
34 - const $ = useMemoCache(5);
34 + const $ = _c(5);
35 let t0;
36 if ($[0] !== props) {
37 t0 = Symbol.for("react.early_return_sentinel");
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/early-return-no-declarations-reassignments-dependencies.expect.md
+2 -2
@@ -50,7 +50,7 @@ export const FIXTURE_ENTRYPOINT = {
50 ## Code
51
52 ```javascript
53 -import { c as useMemoCache } from "react/compiler-runtime";
53 +import { c as _c } from "react/compiler-runtime";
54 import { makeArray } from "shared-runtime";
55
56 /**
@@ -69,7 +69,7 @@ import { makeArray } from "shared-runtime";
69 let ENABLE_FEATURE = false;
70
71 function Component(props) {
72 - const $ = useMemoCache(3);
72 + const $ = _c(3);
73 let t0;
74 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
75 t0 = Symbol.for("react.early_return_sentinel");
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/early-return-within-reactive-scope.expect.md
+2 -2
@@ -41,11 +41,11 @@ export const FIXTURE_ENTRYPOINT = {
41 ## Code
42
43 ```javascript
44 -import { c as useMemoCache } from "react/compiler-runtime";
44 +import { c as _c } from "react/compiler-runtime";
45 import { makeArray } from "shared-runtime";
46
47 function Component(props) {
48 - const $ = useMemoCache(4);
48 + const $ = _c(4);
49 let t0;
50 if ($[0] !== props) {
51 t0 = Symbol.for("react.early_return_sentinel");
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/empty-catch-statement.expect.md
+2 -2
@@ -19,11 +19,11 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 import { getNumber } from "shared-runtime";
24
25 function useFoo() {
26 - const $ = useMemoCache(1);
26 + const $ = _c(1);
27 try {
28 let t0;
29 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/escape-analysis-destructured-rest-element.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function Component(props) {
26 - const $ = useMemoCache(7);
26 + const $ = _c(7);
27 let b;
28 if ($[0] !== props.a) {
29 const { a, ...t0 } = props.a;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/escape-analysis-jsx-child.expect.md
+2 -2
@@ -25,9 +25,9 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 function foo(a, b, c) {
30 - const $ = useMemoCache(9);
30 + const $ = _c(9);
31 let x;
32 if ($[0] !== a || $[1] !== b || $[2] !== c) {
33 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/escape-analysis-logical.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function Component(props) {
27 - const $ = useMemoCache(6);
27 + const $ = _c(6);
28 let t0;
29 if ($[0] !== props.a) {
30 t0 = [props.a];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/escape-analysis-non-escaping-interleaved-allocating-dependency.expect.md
+2 -2
@@ -29,9 +29,9 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime";
32 +import { c as _c } from "react/compiler-runtime";
33 function Component(props) {
34 - const $ = useMemoCache(5);
34 + const $ = _c(5);
35 let t0;
36 if ($[0] !== props.a) {
37 t0 = [props.a];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/escape-analysis-non-escaping-interleaved-allocating-nested-dependency.expect.md
+2 -2
@@ -38,9 +38,9 @@ export const FIXTURE_ENTRYPOINT = {
38 ## Code
39
40 ```javascript
41 -import { c as useMemoCache } from "react/compiler-runtime";
41 +import { c as _c } from "react/compiler-runtime";
42 function Component(props) {
43 - const $ = useMemoCache(7);
43 + const $ = _c(7);
44 let t0;
45 if ($[0] !== props.a) {
46 t0 = [props.a];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/escape-analysis-non-escaping-interleaved-primitive-dependency.expect.md
+2 -2
@@ -31,9 +31,9 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react/compiler-runtime";
34 +import { c as _c } from "react/compiler-runtime";
35 function Component(props) {
36 - const $ = useMemoCache(3);
36 + const $ = _c(3);
37
38 const a = props.a + props.b;
39 let b;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/existing-variables-with-c-name.expect.md new
+86
@@ -0,0 +1,86 @@
1 +
2 +## Input
3 +
4 +```javascript
5 +import { useMemo, useState } from "react";
6 +import { ValidateMemoization } from "shared-runtime";
7 +
8 +function Component(props) {
9 + const [state] = useState(0);
10 + // Test for conflicts with `c` import
11 + const c = state;
12 + const _c = c;
13 + const __c = _c;
14 + const c1 = __c;
15 + const $c = c1;
16 + const array = useMemo(() => [$c], [state]);
17 + return <ValidateMemoization inputs={[state]} output={array} />;
18 +}
19 +
20 +export const FIXTURE_ENTRYPOINT = {
21 + fn: Component,
22 + params: [{}],
23 + sequentialRenders: [{}, {}, {}],
24 +};
25 +
26 +```
27 +
28 +## Code
29 +
30 +```javascript
31 +import { c as _c2 } from "react/compiler-runtime";
32 +import { useMemo, useState } from "react";
33 +import { ValidateMemoization } from "shared-runtime";
34 +
35 +function Component(props) {
36 + const $ = _c2(7);
37 + const [state] = useState(0);
38 +
39 + const c = state;
40 + const _c = c;
41 + const __c = _c;
42 + const c1 = __c;
43 + const $c = c1;
44 + let t0;
45 + let t1;
46 + if ($[0] !== $c) {
47 + t1 = [$c];
48 + $[0] = $c;
49 + $[1] = t1;
50 + } else {
51 + t1 = $[1];
52 + }
53 + t0 = t1;
54 + const array = t0;
55 + let t2;
56 + if ($[2] !== state) {
57 + t2 = [state];
58 + $[2] = state;
59 + $[3] = t2;
60 + } else {
61 + t2 = $[3];
62 + }
63 + let t3;
64 + if ($[4] !== t2 || $[5] !== array) {
65 + t3 = <ValidateMemoization inputs={t2} output={array} />;
66 + $[4] = t2;
67 + $[5] = array;
68 + $[6] = t3;
69 + } else {
70 + t3 = $[6];
71 + }
72 + return t3;
73 +}
74 +
75 +export const FIXTURE_ENTRYPOINT = {
76 + fn: Component,
77 + params: [{}],
78 + sequentialRenders: [{}, {}, {}],
79 +};
80 +
81 +```
82 +
83 +### Eval output
84 +(kind: ok) <div>{"inputs":[0],"output":[0]}</div>
85 +<div>{"inputs":[0],"output":[0]}</div>
86 +<div>{"inputs":[0],"output":[0]}</div>
\ No newline at end of file
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/existing-variables-with-c-name.js new
+20
@@ -0,0 +1,20 @@
1 +import { useMemo, useState } from "react";
2 +import { ValidateMemoization } from "shared-runtime";
3 +
4 +function Component(props) {
5 + const [state] = useState(0);
6 + // Test for conflicts with `c` import
7 + const c = state;
8 + const _c = c;
9 + const __c = _c;
10 + const c1 = __c;
11 + const $c = c1;
12 + const array = useMemo(() => [$c], [state]);
13 + return <ValidateMemoization inputs={[state]} output={array} />;
14 +}
15 +
16 +export const FIXTURE_ENTRYPOINT = {
17 + fn: Component,
18 + params: [{}],
19 + sequentialRenders: [{}, {}, {}],
20 +};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/extend-scopes-if.expect.md
+2 -2
@@ -28,9 +28,9 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime";
31 +import { c as _c } from "react/compiler-runtime";
32 function foo(a, b, c) {
33 - const $ = useMemoCache(4);
33 + const $ = _c(4);
34 let x;
35 if ($[0] !== a || $[1] !== b || $[2] !== c) {
36 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbs-params.expect.md
+2 -2
@@ -28,11 +28,11 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime";
31 +import { c as _c } from "react/compiler-runtime";
32 import { fbs } from "fbt";
33
34 function Component(props) {
35 - const $ = useMemoCache(2);
35 + const $ = _c(2);
36 let t0;
37 if ($[0] !== props.name) {
38 t0 = (
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-call-complex-param-value.expect.md
+2 -2
@@ -23,12 +23,12 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import fbt from "fbt";
28 import { identity } from "shared-runtime";
29
30 function Component(props) {
31 - const $ = useMemoCache(4);
31 + const $ = _c(4);
32 let t0;
33 if ($[0] !== props.name) {
34 t0 = fbt._(
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-call.expect.md
+2 -2
@@ -22,11 +22,11 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 import fbt from "fbt";
27
28 function Component(props) {
29 - const $ = useMemoCache(4);
29 + const $ = _c(4);
30 let t0;
31 if ($[0] !== props.count) {
32 t0 = fbt._(
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-no-whitespace-btw-text-and-param.expect.md
+2 -2
@@ -23,12 +23,12 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import fbt from "fbt";
28
29 const _ = fbt;
30 function Component(t0) {
31 - const $ = useMemoCache(2);
31 + const $ = _c(2);
32 const { value } = t0;
33 let t1;
34 if ($[0] !== value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-param-with-leading-whitespace.expect.md
+2 -2
@@ -39,12 +39,12 @@ export const FIXTURE_ENTRYPOINT = {
39 ## Code
40
41 ```javascript
42 -import { c as useMemoCache } from "react/compiler-runtime";
42 +import { c as _c } from "react/compiler-runtime";
43 import fbt from "fbt";
44 import { identity } from "shared-runtime";
45
46 function Component(props) {
47 - const $ = useMemoCache(3);
47 + const $ = _c(3);
48 let t0;
49 if ($[0] !== props.count || $[1] !== props.option) {
50 t0 = (
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-param-with-trailing-whitespace.expect.md
+2 -2
@@ -39,12 +39,12 @@ export const FIXTURE_ENTRYPOINT = {
39 ## Code
40
41 ```javascript
42 -import { c as useMemoCache } from "react/compiler-runtime";
42 +import { c as _c } from "react/compiler-runtime";
43 import fbt from "fbt";
44 import { identity } from "shared-runtime";
45
46 function Component(props) {
47 - const $ = useMemoCache(3);
47 + const $ = _c(3);
48 let t0;
49 if ($[0] !== props.count || $[1] !== props.option) {
50 t0 = (
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-params-complex-param-value.expect.md
+2 -2
@@ -17,11 +17,11 @@ function Component(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime";
20 +import { c as _c } from "react/compiler-runtime";
21 import fbt from "fbt";
22
23 function Component(props) {
24 - const $ = useMemoCache(2);
24 + const $ = _c(2);
25 let t0;
26 if ($[0] !== props.name) {
27 t0 = fbt._(
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-params.expect.md
+2 -2
@@ -23,11 +23,11 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import fbt from "fbt";
28
29 function Component(props) {
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 let t0;
32 if ($[0] !== props.name) {
33 t0 = fbt._("Hello {user name}", [fbt._param("user name", props.name)], {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-preserve-jsxtext.expect.md
+2 -2
@@ -22,11 +22,11 @@ function Foo(props) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 import fbt from "fbt";
27
28 function Foo(props) {
29 - const $ = useMemoCache(2);
29 + const $ = _c(2);
30 let t0;
31 if ($[0] !== props.value) {
32 t0 = fbt._(
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-preserve-whitespace.expect.md
+2 -2
@@ -24,12 +24,12 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import fbt from "fbt";
29
30 const _ = fbt;
31 function Component(t0) {
32 - const $ = useMemoCache(2);
32 + const $ = _c(2);
33 const { value } = t0;
34 let t1;
35 if ($[0] !== value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-single-space-btw-param-and-text.expect.md
+2 -2
@@ -23,12 +23,12 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import fbt from "fbt";
28
29 const _ = fbt;
30 function Component(t0) {
31 - const $ = useMemoCache(2);
31 + const $ = _c(2);
32 const { value } = t0;
33 let t1;
34 if ($[0] !== value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-template-string-same-scope.expect.md
+2 -2
@@ -31,12 +31,12 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react/compiler-runtime";
34 +import { c as _c } from "react/compiler-runtime";
35 import fbt from "fbt";
36 import { Stringify } from "shared-runtime";
37
38 export function Component(props) {
39 - const $ = useMemoCache(4);
39 + const $ = _c(4);
40 let count = 0;
41 if (props.items) {
42 count = props.items.length;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-whitespace-around-param-value.expect.md
+2 -2
@@ -23,12 +23,12 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import fbt from "fbt";
28
29 const _ = fbt;
30 function Component(t0) {
31 - const $ = useMemoCache(2);
31 + const $ = _c(2);
32 const { value } = t0;
33 let t1;
34 if ($[0] !== value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-whitespace-within-text.expect.md
+2 -2
@@ -25,12 +25,12 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 import fbt from "fbt";
30
31 const _ = fbt;
32 function Component(t0) {
33 - const $ = useMemoCache(2);
33 + const $ = _c(2);
34 const { value } = t0;
35 let t1;
36 if ($[0] !== value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbtparam-text-must-use-expression-container.expect.md
+2 -2
@@ -21,11 +21,11 @@ function Component(props) {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 import fbt from "fbt";
26
27 function Component(props) {
28 - const $ = useMemoCache(1);
28 + const $ = _c(1);
29 let t0;
30 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
31 t0 = (
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbtparam-with-jsx-element-content.expect.md
+2 -2
@@ -25,11 +25,11 @@ function Component({ name, data, icon }) {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 import fbt from "fbt";
30
31 function Component(t0) {
32 - const $ = useMemoCache(4);
32 + const $ = _c(4);
33 const { name, data, icon } = t0;
34 let t1;
35 if ($[0] !== name || $[1] !== icon || $[2] !== data) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbtparam-with-jsx-fragment-value.expect.md
+2 -2
@@ -22,12 +22,12 @@ function Component(props) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 import fbt from "fbt";
27 import { identity } from "shared-runtime";
28
29 function Component(props) {
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 let t0;
32 if ($[0] !== props.text) {
33 t0 = (
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/lambda-with-fbt.expect.md
+2 -2
@@ -38,11 +38,11 @@ function Component() {
38 ## Code
39
40 ```javascript
41 -import { c as useMemoCache } from "react/compiler-runtime";
41 +import { c as _c } from "react/compiler-runtime";
42 import { fbt } from "fbt";
43
44 function Component() {
45 - const $ = useMemoCache(2);
45 + const $ = _c(2);
46 let t0;
47 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
48 t0 = () => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/flag-enable-emit-hook-guards.expect.md
+2 -2
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37
38 ```javascript
39 import { $dispatcherGuard } from "react-compiler-runtime";
40 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableEmitHookGuards
40 +import { c as _c } from "react/compiler-runtime"; // @enableEmitHookGuards
41 import { createContext, useContext, useEffect, useState } from "react";
42 import {
43 CONST_STRING0,
@@ -49,7 +49,7 @@ import {
49
50 const MyContext = createContext("my context value");
51 function Component(t0) {
52 - const $ = useMemoCache(4);
52 + const $ = _c(4);
53 try {
54 $dispatcherGuard(0);
55 const { value } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-in-statement-break.expect.md
+2 -2
@@ -25,9 +25,9 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 function Component(props) {
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 let x;
32 let t0;
33 if ($[0] !== props.value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-in-statement-continue.expect.md
+2 -2
@@ -34,9 +34,9 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react/compiler-runtime";
37 +import { c as _c } from "react/compiler-runtime";
38 function Component(props) {
39 - const $ = useMemoCache(2);
39 + const $ = _c(2);
40 let x;
41 let t0;
42 if ($[0] !== props.value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-in-statement.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function Component(props) {
25 - const $ = useMemoCache(4);
25 + const $ = _c(4);
26 let items;
27 if ($[0] !== props) {
28 items = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-loop-with-value-block-initializer.expect.md
+2 -2
@@ -30,10 +30,10 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react/compiler-runtime";
33 +import { c as _c } from "react/compiler-runtime";
34 const TOTAL = 10;
35 function Component(props) {
36 - const $ = useMemoCache(5);
36 + const $ = _c(5);
37 let items;
38 if ($[0] !== props.start || $[1] !== props.items) {
39 items = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-multiple-variable-declarations-in-initializer.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function Component(props) {
27 - const $ = useMemoCache(2);
27 + const $ = _c(2);
28 let items;
29 if ($[0] !== props.items) {
30 items = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-break.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function Component() {
26 - const $ = useMemoCache(1);
26 + const $ = _c(1);
27 let t0;
28 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
29 t0 = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-capture-item-of-local-collection-mutate-later-value-initially-null.expect.md
+2 -2
@@ -27,11 +27,11 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 import { makeObject_Primitives } from "shared-runtime";
32
33 function Component(props) {
34 - const $ = useMemoCache(1);
34 + const $ = _c(1);
35 let items;
36 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
37 let lastItem = null;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-capture-item-of-local-collection-mutate-later.expect.md
+2 -2
@@ -27,11 +27,11 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 import { makeObject_Primitives } from "shared-runtime";
32
33 function Component(props) {
34 - const $ = useMemoCache(1);
34 + const $ = _c(1);
35 let items;
36 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
37 let lastItem = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-conditional-break.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function Component() {
29 - const $ = useMemoCache(1);
29 + const $ = _c(1);
30 let x;
31 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
32 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-continue.expect.md
+2 -2
@@ -25,9 +25,9 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 function Component() {
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 let t0;
32 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
33 t0 = [0, 1, 2, 3];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-destructure.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function Component() {
27 - const $ = useMemoCache(1);
27 + const $ = _c(1);
28 let x;
29 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
30 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-immutable-collection.expect.md
+2 -2
@@ -35,9 +35,9 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react/compiler-runtime";
38 +import { c as _c } from "react/compiler-runtime";
39 function Router(t0) {
40 - const $ = useMemoCache(3);
40 + const $ = _c(3);
41 const { title, mapping } = t0;
42 let array;
43 if ($[0] !== mapping || $[1] !== title) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-iterator-of-immutable-collection.expect.md
+2 -2
@@ -35,9 +35,9 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react/compiler-runtime";
38 +import { c as _c } from "react/compiler-runtime";
39 function Router(t0) {
40 - const $ = useMemoCache(3);
40 + const $ = _c(3);
41 const { title, mapping } = t0;
42 let array;
43 if ($[0] !== mapping || $[1] !== title) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-mutate-item-of-local-collection.expect.md
+2 -2
@@ -23,11 +23,11 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import { makeObject_Primitives } from "shared-runtime";
28
29 function Component(props) {
30 - const $ = useMemoCache(1);
30 + const $ = _c(1);
31 let items;
32 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
33 items = [makeObject_Primitives(), makeObject_Primitives()];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-mutate.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import { makeObject_Primitives, mutateAndReturn, toJSON } from "shared-runtime";
29
30 function Component(_props) {
31 - const $ = useMemoCache(1);
31 + const $ = _c(1);
32 let t0;
33 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
34 const collection = [makeObject_Primitives()];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-nonmutating-loop-local-collection.expect.md
+2 -2
@@ -39,12 +39,12 @@ export const FIXTURE_ENTRYPOINT = {
39 ## Code
40
41 ```javascript
42 -import { c as useMemoCache } from "react/compiler-runtime";
42 +import { c as _c } from "react/compiler-runtime";
43 import { useMemo } from "react";
44 import { ValidateMemoization } from "shared-runtime";
45
46 function Component(t0) {
47 - const $ = useMemoCache(19);
47 + const $ = _c(19);
48 const { a, b } = t0;
49 let t1;
50 let t2;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-simple.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function Component() {
27 - const $ = useMemoCache(1);
27 + const $ = _c(1);
28 let x;
29 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
30 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/frozen-after-alias.expect.md
+2 -2
@@ -18,9 +18,9 @@ function foo(x) {}
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Component() {
23 - const $ = useMemoCache(1);
23 + const $ = _c(1);
24 let t0;
25 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
26 t0 = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/function-declaration-reassign.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function component() {
26 - const $ = useMemoCache(1);
26 + const $ = _c(1);
27 let x;
28 let t0;
29 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/function-declaration-redeclare.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function component() {
26 - const $ = useMemoCache(1);
26 + const $ = _c(1);
27 let x;
28 let t0;
29 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/function-declaration-simple.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function component(a) {
27 - const $ = useMemoCache(3);
27 + const $ = _c(3);
28 let t;
29 if ($[0] !== a) {
30 t = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/function-expr-directive.expect.md
+2 -2
@@ -23,10 +23,10 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function Component() {
28 "use strict";
29 - const $ = useMemoCache(3);
29 + const $ = _c(3);
30
31 const [count, setCount] = React.useState(0);
32 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/function-expression-captures-value-later-frozen-jsx.expect.md
+2 -2
@@ -20,9 +20,9 @@ function Component(props) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function Component(props) {
25 - const $ = useMemoCache(3);
25 + const $ = _c(3);
26 let t0;
27 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28 t0 = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/function-expression-maybe-mutates-hook-return-value.expect.md
+2 -2
@@ -20,9 +20,9 @@ function Component(props) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function Component(props) {
25 - const $ = useMemoCache(4);
25 + const $ = _c(4);
26 const id = useSelectedEntitytId();
27 let t0;
28 if ($[0] !== id) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/function-expression-with-store-to-parameter.expect.md
+2 -2
@@ -17,9 +17,9 @@ function Component(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime";
20 +import { c as _c } from "react/compiler-runtime";
21 function Component(props) {
22 - const $ = useMemoCache(3);
22 + const $ = _c(3);
23 let t0;
24 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
25 t0 = (object, key, value) => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/function-param-assignment-pattern.expect.md
+2 -2
@@ -17,9 +17,9 @@ export const FIXTURE_ENTRYPOINT = {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime";
20 +import { c as _c } from "react/compiler-runtime";
21 function Component(t0, t1) {
22 - const $ = useMemoCache(5);
22 + const $ = _c(5);
23 const x = t0 === undefined ? "default" : t0;
24 let t2;
25 if ($[0] !== t1) {
"b/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/functionexpr\342\200\223conditional-access.expect.md" renamed
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableTreatFunctionDepsAsConditional
24 +import { c as _c } from "react/compiler-runtime"; // @enableTreatFunctionDepsAsConditional
25 function Component(props) {
26 - const $ = useMemoCache(5);
26 + const $ = _c(5);
27 let t0;
28 if ($[0] !== props) {
29 t0 = function getLength() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/gating-access-function-name-in-component.expect.md
+2 -2
@@ -19,10 +19,10 @@ export const FIXTURE_ENTRYPOINT = {
19
20 ```javascript
21 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
22 -import { c as useMemoCache } from "react/compiler-runtime"; // @gating
22 +import { c as _c } from "react/compiler-runtime"; // @gating
23 const Component = isForgetEnabled_Fixtures()
24 ? function Component() {
25 - const $ = useMemoCache(1);
25 + const $ = _c(1);
26 const name = Component.name;
27 let t0;
28 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/gating-test-export-default-function.expect.md
+3 -3
@@ -23,11 +23,11 @@ function Foo(props) {
23
24 ```javascript
25 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
26 -import { c as useMemoCache } from "react/compiler-runtime"; // @gating @compilationMode(annotation)
26 +import { c as _c } from "react/compiler-runtime"; // @gating @compilationMode(annotation)
27 export default isForgetEnabled_Fixtures()
28 ? function Bar(props) {
29 "use forget";
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 let t0;
32 if ($[0] !== props.bar) {
33 t0 = <div>{props.bar}</div>;
@@ -49,7 +49,7 @@ function NoForget(props) {
49 const Foo = isForgetEnabled_Fixtures()
50 ? function Foo(props) {
51 "use forget";
52 - const $ = useMemoCache(2);
52 + const $ = _c(2);
53 let t0;
54 if ($[0] !== props.bar) {
55 t0 = <Foo>{props.bar}</Foo>;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/gating-test-export-function-and-default.expect.md
+3 -3
@@ -23,11 +23,11 @@ export function Foo(props) {
23
24 ```javascript
25 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
26 -import { c as useMemoCache } from "react/compiler-runtime"; // @gating @compilationMode(annotation)
26 +import { c as _c } from "react/compiler-runtime"; // @gating @compilationMode(annotation)
27 export default isForgetEnabled_Fixtures()
28 ? function Bar(props) {
29 "use forget";
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 let t0;
32 if ($[0] !== props.bar) {
33 t0 = <div>{props.bar}</div>;
@@ -50,7 +50,7 @@ function NoForget(props) {
50 export const Foo = isForgetEnabled_Fixtures()
51 ? function Foo(props) {
52 "use forget";
53 - const $ = useMemoCache(2);
53 + const $ = _c(2);
54 let t0;
55 if ($[0] !== props.bar) {
56 t0 = <Foo>{props.bar}</Foo>;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/gating-test-export-function.expect.md
+3 -3
@@ -23,11 +23,11 @@ export function Foo(props) {
23
24 ```javascript
25 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
26 -import { c as useMemoCache } from "react/compiler-runtime"; // @gating @compilationMode(annotation)
26 +import { c as _c } from "react/compiler-runtime"; // @gating @compilationMode(annotation)
27 export const Bar = isForgetEnabled_Fixtures()
28 ? function Bar(props) {
29 "use forget";
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 let t0;
32 if ($[0] !== props.bar) {
33 t0 = <div>{props.bar}</div>;
@@ -50,7 +50,7 @@ export function NoForget(props) {
50 export const Foo = isForgetEnabled_Fixtures()
51 ? function Foo(props) {
52 "use forget";
53 - const $ = useMemoCache(2);
53 + const $ = _c(2);
54 let t0;
55 if ($[0] !== props.bar) {
56 t0 = <Foo>{props.bar}</Foo>;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/gating-test.expect.md
+3 -3
@@ -23,11 +23,11 @@ function Foo(props) {
23
24 ```javascript
25 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
26 -import { c as useMemoCache } from "react/compiler-runtime"; // @gating @compilationMode(annotation)
26 +import { c as _c } from "react/compiler-runtime"; // @gating @compilationMode(annotation)
27 const Bar = isForgetEnabled_Fixtures()
28 ? function Bar(props) {
29 "use forget";
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 let t0;
32 if ($[0] !== props.bar) {
33 t0 = <div>{props.bar}</div>;
@@ -49,7 +49,7 @@ function NoForget(props) {
49 const Foo = isForgetEnabled_Fixtures()
50 ? function Foo(props) {
51 "use forget";
52 - const $ = useMemoCache(2);
52 + const $ = _c(2);
53 let t0;
54 if ($[0] !== props.bar) {
55 t0 = <Foo>{props.bar}</Foo>;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/gating-with-hoisted-type-reference.flow.expect.md
+2 -2
@@ -19,13 +19,13 @@ export default memo<Props>(Component);
19
20 ```javascript
21 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 import { memo } from "react";
24
25 type Props = React.ElementConfig<typeof Component>;
26 const Component = isForgetEnabled_Fixtures()
27 ? function Component(t0) {
28 - const $ = useMemoCache(2);
28 + const $ = _c(2);
29 const { value } = t0;
30 let t1;
31 if ($[0] !== value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/global-jsx-tag-lowered-between-mutations.expect.md
+2 -2
@@ -23,9 +23,9 @@ function Component(props) {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function Component(props) {
28 - const $ = useMemoCache(1);
28 + const $ = _c(1);
29 let t0;
30 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
31 const maybeMutable = new MaybeMutable();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/globals-Boolean.expect.md
+2 -2
@@ -19,9 +19,9 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function Component(props) {
24 - const $ = useMemoCache(2);
24 + const $ = _c(2);
25 let t0;
26 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
27 t0 = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/globals-Number.expect.md
+2 -2
@@ -19,9 +19,9 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function Component(props) {
24 - const $ = useMemoCache(2);
24 + const $ = _c(2);
25 let t0;
26 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
27 t0 = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/globals-String.expect.md
+2 -2
@@ -19,9 +19,9 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function Component(props) {
24 - const $ = useMemoCache(2);
24 + const $ = _c(2);
25 let t0;
26 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
27 t0 = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-computed-member-expression.expect.md
+2 -2
@@ -29,11 +29,11 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime";
32 +import { c as _c } from "react/compiler-runtime";
33 import { Stringify } from "shared-runtime";
34
35 function hoisting() {
36 - const $ = useMemoCache(3);
36 + const $ = _c(3);
37 let onClick;
38 let onClick2;
39 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-member-expression.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import { Stringify } from "shared-runtime";
29
30 function hoisting() {
31 - const $ = useMemoCache(2);
31 + const $ = _c(2);
32 let onClick;
33 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
34 onClick = function onClick(x) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-nested-const-declaration-2.expect.md
+2 -2
@@ -25,9 +25,9 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 function hoisting(cond) {
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 let items;
32 if ($[0] !== cond) {
33 items = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-nested-const-declaration.expect.md
+2 -2
@@ -29,9 +29,9 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime";
32 +import { c as _c } from "react/compiler-runtime";
33 function hoisting() {
34 - const $ = useMemoCache(1);
34 + const $ = _c(1);
35 let t0;
36 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
37 const qux = () => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-object-method.expect.md
+2 -2
@@ -25,9 +25,9 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 function hoisting() {
30 - const $ = useMemoCache(1);
30 + const $ = _c(1);
31 let t0;
32 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
33 const x = {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-recursive-call-within-lambda.expect.md
+2 -2
@@ -25,9 +25,9 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 function Foo(t0) {
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 let t1;
32 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
33 t1 = (val) => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-recursive-call.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function Foo(t0) {
29 - const $ = useMemoCache(2);
29 + const $ = _c(2);
30 const { value } = t0;
31 let t1;
32 if ($[0] !== value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-repro-variable-used-in-assignment.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function get2() {
26 - const $ = useMemoCache(1);
26 + const $ = _c(1);
27 let t0;
28 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
29 const callbk = () => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-simple-const-declaration.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function hoisting() {
27 - const $ = useMemoCache(1);
27 + const $ = _c(1);
28 let t0;
29 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
30 const foo = () => bar + baz;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-simple-function-expression.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function hoisting() {
29 - const $ = useMemoCache(1);
29 + const $ = _c(1);
30 let t0;
31 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
32 const foo = () => bar();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-within-lambda.expect.md
+2 -2
@@ -23,9 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function Component(t0) {
28 - const $ = useMemoCache(2);
28 + const $ = _c(2);
29 let t1;
30 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
31 t1 = () => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/holey-array-expr.expect.md
+2 -2
@@ -20,11 +20,11 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 import { CONST_STRING0 } from "shared-runtime";
25
26 function t(props) {
27 - const $ = useMemoCache(2);
27 + const $ = _c(2);
28 let t0;
29 if ($[0] !== props) {
30 t0 = [, CONST_STRING0, props];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hook-call.expect.md
+2 -2
@@ -22,12 +22,12 @@ function Component(props) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function useFreeze() {}
27 function foo() {}
28
29 function Component(props) {
30 - const $ = useMemoCache(3);
30 + const $ = _c(3);
31 let t0;
32 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
33 t0 = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hook-declaration-basic.flow.expect.md
+2 -2
@@ -12,9 +12,9 @@ export default hook useFoo(bar: number) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime";
15 +import { c as _c } from "react/compiler-runtime";
16 export default function useFoo(bar) {
17 - const $ = useMemoCache(2);
17 + const $ = _c(2);
18 let t0;
19 if ($[0] !== bar) {
20 t0 = [bar];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hook-noAlias.expect.md
+2 -2
@@ -27,11 +27,11 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 import { useNoAlias } from "shared-runtime";
32
33 function Component(props) {
34 - const $ = useMemoCache(5);
34 + const $ = _c(5);
35 let t0;
36 if ($[0] !== props.a) {
37 t0 = { a: props.a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hooks-freeze-arguments.expect.md
+2 -2
@@ -18,9 +18,9 @@ function call(x) {}
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Component() {
23 - const $ = useMemoCache(1);
23 + const $ = _c(1);
24 let t0;
25 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
26 t0 = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hooks-freeze-possibly-mutable-arguments.expect.md
+2 -2
@@ -25,9 +25,9 @@ function call(x) {}
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 function Component(props) {
30 - const $ = useMemoCache(1);
30 + const $ = _c(1);
31 const cond = props.cond;
32 const x = props.x;
33 let a;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hooks-with-prefix.expect.md
+2 -2
@@ -36,7 +36,7 @@ export const FIXTURE_ENTRYPOINT = {
36 ## Code
37
38 ```javascript
39 -import { c as useMemoCache } from "react/compiler-runtime"; // @hookPattern:".*\b(use[^$]+)$"
39 +import { c as _c } from "react/compiler-runtime"; // @hookPattern:".*\b(use[^$]+)$"
40
41 import * as React from "react";
42 import { makeArray, useHook } from "shared-runtime";
@@ -46,7 +46,7 @@ const React$useMemo = React.useMemo;
46 const Internal$Reassigned$useHook = useHook;
47
48 function Component() {
49 - const $ = useMemoCache(8);
49 + const $ = _c(8);
50 const [state] = React$useState(0);
51 const object = Internal$Reassigned$useHook();
52 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hot-module-reloading.expect.md
+2 -2
@@ -23,12 +23,12 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableResetCacheOnSourceFileChanges
26 +import { c as _c } from "react/compiler-runtime"; // @enableResetCacheOnSourceFileChanges
27 import { useMemo, useState } from "react";
28 import { ValidateMemoization } from "shared-runtime";
29
30 function Component(props) {
31 - const $ = useMemoCache(8);
31 + const $ = _c(8);
32 if (
33 $[0] !== "bb6936608c0afe8e313aa547ca09fbc8451f24664284368812127c7e9bc2bca9"
34 ) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ignore-use-no-forget.expect.md
+2 -2
@@ -19,10 +19,10 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime"; // @ignoreUseNoForget
22 +import { c as _c } from "react/compiler-runtime"; // @ignoreUseNoForget
23 function Component(prop) {
24 "use no forget";
25 - const $ = useMemoCache(4);
25 + const $ = _c(4);
26 let t0;
27 if ($[0] !== prop.x) {
28 t0 = prop.x.toFixed();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/iife-return-modified-later-phi.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function Component(props) {
29 - const $ = useMemoCache(2);
29 + const $ = _c(2);
30 let items;
31 if ($[0] !== props) {
32 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/iife-return-modified-later.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function Component(props) {
25 - const $ = useMemoCache(3);
25 + const $ = _c(3);
26 let t0;
27 let items;
28 if ($[0] !== props.a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/immutable-hooks.expect.md
+2 -2
@@ -17,9 +17,9 @@ function Component(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableAssumeHooksFollowRulesOfReact true
20 +import { c as _c } from "react/compiler-runtime"; // @enableAssumeHooksFollowRulesOfReact true
21 function Component(props) {
22 - const $ = useMemoCache(3);
22 + const $ = _c(3);
23 let t0;
24 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
25 t0 = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inadvertent-mutability-readonly-lambda.expect.md
+2 -2
@@ -21,9 +21,9 @@ function Component(props) {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function Component(props) {
26 - const $ = useMemoCache(2);
26 + const $ = _c(2);
27 const [value, setValue] = useState(null);
28 let t0;
29 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/incompatible-destructuring-kinds.expect.md
+2 -2
@@ -23,12 +23,12 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import { useMemo } from "react";
28 import { Stringify } from "shared-runtime";
29
30 function Component(t0) {
31 - const $ = useMemoCache(4);
31 + const $ = _c(4);
32 let t1;
33 let a;
34 let b;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/independent-across-if.expect.md
+2 -2
@@ -36,7 +36,7 @@ function Component(props) {
36 ## Code
37
38 ```javascript
39 -import { c as useMemoCache } from "react/compiler-runtime";
39 +import { c as _c } from "react/compiler-runtime";
40 function compute() {}
41 function mutate() {}
42 function foo() {}
@@ -57,7 +57,7 @@ function Foo() {}
57 * return = <Foo a={a} b={b} />
58 */
59 function Component(props) {
60 - const $ = useMemoCache(8);
60 + const $ = _c(8);
61 let a;
62 let b;
63 if ($[0] !== props.a || $[1] !== props.b || $[2] !== props.c) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/independent.expect.md
+2 -2
@@ -27,7 +27,7 @@ function Foo() {}
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 /**
32 * Should produce 3 scopes:
33 *
@@ -39,7 +39,7 @@ import { c as useMemoCache } from "react/compiler-runtime";
39 * return = <Foo a={a} b={b} />
40 */
41 function Component(props) {
42 - const $ = useMemoCache(7);
42 + const $ = _c(7);
43 let t0;
44 if ($[0] !== props.a) {
45 t0 = compute(props.a);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/independently-memoize-object-property.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function foo(a, b, c) {
26 - const $ = useMemoCache(7);
26 + const $ = _c(7);
27 let x;
28 if ($[0] !== a || $[1] !== b || $[2] !== c) {
29 x = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-compile-hooks-with-multiple-params.expect.md
+2 -2
@@ -22,12 +22,12 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
25 +import { c as _c } from "react/compiler-runtime"; // @compilationMode(infer)
26 import { useNoAlias } from "shared-runtime";
27
28 // This should be compiled by Forget
29 function useFoo(value1, value2) {
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31
32 const t0 = useNoAlias(value1 + value2);
33 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-function-React-memo.expect.md
+2 -2
@@ -12,9 +12,9 @@ React.memo((props) => {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
15 +import { c as _c } from "react/compiler-runtime"; // @compilationMode(infer)
16 React.memo((props) => {
17 - const $ = useMemoCache(1);
17 + const $ = _c(1);
18 let t0;
19 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
20 t0 = <div />;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-function-assignment.expect.md
+2 -2
@@ -12,9 +12,9 @@ const Component = (props) => {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
15 +import { c as _c } from "react/compiler-runtime"; // @compilationMode(infer)
16 const Component = (props) => {
17 - const $ = useMemoCache(1);
17 + const $ = _c(1);
18 let t0;
19 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
20 t0 = <div />;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-function-expression-React-memo-gating.expect.md
+2 -2
@@ -14,12 +14,12 @@ export default React.forwardRef(function notNamedLikeAComponent(props) {
14
15 ```javascript
16 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
17 -import { c as useMemoCache } from "react/compiler-runtime"; // @gating @compilationMode(infer)
17 +import { c as _c } from "react/compiler-runtime"; // @gating @compilationMode(infer)
18 import React from "react";
19 export default React.forwardRef(
20 isForgetEnabled_Fixtures()
21 ? function notNamedLikeAComponent(props) {
22 - const $ = useMemoCache(1);
22 + const $ = _c(1);
23 let t0;
24 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
25 t0 = <div />;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-function-expression-component.expect.md
+2 -2
@@ -13,10 +13,10 @@ const Component = function ComponentName(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
16 +import { c as _c } from "react/compiler-runtime"; // @compilationMode(infer)
17
18 const Component = function ComponentName(props) {
19 - const $ = useMemoCache(1);
19 + const $ = _c(1);
20 let t0;
21 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
22 t0 = <Foo />;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-function-forwardRef.expect.md
+2 -2
@@ -12,9 +12,9 @@ React.forwardRef((props) => {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
15 +import { c as _c } from "react/compiler-runtime"; // @compilationMode(infer)
16 React.forwardRef((props) => {
17 - const $ = useMemoCache(1);
17 + const $ = _c(1);
18 let t0;
19 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
20 t0 = <div />;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-functions-component-with-hook-call.expect.md
+2 -2
@@ -13,9 +13,9 @@ function Component(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
16 +import { c as _c } from "react/compiler-runtime"; // @compilationMode(infer)
17 function Component(props) {
18 - const $ = useMemoCache(2);
18 + const $ = _c(2);
19 const [state] = useState(null);
20 let t0;
21 if ($[0] !== state) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-functions-component-with-jsx.expect.md
+2 -2
@@ -12,9 +12,9 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
15 +import { c as _c } from "react/compiler-runtime"; // @compilationMode(infer)
16 function Component(props) {
17 - const $ = useMemoCache(1);
17 + const $ = _c(1);
18 let t0;
19 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
20 t0 = <div />;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-functions-component-with-ref-arg.expect.md
+2 -2
@@ -18,10 +18,10 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
21 +import { c as _c } from "react/compiler-runtime"; // @compilationMode(infer)
22
23 function Foo(t0, ref) {
24 - const $ = useMemoCache(2);
24 + const $ = _c(2);
25 let t1;
26 if ($[0] !== ref) {
27 t1 = <div ref={ref} />;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-functions-hook-with-hook-call.expect.md
+2 -2
@@ -13,9 +13,9 @@ function useStateValue(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
16 +import { c as _c } from "react/compiler-runtime"; // @compilationMode(infer)
17 function useStateValue(props) {
18 - const $ = useMemoCache(2);
18 + const $ = _c(2);
19 const [state] = useState(null);
20 let t0;
21 if ($[0] !== state) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-functions-hook-with-jsx.expect.md
+2 -2
@@ -12,9 +12,9 @@ function useDiv(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
15 +import { c as _c } from "react/compiler-runtime"; // @compilationMode(infer)
16 function useDiv(props) {
17 - const $ = useMemoCache(1);
17 + const $ = _c(1);
18 let t0;
19 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
20 t0 = <div />;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-global-object.expect.md
+2 -2
@@ -29,13 +29,13 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime";
32 +import { c as _c } from "react/compiler-runtime";
33 import { identity, sum } from "shared-runtime";
34
35 // Check that we correctly resolve type and effect lookups on the javascript
36 // global object.
37 function Component(props) {
38 - const $ = useMemoCache(4);
38 + const $ = _c(4);
39 let t0;
40 if ($[0] !== props.b) {
41 t0 = identity(props.b);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inner-memo-value-not-promoted-to-outer-scope-dynamic.expect.md
+2 -2
@@ -22,9 +22,9 @@ function Component(props) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function Component(props) {
27 - const $ = useMemoCache(15);
27 + const $ = _c(15);
28 const item = useFragment(FRAGMENT, props.item);
29 useFreeze(item);
30 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inner-memo-value-not-promoted-to-outer-scope-static.expect.md
+2 -2
@@ -19,9 +19,9 @@ function Component(props) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function Component(props) {
24 - const $ = useMemoCache(1);
24 + const $ = _c(1);
25 let t0;
26 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
27 const count = new MaybeMutable();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/interdependent-across-if.expect.md
+2 -2
@@ -30,7 +30,7 @@ function Component(props) {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react/compiler-runtime";
33 +import { c as _c } from "react/compiler-runtime";
34 function compute() {}
35 function foo() {}
36 function Foo() {}
@@ -46,7 +46,7 @@ function Foo() {}
46 * return = <Foo a={a} b={b} />
47 */
48 function Component(props) {
49 - const $ = useMemoCache(8);
49 + const $ = _c(8);
50 let a;
51 let b;
52 if ($[0] !== props.a || $[1] !== props.b || $[2] !== props.c) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/interdependent.expect.md
+2 -2
@@ -27,7 +27,7 @@ function Foo() {}
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 /**
32 * Should produce 1 scope:
33 *
@@ -38,7 +38,7 @@ import { c as useMemoCache } from "react/compiler-runtime";
38 * return = <Foo a={a} b={b} />
39 */
40 function Component(props) {
41 - const $ = useMemoCache(7);
41 + const $ = _c(7);
42 let a;
43 let b;
44 if ($[0] !== props.a || $[1] !== props.b) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inverted-if.expect.md
+2 -2
@@ -25,9 +25,9 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 function foo(a, b, c, d) {
30 - const $ = useMemoCache(5);
30 + const $ = _c(5);
31 let y;
32 if ($[0] !== a || $[1] !== b || $[2] !== c || $[3] !== d) {
33 y = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/issue933-disjoint-set-infinite-loop.expect.md
+2 -2
@@ -30,7 +30,7 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react/compiler-runtime";
33 +import { c as _c } from "react/compiler-runtime";
34 function makeObj() {
35 "use no forget";
36 const result = [];
@@ -41,7 +41,7 @@ function makeObj() {
41
42 // This caused an infinite loop in the compiler
43 function MyApp(props) {
44 - const $ = useMemoCache(1);
44 + const $ = _c(1);
45 let y;
46 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
47 y = makeObj();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-attribute-default-to-true.expect.md
+2 -2
@@ -19,11 +19,11 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 import { Stringify } from "shared-runtime";
24
25 function Component() {
26 - const $ = useMemoCache(1);
26 + const $ = _c(1);
27 let t0;
28 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
29 t0 = <Stringify truthyAttribute={true} />;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-attribute-with-jsx-element-value.expect.md
+4 -4
@@ -42,9 +42,9 @@ export const FIXTURE_ENTRYPOINT = {
42 ## Code
43
44 ```javascript
45 -import { c as useMemoCache } from "react/compiler-runtime";
45 +import { c as _c } from "react/compiler-runtime";
46 function Component(t0) {
47 - const $ = useMemoCache(2);
47 + const $ = _c(2);
48 const { items } = t0;
49 let t1;
50 if ($[0] !== items) {
@@ -74,7 +74,7 @@ function Foo(t0) {
74 }
75
76 function Bar(t0) {
77 - const $ = useMemoCache(2);
77 + const $ = _c(2);
78 const { children } = t0;
79 let t1;
80 if ($[0] !== children) {
@@ -88,7 +88,7 @@ function Bar(t0) {
88 }
89
90 function Item(t0) {
91 - const $ = useMemoCache(2);
91 + const $ = _c(2);
92 const { item } = t0;
93 let t1;
94 if ($[0] !== item.name) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-attribute-with-jsx-fragment-value.flow.expect.md
+3 -3
@@ -31,11 +31,11 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react/compiler-runtime";
34 +import { c as _c } from "react/compiler-runtime";
35 import { Stringify } from "shared-runtime";
36
37 function Component(t0) {
38 - const $ = useMemoCache(2);
38 + const $ = _c(2);
39 const { items } = t0;
40 let t1;
41 if ($[0] !== items) {
@@ -60,7 +60,7 @@ function Component(t0) {
60 }
61
62 function Foo(t0) {
63 - const $ = useMemoCache(2);
63 + const $ = _c(2);
64 const { value } = t0;
65 let t1;
66 if ($[0] !== value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-empty-expression.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 export function Component(props) {
26 - const $ = useMemoCache(2);
26 + const $ = _c(2);
27 let t0;
28 if ($[0] !== props.a) {
29 t0 = <div>{props.a}</div>;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-fragment.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function Foo(props) {
29 - const $ = useMemoCache(3);
29 + const $ = _c(3);
30 let t0;
31 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
32 t0 = (
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-freeze.expect.md
+2 -2
@@ -25,12 +25,12 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 import { jsx as _jsx } from "react/jsx-runtime";
30 import { shallowCopy } from "shared-runtime";
31
32 function Component(props) {
33 - const $ = useMemoCache(2);
33 + const $ = _c(2);
34 let element;
35 if ($[0] !== props.width) {
36 const childprops = { style: { width: props.width } };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-local-memberexpr-tag-conditional.expect.md
+2 -2
@@ -22,10 +22,10 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 import * as SharedRuntime from "shared-runtime";
27 function useFoo(t0) {
28 - const $ = useMemoCache(1);
28 + const $ = _c(1);
29 const { cond } = t0;
30 const MyLocal = SharedRuntime;
31 if (cond) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-local-memberexpr-tag.expect.md
+2 -2
@@ -18,10 +18,10 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 import * as SharedRuntime from "shared-runtime";
23 function useFoo() {
24 - const $ = useMemoCache(1);
24 + const $ = _c(1);
25 const MyLocal = SharedRuntime;
26 let t0;
27 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-local-tag-in-lambda.expect.md
+2 -2
@@ -21,10 +21,10 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 import { Stringify } from "shared-runtime";
26 function useFoo() {
27 - const $ = useMemoCache(2);
27 + const $ = _c(2);
28 let t0;
29 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
30 t0 = () => <Stringify value={4} />;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-member-expression-tag-grouping.expect.md
+2 -2
@@ -12,9 +12,9 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime";
15 +import { c as _c } from "react/compiler-runtime";
16 function Component(props) {
17 - const $ = useMemoCache(1);
17 + const $ = _c(1);
18 let t0;
19 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
20 const maybeMutable = new MaybeMutable();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-member-expression.expect.md
+2 -2
@@ -15,9 +15,9 @@ function Component(props) {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react/compiler-runtime";
18 +import { c as _c } from "react/compiler-runtime";
19 function Component(props) {
20 - const $ = useMemoCache(1);
20 + const $ = _c(1);
21 let t0;
22 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
23 t0 = (
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-memberexpr-tag-in-lambda.expect.md
+2 -2
@@ -21,10 +21,10 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 import * as SharedRuntime from "shared-runtime";
26 function useFoo() {
27 - const $ = useMemoCache(2);
27 + const $ = _c(2);
28 const MyLocal = SharedRuntime;
29 let t0;
30 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-namespaced-name.expect.md
+2 -2
@@ -17,9 +17,9 @@ export const FIXTURE_ENTRYPOINT = {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime";
20 +import { c as _c } from "react/compiler-runtime";
21 function Component(props) {
22 - const $ = useMemoCache(2);
22 + const $ = _c(2);
23 let t0;
24 if ($[0] !== props.version) {
25 t0 = <xml:http protocol:version={props.version} />;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-preserve-whitespace.expect.md
+2 -2
@@ -32,11 +32,11 @@ export const FIXTURE_ENTRYPOINT = {
32 ## Code
33
34 ```javascript
35 -import { c as useMemoCache } from "react/compiler-runtime";
35 +import { c as _c } from "react/compiler-runtime";
36 import { StaticText1 } from "shared-runtime";
37
38 function Component() {
39 - const $ = useMemoCache(3);
39 + const $ = _c(3);
40 let t0;
41 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
42 t0 = <StaticText1 />;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-reactive-local-variable-member-expr.expect.md
+2 -2
@@ -23,11 +23,11 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import * as sharedRuntime from "shared-runtime";
28
29 function Component(t0) {
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 const { something } = t0;
32
33 const Foo = something.StaticText1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-spread.expect.md
+2 -2
@@ -13,9 +13,9 @@ function Component(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react/compiler-runtime";
16 +import { c as _c } from "react/compiler-runtime";
17 function Component(props) {
18 - const $ = useMemoCache(5);
18 + const $ = _c(5);
19
20 const t0 = props.cond ? props.foo : props.bar;
21 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-tag-evaluation-order-non-global.expect.md
+3 -3
@@ -34,11 +34,11 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react/compiler-runtime";
37 +import { c as _c } from "react/compiler-runtime";
38 import { StaticText1, StaticText2 } from "shared-runtime";
39
40 function MaybeMutable() {
41 - const $ = useMemoCache(1);
41 + const $ = _c(1);
42 let t0;
43 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
44 t0 = {};
@@ -52,7 +52,7 @@ function MaybeMutable() {
52 function maybeMutate(x) {}
53
54 function Component(props) {
55 - const $ = useMemoCache(11);
55 + const $ = _c(11);
56 let Tag;
57 let T0;
58 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-tag-evaluation-order.expect.md
+2 -2
@@ -25,11 +25,11 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 import { StaticText1, StaticText2 } from "shared-runtime";
30
31 function Component(props) {
32 - const $ = useMemoCache(3);
32 + const $ = _c(3);
33
34 const t0 = props.value;
35 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-ternary-local-variable.expect.md
+2 -2
@@ -20,11 +20,11 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 import { RenderPropAsChild, StaticText1, StaticText2 } from "shared-runtime";
25
26 function Component(props) {
27 - const $ = useMemoCache(2);
27 + const $ = _c(2);
28 const Foo = props.showText1 ? StaticText1 : StaticText2;
29 let t0;
30 if ($[0] !== Foo) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/labeled-break-within-label-loop.expect.md
+2 -2
@@ -27,9 +27,9 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 function useHook(end) {
32 - const $ = useMemoCache(2);
32 + const $ = _c(2);
33 let log;
34 if ($[0] !== end) {
35 log = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/labeled-break-within-label-switch.expect.md
+2 -2
@@ -30,11 +30,11 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react/compiler-runtime";
33 +import { c as _c } from "react/compiler-runtime";
34 import { CONST_STRING0 } from "shared-runtime";
35
36 function useHook(cond) {
37 - const $ = useMemoCache(2);
37 + const $ = _c(2);
38 let log;
39 if ($[0] !== cond) {
40 log = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-array-access-member-expr-captured.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import { CONST_NUMBER0, invoke } from "shared-runtime";
29
30 function Foo() {
31 - const $ = useMemoCache(1);
31 + const $ = _c(1);
32 let t0;
33 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
34 const x = [{ value: 0 }, { value: 1 }, { value: 2 }];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-array-access-member-expr-param.expect.md
+2 -2
@@ -23,11 +23,11 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import { invoke } from "shared-runtime";
28
29 function Foo() {
30 - const $ = useMemoCache(1);
30 + const $ = _c(1);
31 let t0;
32 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
33 const x = [{ value: 0 }, { value: 1 }, { value: 2 }];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-capture-returned-alias.expect.md
+2 -2
@@ -26,14 +26,14 @@ function CaptureNotMutate(props) {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react/compiler-runtime"; // Here, element should not be memoized independently of aliasedElement, since
29 +import { c as _c } from "react/compiler-runtime"; // Here, element should not be memoized independently of aliasedElement, since
30 // it is captured by fn.
31 // AnalyzeFunctions currently does not find captured objects.
32 // - mutated context refs are declared as `Capture` effect in `FunctionExpression.deps`
33 // - all other context refs are left as Unknown. InferReferenceEffects currently demotes
34 // them to reads
35 function CaptureNotMutate(props) {
36 - const $ = useMemoCache(5);
36 + const $ = _c(5);
37 let t0;
38 if ($[0] !== props.x) {
39 t0 = foo(props.x);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-mutate-shadowed-object.expect.md
+2 -2
@@ -19,9 +19,9 @@ function Component() {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function Component() {
24 - const $ = useMemoCache(1);
24 + const $ = _c(1);
25 let t0;
26 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
27 t0 = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-mutated-non-reactive-to-reactive.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function f(a) {
26 - const $ = useMemoCache(4);
26 + const $ = _c(4);
27 let x;
28 if ($[0] !== a) {
29 x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-mutated-ref-non-reactive.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function f(a) {
27 - const $ = useMemoCache(2);
27 + const $ = _c(2);
28 let x;
29 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
30 x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-reassign-primitive.expect.md
+2 -2
@@ -28,13 +28,13 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime"; // writing to primitives is not a 'mutate' or 'store' to context references,
31 +import { c as _c } from "react/compiler-runtime"; // writing to primitives is not a 'mutate' or 'store' to context references,
32 // under current analysis in AnalyzeFunctions.
33 // <unknown> $23:TFunction = Function @deps[<unknown>
34 // $21:TPrimitive,<unknown> $22:TPrimitive]:
35
36 function Component() {
37 - const $ = useMemoCache(1);
37 + const $ = _c(1);
38 let x;
39 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
40 x = 40;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-reassign-shadowed-primitive.expect.md
+2 -2
@@ -25,9 +25,9 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 function Component() {
30 - const $ = useMemoCache(1);
30 + const $ = _c(1);
31 let t0;
32 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
33 t0 = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/logical-expression-object.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function component(props) {
29 - const $ = useMemoCache(3);
29 + const $ = _c(3);
30
31 const a = props.a || (props.b && props.c && props.d);
32 const b = (props.a && props.b && props.c) || props.d;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/maybe-mutate-object-in-callback.expect.md
+2 -2
@@ -28,11 +28,11 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime";
31 +import { c as _c } from "react/compiler-runtime";
32 const { mutate } = require("shared-runtime");
33
34 function Component(props) {
35 - const $ = useMemoCache(4);
35 + const $ = _c(4);
36 let t0;
37 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
38 t0 = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mege-consecutive-scopes-dont-merge-with-different-deps.expect.md
+2 -2
@@ -20,11 +20,11 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 const { getNumber, identity } = require("shared-runtime");
25
26 function Component(props) {
27 - const $ = useMemoCache(6);
27 + const $ = _c(6);
28 let t0;
29 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
30 t0 = getNumber();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/memoization-comments.expect.md
+2 -2
@@ -22,11 +22,11 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableMemoizationComments
25 +import { c as _c } from "react/compiler-runtime"; // @enableMemoizationComments
26 import { addOne, getNumber, identity } from "shared-runtime";
27
28 function Component(props) {
29 - const $ = useMemoCache(9);
29 + const $ = _c(9);
30 let t0;
31 let x; // "useMemo" for t0 and x:
32 // check if props.a changed
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/memoize-value-block-value-conditional.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Foo(props) {
23 - const $ = useMemoCache(1);
23 + const $ = _c(1);
24 let x;
25 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
26 true ? (x = []) : (x = {});
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/memoize-value-block-value-logical-no-sequence.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Foo(props) {
23 - const $ = useMemoCache(1);
23 + const $ = _c(1);
24 let x;
25 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
26 true && (x = []);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/memoize-value-block-value-logical.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Foo(props) {
23 - const $ = useMemoCache(1);
23 + const $ = _c(1);
24 let x;
25 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
26 true && ((x = []), null);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/memoize-value-block-value-sequence.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Foo(props) {
23 - const $ = useMemoCache(1);
23 + const $ = _c(1);
24 let x;
25 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
26 (x = []), null;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/merge-consecutive-nested-scopes.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 const { getNumber } = require("shared-runtime");
29
30 function Component(props) {
31 - const $ = useMemoCache(1);
31 + const $ = _c(1);
32 let x;
33 if (props.cond) {
34 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/merge-consecutive-scopes-no-deps.expect.md
+2 -2
@@ -20,11 +20,11 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 const { getNumber } = require("shared-runtime");
25
26 function Component(props) {
27 - const $ = useMemoCache(1);
27 + const $ = _c(1);
28 let t0;
29 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
30 t0 = { session_id: getNumber() };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/merge-consecutive-scopes-objects.expect.md
+2 -2
@@ -35,7 +35,7 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react/compiler-runtime";
38 +import { c as _c } from "react/compiler-runtime";
39 import { useState } from "react";
40 import { Stringify } from "shared-runtime";
41
@@ -44,7 +44,7 @@ import { Stringify } from "shared-runtime";
44 // prevent scome scopes from merging, which concealed a bug with the merging logic.
45 // By avoiding JSX we eliminate extraneous instructions and more accurately test the merging.
46 function Component(props) {
47 - const $ = useMemoCache(11);
47 + const $ = _c(11);
48 const [state, setState] = useState(0);
49 let t0;
50 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/merge-consecutive-scopes.expect.md
+2 -2
@@ -28,12 +28,12 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime";
31 +import { c as _c } from "react/compiler-runtime";
32 import { useState } from "react";
33 import { Stringify } from "shared-runtime";
34
35 function Component() {
36 - const $ = useMemoCache(8);
36 + const $ = _c(8);
37 const [state, setState] = useState(0);
38 let t0;
39 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/merge-nested-scopes-with-same-inputs.expect.md
+2 -2
@@ -30,11 +30,11 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react/compiler-runtime";
33 +import { c as _c } from "react/compiler-runtime";
34 import { setProperty } from "shared-runtime";
35
36 function Component(props) {
37 - const $ = useMemoCache(2);
37 + const $ = _c(2);
38 let y;
39 if ($[0] !== props.a) {
40 y = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/merged-scopes-are-valid-effect-deps.expect.md
+2 -2
@@ -27,12 +27,12 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime"; // @validateMemoizedEffectDependencies
30 +import { c as _c } from "react/compiler-runtime"; // @validateMemoizedEffectDependencies
31
32 import { useEffect } from "react";
33
34 function Component(props) {
35 - const $ = useMemoCache(5);
35 + const $ = _c(5);
36 let t0;
37 if ($[0] !== props.value) {
38 t0 = [[props.value]];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/method-call-computed.expect.md
+2 -2
@@ -21,9 +21,9 @@ function foo(a, b, c) {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function foo(a, b, c) {
26 - const $ = useMemoCache(8);
26 + const $ = _c(8);
27 let t0;
28 if ($[0] !== a) {
29 t0 = makeObject(a);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/method-call-fn-call.expect.md
+2 -2
@@ -18,9 +18,9 @@ function foo(a, b, c) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function foo(a, b, c) {
23 - const $ = useMemoCache(6);
23 + const $ = _c(6);
24 let t0;
25 if ($[0] !== a) {
26 t0 = makeObject(a);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/method-call.expect.md
+2 -2
@@ -25,11 +25,11 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 import { addOne, shallowCopy } from "shared-runtime";
30
31 function foo(a, b, c) {
32 - const $ = useMemoCache(5);
32 + const $ = _c(5);
33 let t0;
34 if ($[0] !== a) {
35 t0 = shallowCopy(a);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/multi-arrow-expr-export-default-gating-test.expect.md
+3 -3
@@ -18,10 +18,10 @@ export default Renderer = (props) => (
18
19 ```javascript
20 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
21 -import { c as useMemoCache } from "react/compiler-runtime"; // @gating
21 +import { c as _c } from "react/compiler-runtime"; // @gating
22 const ErrorView = isForgetEnabled_Fixtures()
23 ? (error, _retry) => {
24 - const $ = useMemoCache(2);
24 + const $ = _c(2);
25 let t0;
26 if ($[0] !== error) {
27 t0 = <MessageBox error={error} />;
@@ -36,7 +36,7 @@ const ErrorView = isForgetEnabled_Fixtures()
36
37 export default Renderer = isForgetEnabled_Fixtures()
38 ? (props) => {
39 - const $ = useMemoCache(2);
39 + const $ = _c(2);
40 let t0;
41 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
42 t0 = <Bar />;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/multi-arrow-expr-export-gating-test.expect.md
+3 -3
@@ -18,10 +18,10 @@ export const Renderer = (props) => (
18
19 ```javascript
20 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
21 -import { c as useMemoCache } from "react/compiler-runtime"; // @gating
21 +import { c as _c } from "react/compiler-runtime"; // @gating
22 const ErrorView = isForgetEnabled_Fixtures()
23 ? (error, _retry) => {
24 - const $ = useMemoCache(2);
24 + const $ = _c(2);
25 let t0;
26 if ($[0] !== error) {
27 t0 = <MessageBox error={error} />;
@@ -36,7 +36,7 @@ const ErrorView = isForgetEnabled_Fixtures()
36
37 export const Renderer = isForgetEnabled_Fixtures()
38 ? (props) => {
39 - const $ = useMemoCache(2);
39 + const $ = _c(2);
40 let t0;
41 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
42 t0 = <Bar />;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/multi-arrow-expr-gating-test.expect.md
+3 -3
@@ -20,10 +20,10 @@ export default Renderer;
20
21 ```javascript
22 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
23 -import { c as useMemoCache } from "react/compiler-runtime"; // @gating
23 +import { c as _c } from "react/compiler-runtime"; // @gating
24 const ErrorView = isForgetEnabled_Fixtures()
25 ? (error, _retry) => {
26 - const $ = useMemoCache(2);
26 + const $ = _c(2);
27 let t0;
28 if ($[0] !== error) {
29 t0 = <MessageBox error={error} />;
@@ -38,7 +38,7 @@ const ErrorView = isForgetEnabled_Fixtures()
38
39 const Renderer = isForgetEnabled_Fixtures()
40 ? (props) => {
41 - const $ = useMemoCache(2);
41 + const $ = _c(2);
42 let t0;
43 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
44 t0 = <Bar />;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/multi-directive.expect.md
+2 -2
@@ -19,11 +19,11 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function Component() {
24 "use foo";
25 "use bar";
26 - const $ = useMemoCache(1);
26 + const $ = _c(1);
27 let t0;
28 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
29 t0 = <div>"foo"</div>;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/multiple-calls-to-hoisted-callback-from-other-callback.expect.md
+2 -2
@@ -34,11 +34,11 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react/compiler-runtime";
37 +import { c as _c } from "react/compiler-runtime";
38 import { useState } from "react";
39
40 function Component(props) {
41 - const $ = useMemoCache(1);
41 + const $ = _c(1);
42 const [_state, setState] = useState();
43 let t0;
44 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutable-lifetime-loops.expect.md
+2 -2
@@ -60,7 +60,7 @@ export const FIXTURE_ENTRYPOINT = {
60 ## Code
61
62 ```javascript
63 -import { c as useMemoCache } from "react/compiler-runtime";
63 +import { c as _c } from "react/compiler-runtime";
64 function mutate(x, y) {
65 "use no forget";
66 if (x != null) {
@@ -76,7 +76,7 @@ function cond(x) {
76 }
77
78 function testFunction(props) {
79 - const $ = useMemoCache(1);
79 + const $ = _c(1);
80 let t0;
81 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
82 let a = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutable-lifetime-with-aliasing.expect.md
+2 -2
@@ -54,7 +54,7 @@ export const FIXTURE_ENTRYPOINT = {
54 ## Code
55
56 ```javascript
57 -import { c as useMemoCache } from "react/compiler-runtime";
57 +import { c as _c } from "react/compiler-runtime";
58 function mutate(x, y) {
59 "use no forget";
60 if (!Array.isArray(x.value)) {
@@ -67,7 +67,7 @@ function mutate(x, y) {
67 }
68
69 function Component(props) {
70 - const $ = useMemoCache(1);
70 + const $ = _c(1);
71 let x;
72 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
73 const a = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutate-outer-scope-within-value-block.expect.md
+2 -2
@@ -42,7 +42,7 @@ export const FIXTURE_ENTRYPOINT = {
42 ## Code
43
44 ```javascript
45 -import { c as useMemoCache } from "react/compiler-runtime";
45 +import { c as _c } from "react/compiler-runtime";
46 import { CONST_TRUE, identity, shallowCopy } from "shared-runtime";
47
48 /**
@@ -67,7 +67,7 @@ import { CONST_TRUE, identity, shallowCopy } from "shared-runtime";
67 * should be merged.
68 */
69 function useFoo(t0) {
70 - const $ = useMemoCache(2);
70 + const $ = _c(2);
71 const { input } = t0;
72 let t1;
73 if ($[0] !== input) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutation-during-jsx-construction.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import { identity, mutate, mutateAndReturnNewValue } from "shared-runtime";
29
30 function Component(props) {
31 - const $ = useMemoCache(2);
31 + const $ = _c(2);
32 let element;
33 if ($[0] !== props.value) {
34 const key = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutation-within-capture-and-mutablerange.expect.md
+2 -2
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react/compiler-runtime";
40 +import { c as _c } from "react/compiler-runtime";
41 import { mutate } from "shared-runtime";
42
43 /**
@@ -51,7 +51,7 @@ import { mutate } from "shared-runtime";
51 * values in a subsequent render.
52 */
53 function useFoo(t0) {
54 - const $ = useMemoCache(3);
54 + const $ = _c(3);
55 const { a, b } = t0;
56 let z;
57 if ($[0] !== a || $[1] !== b) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutation-within-jsx-and-break.expect.md
+2 -2
@@ -40,7 +40,7 @@ export const FIXTURE_ENTRYPOINT = {
40 ## Code
41
42 ```javascript
43 -import { c as useMemoCache } from "react/compiler-runtime";
43 +import { c as _c } from "react/compiler-runtime";
44 import {
45 Stringify,
46 makeObject_Primitives,
@@ -49,7 +49,7 @@ import {
49 } from "shared-runtime";
50
51 function useFoo(t0) {
52 - const $ = useMemoCache(3);
52 + const $ = _c(3);
53 const { data } = t0;
54 let obj;
55 let myDiv = null;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutation-within-jsx.expect.md
+2 -2
@@ -60,7 +60,7 @@ export const FIXTURE_ENTRYPOINT = {
60 ## Code
61
62 ```javascript
63 -import { c as useMemoCache } from "react/compiler-runtime";
63 +import { c as _c } from "react/compiler-runtime";
64 import {
65 Stringify,
66 makeObject_Primitives,
@@ -94,7 +94,7 @@ import {
94 * than `obj` (e.g. the invariant `myDiv.props.value === obj` always holds).
95 */
96 function useFoo(t0) {
97 - const $ = useMemoCache(3);
97 + const $ = _c(3);
98 const { data } = t0;
99 let obj;
100 let myDiv = null;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/nested-function-shadowed-identifiers.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function Component(props) {
29 - const $ = useMemoCache(3);
29 + const $ = _c(3);
30 const [x, setX] = useState(null);
31 let t0;
32 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/nested-function-with-param-as-captured-dep.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function Foo() {
27 - const $ = useMemoCache(1);
27 + const $ = _c(1);
28 let t0;
29 let t1;
30 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/nested-optional-member-expr.expect.md
+2 -2
@@ -14,10 +14,10 @@ function Component(props) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react/compiler-runtime"; // We should codegen nested optional properties correctly
17 +import { c as _c } from "react/compiler-runtime"; // We should codegen nested optional properties correctly
18 // (i.e. placing `?` in the correct PropertyLoad)
19 function Component(props) {
20 - const $ = useMemoCache(2);
20 + const $ = _c(2);
21 const t0 = props.a?.b.c.d;
22 let t1;
23 if ($[0] !== t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/nested-scopes-begin-same-instr-valueblock.expect.md
+2 -2
@@ -27,11 +27,11 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 import { identity, mutate } from "shared-runtime";
32
33 function Foo(t0) {
34 - const $ = useMemoCache(2);
34 + const $ = _c(2);
35 const { cond } = t0;
36 let x;
37 if ($[0] !== cond) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-does-not-mutate-class.expect.md
+2 -2
@@ -23,12 +23,12 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import { identity } from "shared-runtime";
28
29 class Foo {}
30 function Component(t0) {
31 - const $ = useMemoCache(6);
31 + const $ = _c(6);
32 const { val } = t0;
33 let t1;
34 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-spread.expect.md
+2 -2
@@ -12,9 +12,9 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime";
15 +import { c as _c } from "react/compiler-runtime";
16 function Component(props) {
17 - const $ = useMemoCache(3);
17 + const $ = _c(3);
18 let t0;
19 if ($[0] !== props.bar || $[1] !== props.foo) {
20 t0 = new Foo(...props.foo, null, ...[props.bar]);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/noAlias-filter-on-array-prop.expect.md
+2 -2
@@ -31,9 +31,9 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react/compiler-runtime";
34 +import { c as _c } from "react/compiler-runtime";
35 function Component(props) {
36 - const $ = useMemoCache(3);
36 + const $ = _c(3);
37 let t0;
38 if ($[0] !== props.items) {
39 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/nonmutating-capture-in-unsplittable-memo-block.expect.md
+2 -2
@@ -49,7 +49,7 @@ export const FIXTURE_ENTRYPOINT = {
49 ## Code
50
51 ```javascript
52 -import { c as useMemoCache } from "react/compiler-runtime";
52 +import { c as _c } from "react/compiler-runtime";
53 import { identity, mutate } from "shared-runtime";
54
55 /**
@@ -71,7 +71,7 @@ import { identity, mutate } from "shared-runtime";
71 *
72 */
73 function useFoo(t0) {
74 - const $ = useMemoCache(4);
74 + const $ = _c(4);
75 const { a, b } = t0;
76 let z;
77 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/obj-literal-cached-in-if-else.expect.md
+2 -2
@@ -18,9 +18,9 @@ function foo(a, b, c, d) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function foo(a, b, c, d) {
23 - const $ = useMemoCache(4);
23 + const $ = _c(4);
24 let x;
25 if (someVal) {
26 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/obj-literal-mutated-after-if-else.expect.md
+2 -2
@@ -19,9 +19,9 @@ function foo(a, b, c, d) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function foo(a, b, c, d) {
24 - const $ = useMemoCache(3);
24 + const $ = _c(3);
25 let x;
26 if ($[0] !== b || $[1] !== c) {
27 if (someVal) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/obj-mutated-after-if-else-with-alias.expect.md
+2 -2
@@ -21,9 +21,9 @@ function foo(a, b, c, d) {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function foo(a, b, c, d) {
26 - const $ = useMemoCache(2);
26 + const $ = _c(2);
27 someObj();
28 let x;
29 if ($[0] !== a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/obj-mutated-after-if-else.expect.md
+2 -2
@@ -19,9 +19,9 @@ function foo(a, b, c, d) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function foo(a, b, c, d) {
24 - const $ = useMemoCache(2);
24 + const $ = _c(2);
25 someObj();
26 let x;
27 if ($[0] !== a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/obj-mutated-after-nested-if-else-with-alias.expect.md
+2 -2
@@ -27,9 +27,9 @@ function foo(a, b, c, d) {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 function foo(a, b, c, d) {
32 - const $ = useMemoCache(3);
32 + const $ = _c(3);
33 someObj();
34 let x;
35 if ($[0] !== a || $[1] !== b) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-expression-computed-key-constant-number.expect.md
+2 -2
@@ -22,11 +22,11 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 import { identity } from "shared-runtime";
27
28 function Component(props) {
29 - const $ = useMemoCache(4);
29 + const $ = _c(4);
30 let t0;
31 if ($[0] !== props.value) {
32 t0 = identity([props.value]);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-expression-computed-key-constant-string.expect.md
+2 -2
@@ -22,11 +22,11 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 import { identity } from "shared-runtime";
27
28 function Component(props) {
29 - const $ = useMemoCache(4);
29 + const $ = _c(4);
30 let t0;
31 if ($[0] !== props.value) {
32 t0 = identity([props.value]);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-expression-computed-key-non-reactive.expect.md
+2 -2
@@ -24,13 +24,13 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import { identity } from "shared-runtime";
29
30 const SCALE = 2;
31
32 function Component(props) {
33 - const $ = useMemoCache(4);
33 + const $ = _c(4);
34 let t0;
35 if ($[0] !== props.value) {
36 t0 = identity([props.value]);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-expression-computed-key-object-mutated-later.expect.md
+2 -2
@@ -23,11 +23,11 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import { identity, mutate } from "shared-runtime";
28
29 function Component(props) {
30 - const $ = useMemoCache(5);
30 + const $ = _c(5);
31 let t0;
32 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
33 t0 = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-expression-computed-key.expect.md
+2 -2
@@ -24,13 +24,13 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import { identity } from "shared-runtime";
29
30 const SCALE = 2;
31
32 function Component(props) {
33 - const $ = useMemoCache(5);
33 + const $ = _c(5);
34 const { key } = props;
35 let t0;
36 if ($[0] !== props.value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-expression-string-literal-key.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Component(props) {
23 - const $ = useMemoCache(2);
23 + const $ = _c(2);
24 let t0;
25 if ($[0] !== props.foo) {
26 t0 = { foo: props.foo };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-literal-method-derived-in-ternary-consequent.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import { identity, createHookWrapper } from "shared-runtime";
29
30 function useHook(t0) {
31 - const $ = useMemoCache(3);
31 + const $ = _c(3);
32 const { isCond, value } = t0;
33 let t1;
34 if ($[0] !== isCond || $[1] !== value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-literal-method-in-ternary-consequent.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import { createHookWrapper } from "shared-runtime";
29
30 function useHook(t0) {
31 - const $ = useMemoCache(3);
31 + const $ = _c(3);
32 const { isCond, value } = t0;
33 let t1;
34 if ($[0] !== isCond || $[1] !== value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-literal-spread-element.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Component(props) {
23 - const $ = useMemoCache(2);
23 + const $ = _c(2);
24 let t0;
25 if ($[0] !== props.foo) {
26 t0 = { ...props.foo };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-method-maybe-alias.expect.md
+2 -2
@@ -27,10 +27,10 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 import { createHookWrapper, setProperty } from "shared-runtime";
32 function useHook(props) {
33 - const $ = useMemoCache(2);
33 + const $ = _c(2);
34 let t0;
35 if ($[0] !== props) {
36 const x = {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-method-shorthand-3.expect.md
+2 -2
@@ -25,11 +25,11 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 import { createHookWrapper, mutate } from "shared-runtime";
30
31 function useHook(a) {
32 - const $ = useMemoCache(2);
32 + const $ = _c(2);
33 let t0;
34 if ($[0] !== a) {
35 const x = { a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-method-shorthand-aliased-mutate-after.expect.md
+2 -2
@@ -24,10 +24,10 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import { createHookWrapper, mutate, mutateAndReturn } from "shared-runtime";
29 function useHook(t0) {
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 const { value } = t0;
32 let obj;
33 if ($[0] !== value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-method-shorthand-derived-value.expect.md
+2 -2
@@ -23,10 +23,10 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import { createHookWrapper, mutateAndReturn } from "shared-runtime";
28 function useHook(t0) {
29 - const $ = useMemoCache(4);
29 + const $ = _c(4);
30 const { value } = t0;
31 let t1;
32 if ($[0] !== value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-method-shorthand-hook-dep.expect.md
+2 -2
@@ -23,11 +23,11 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import { createHookWrapper } from "shared-runtime";
28 import { useState } from "react";
29 function useFoo() {
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 const [state] = useState(false);
32 let t0;
33 if ($[0] !== state) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-method-shorthand-mutated-after.expect.md
+2 -2
@@ -24,10 +24,10 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import { createHookWrapper, mutate, mutateAndReturn } from "shared-runtime";
29 function useHook(t0) {
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 const { value } = t0;
32 let obj;
33 if ($[0] !== value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-method-shorthand.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function Component() {
26 - const $ = useMemoCache(1);
26 + const $ = _c(1);
27 let t0;
28 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
29 const obj = {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-mutated-in-consequent-alternate-both-return.expect.md
+2 -2
@@ -25,11 +25,11 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 import { makeObject_Primitives } from "shared-runtime";
30
31 function Component(props) {
32 - const $ = useMemoCache(2);
32 + const $ = _c(2);
33 let t0;
34 if ($[0] !== props) {
35 t0 = Symbol.for("react.early_return_sentinel");
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-pattern-params.expect.md
+2 -2
@@ -19,9 +19,9 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function component(t0) {
24 - const $ = useMemoCache(7);
24 + const $ = _c(7);
25 const { a, b } = t0;
26 let t1;
27 if ($[0] !== a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-shorthand-method-1.expect.md
+2 -2
@@ -24,10 +24,10 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import { createHookWrapper } from "shared-runtime";
29 function useHook(t0) {
30 - const $ = useMemoCache(5);
30 + const $ = _c(5);
31 const { a, b } = t0;
32 let t1;
33 if ($[0] !== a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-shorthand-method-2.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 import { createHookWrapper } from "shared-runtime";
29
30 function useHook(t0) {
31 - const $ = useMemoCache(8);
31 + const $ = _c(8);
32 const { a, b, c } = t0;
33 let t1;
34 if ($[0] !== a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-shorthand-method-nested.expect.md
+2 -2
@@ -31,12 +31,12 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react/compiler-runtime";
34 +import { c as _c } from "react/compiler-runtime";
35 import { useState } from "react";
36 import { createHookWrapper } from "shared-runtime";
37
38 function useHook(t0) {
39 - const $ = useMemoCache(3);
39 + const $ = _c(3);
40 const { value } = t0;
41 const [state] = useState(false);
42 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/option-enable-change-variable-codegen.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableChangeVariableCodegen
21 +import { c as _c } from "react/compiler-runtime"; // @enableChangeVariableCodegen
22 function Component(props) {
23 - const $ = useMemoCache(3);
23 + const $ = _c(3);
24 const c_00 = $[0] !== props.a;
25 const c_1 = $[1] !== props.b.c;
26 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-call-chained.expect.md
+2 -2
@@ -11,9 +11,9 @@ function Component(props) {
11 ## Code
12
13 ```javascript
14 -import { c as useMemoCache } from "react/compiler-runtime";
14 +import { c as _c } from "react/compiler-runtime";
15 function Component(props) {
16 - const $ = useMemoCache(2);
16 + const $ = _c(2);
17 let t0;
18 if ($[0] !== props) {
19 t0 = call?.(props.a)?.(props.b)?.(props.c);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-call-logical.expect.md
+2 -2
@@ -12,9 +12,9 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime";
15 +import { c as _c } from "react/compiler-runtime";
16 function Component(props) {
17 - const $ = useMemoCache(2);
17 + const $ = _c(2);
18 const item = useFragment(graphql`...`, props.item);
19 let t0;
20 if ($[0] !== item.items) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-call-simple.expect.md
+2 -2
@@ -11,9 +11,9 @@ function Component(props) {
11 ## Code
12
13 ```javascript
14 -import { c as useMemoCache } from "react/compiler-runtime";
14 +import { c as _c } from "react/compiler-runtime";
15 function Component(props) {
16 - const $ = useMemoCache(2);
16 + const $ = _c(2);
17 let t0;
18 if ($[0] !== props) {
19 t0 = foo?.(props);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-call-with-independently-memoizable-arg.expect.md
+2 -2
@@ -21,9 +21,9 @@ function Component(props) {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function Component(props) {
26 - const $ = useMemoCache(2);
26 + const $ = _c(2);
27 let t0;
28 if ($[0] !== props) {
29 const x = makeOptionalFunction(props);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-call-with-optional-property-load.expect.md
+2 -2
@@ -11,9 +11,9 @@ function Component(props) {
11 ## Code
12
13 ```javascript
14 -import { c as useMemoCache } from "react/compiler-runtime";
14 +import { c as _c } from "react/compiler-runtime";
15 function Component(props) {
16 - const $ = useMemoCache(2);
16 + const $ = _c(2);
17 let t0;
18 if ($[0] !== props) {
19 t0 = props?.items?.map?.(render)?.filter(Boolean) ?? [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-call.expect.md
+2 -2
@@ -14,9 +14,9 @@ function Component(props) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react/compiler-runtime";
17 +import { c as _c } from "react/compiler-runtime";
18 function Component(props) {
19 - const $ = useMemoCache(2);
19 + const $ = _c(2);
20 let t0;
21 if ($[0] !== props) {
22 const x = makeOptionalFunction(props);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-computed-member-expression.expect.md
+2 -2
@@ -12,9 +12,9 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime";
15 +import { c as _c } from "react/compiler-runtime";
16 function Component(props) {
17 - const $ = useMemoCache(2);
17 + const $ = _c(2);
18 let t0;
19 if ($[0] !== props) {
20 t0 = makeObject(props);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-member-expression-call-as-property.expect.md
+2 -2
@@ -12,9 +12,9 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime";
15 +import { c as _c } from "react/compiler-runtime";
16 function Component(props) {
17 - const $ = useMemoCache(3);
17 + const $ = _c(3);
18 let t0;
19 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
20 t0 = makeObject();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-member-expression-chain.expect.md
+2 -2
@@ -21,10 +21,10 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime"; // Note that `a?.b.c` is semantically different from `(a?.b).c`
24 +import { c as _c } from "react/compiler-runtime"; // Note that `a?.b.c` is semantically different from `(a?.b).c`
25 // We should codegen the correct member expressions
26 function Component(props) {
27 - const $ = useMemoCache(3);
27 + const $ = _c(3);
28 const x = props?.b.c;
29 const y = props?.b.c.d?.e.f.g?.h;
30 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-member-expression-with-optional-member-expr-as-property.expect.md
+2 -2
@@ -12,9 +12,9 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime";
15 +import { c as _c } from "react/compiler-runtime";
16 function Component(props) {
17 - const $ = useMemoCache(1);
17 + const $ = _c(1);
18 let t0;
19 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
20 t0 = makeObject();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-member-expression.expect.md
+2 -2
@@ -15,9 +15,9 @@ function Foo(props) {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react/compiler-runtime";
18 +import { c as _c } from "react/compiler-runtime";
19 function Foo(props) {
20 - const $ = useMemoCache(2);
20 + const $ = _c(2);
21 let t0;
22 if ($[0] !== props.a) {
23 t0 = bar(props.a);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-method-call.expect.md
+2 -2
@@ -14,9 +14,9 @@ function Component(props) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react/compiler-runtime";
17 +import { c as _c } from "react/compiler-runtime";
18 function Component(props) {
19 - const $ = useMemoCache(2);
19 + const $ = _c(2);
20 let t0;
21 if ($[0] !== props) {
22 const x = makeObject(props);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-receiver-method-call.expect.md
+2 -2
@@ -14,9 +14,9 @@ function Component(props) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react/compiler-runtime";
17 +import { c as _c } from "react/compiler-runtime";
18 function Component(props) {
19 - const $ = useMemoCache(2);
19 + const $ = _c(2);
20 let t0;
21 if ($[0] !== props) {
22 const x = makeOptionalObject(props);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-receiver-optional-method.expect.md
+2 -2
@@ -14,9 +14,9 @@ function Component(props) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react/compiler-runtime";
17 +import { c as _c } from "react/compiler-runtime";
18 function Component(props) {
19 - const $ = useMemoCache(2);
19 + const $ = _c(2);
20 let t0;
21 if ($[0] !== props) {
22 const x = makeOptionalObject(props);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/allocating-logical-expression-instruction-scope.expect.md
+2 -2
@@ -26,7 +26,7 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
29 +import { c as _c } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
30
31 /**
32 * This is a weird case as data has type `BuiltInMixedReadonly`.
@@ -36,7 +36,7 @@ import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveSc
36 import { useFragment } from "shared-runtime";
37
38 function Foo() {
39 - const $ = useMemoCache(2);
39 + const $ = _c(2);
40 const data = useFragment();
41 const t0 = data?.toString() || "";
42 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/bug-hoisted-declaration-with-scope.expect.md
+2 -2
@@ -46,7 +46,7 @@ export const FIXTURE_ENTRYPOINT = {
46 ## Code
47
48 ```javascript
49 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
49 +import { c as _c } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
50 import { StaticText1, Stringify, identity, useHook } from "shared-runtime";
51 /**
52 * `button` and `dispatcher` must end up in the same memo block. It would be
@@ -61,7 +61,7 @@ import { StaticText1, Stringify, identity, useHook } from "shared-runtime";
61 * (kind: exception) Cannot access 'dispatcher' before initialization
62 */
63 function useFoo(t0) {
64 - const $ = useMemoCache(3);
64 + const $ = _c(3);
65 const { onClose } = t0;
66 let t1;
67 if ($[0] !== onClose || $[1] !== dispatcher) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/bug-nonmutating-capture-in-unsplittable-memo-block.expect.md
+2 -2
@@ -60,7 +60,7 @@ export const FIXTURE_ENTRYPOINT = {
60 ## Code
61
62 ```javascript
63 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
63 +import { c as _c } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
64 import { identity, mutate } from "shared-runtime";
65
66 /**
@@ -92,7 +92,7 @@ import { identity, mutate } from "shared-runtime";
92 *
93 */
94 function useFoo(t0) {
95 - const $ = useMemoCache(6);
95 + const $ = _c(6);
96 const { a, b } = t0;
97 let z;
98 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/capture-ref-for-later-mutation.expect.md
+2 -2
@@ -32,12 +32,12 @@ export const FIXTURE_ENTRYPOINT = {
32 ## Code
33
34 ```javascript
35 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
35 +import { c as _c } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
36 import { useRef } from "react";
37 import { addOne } from "shared-runtime";
38
39 function useKeyCommand() {
40 - const $ = useMemoCache(7);
40 + const $ = _c(7);
41 const currentPosition = useRef(0);
42 const handleKey = (direction) => () => {
43 const position = currentPosition.current;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/invalid-align-scopes-within-nested-valueblock-in-array.expect.md
+2 -2
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
40 +import { c as _c } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
41
42 import { Stringify, identity, makeArray, mutate } from "shared-runtime";
43
@@ -52,7 +52,7 @@ import { Stringify, identity, makeArray, mutate } from "shared-runtime";
52 * handles this correctly.
53 */
54 function Foo(t0) {
55 - const $ = useMemoCache(4);
55 + const $ = _c(4);
56 const { cond1, cond2 } = t0;
57 const arr = makeArray({ a: 2 }, 2, []);
58 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/mutate-outer-scope-within-value-block.expect.md
+2 -2
@@ -43,7 +43,7 @@ export const FIXTURE_ENTRYPOINT = {
43 ## Code
44
45 ```javascript
46 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
46 +import { c as _c } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
47 import { CONST_TRUE, identity, shallowCopy } from "shared-runtime";
48
49 /**
@@ -68,7 +68,7 @@ import { CONST_TRUE, identity, shallowCopy } from "shared-runtime";
68 * should be merged.
69 */
70 function useFoo(t0) {
71 - const $ = useMemoCache(3);
71 + const $ = _c(3);
72 const { input } = t0;
73 const arr = shallowCopy(input);
74 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/mutation-within-capture-and-mutablerange.expect.md
+2 -2
@@ -38,7 +38,7 @@ export const FIXTURE_ENTRYPOINT = {
38 ## Code
39
40 ```javascript
41 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
41 +import { c as _c } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
42 import { mutate } from "shared-runtime";
43
44 /**
@@ -52,7 +52,7 @@ import { mutate } from "shared-runtime";
52 * values in a subsequent render.
53 */
54 function useFoo(t0) {
55 - const $ = useMemoCache(5);
55 + const $ = _c(5);
56 const { a, b } = t0;
57 let z;
58 if ($[0] !== a || $[1] !== b) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/mutation-within-jsx-and-break.expect.md
+2 -2
@@ -41,7 +41,7 @@ export const FIXTURE_ENTRYPOINT = {
41 ## Code
42
43 ```javascript
44 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
44 +import { c as _c } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
45 import {
46 Stringify,
47 makeObject_Primitives,
@@ -50,7 +50,7 @@ import {
50 } from "shared-runtime";
51
52 function useFoo(t0) {
53 - const $ = useMemoCache(5);
53 + const $ = _c(5);
54 const { data } = t0;
55 let obj;
56 let myDiv = null;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/mutation-within-jsx.expect.md
+2 -2
@@ -61,7 +61,7 @@ export const FIXTURE_ENTRYPOINT = {
61 ## Code
62
63 ```javascript
64 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
64 +import { c as _c } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
65 import {
66 Stringify,
67 makeObject_Primitives,
@@ -95,7 +95,7 @@ import {
95 * than `obj` (e.g. the invariant `myDiv.props.value === obj` always holds).
96 */
97 function useFoo(t0) {
98 - const $ = useMemoCache(5);
98 + const $ = _c(5);
99 const { data } = t0;
100 let obj;
101 let myDiv = null;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/repro-allocating-ternary-test-instruction-scope.expect.md
+2 -2
@@ -29,11 +29,11 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
32 +import { c as _c } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
33 import { identity, makeObject_Primitives } from "shared-runtime";
34
35 function useTest(t0) {
36 - const $ = useMemoCache(1);
36 + const $ = _c(1);
37 const { cond } = t0;
38 let t1;
39 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/overlapping-scopes-shadowing-within-block.expect.md
+2 -2
@@ -26,9 +26,9 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react/compiler-runtime";
29 +import { c as _c } from "react/compiler-runtime";
30 function foo(a, b, c) {
31 - const $ = useMemoCache(9);
31 + const $ = _c(9);
32 let x;
33 if ($[0] !== a || $[1] !== b || $[2] !== c) {
34 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/overlapping-scopes-within-block.expect.md
+2 -2
@@ -26,9 +26,9 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react/compiler-runtime";
29 +import { c as _c } from "react/compiler-runtime";
30 function foo(a, b, c) {
31 - const $ = useMemoCache(7);
31 + const $ = _c(7);
32 let x;
33 if ($[0] !== a || $[1] !== b || $[2] !== c) {
34 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/partial-early-return-within-reactive-scope.expect.md
+2 -2
@@ -28,9 +28,9 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime";
31 +import { c as _c } from "react/compiler-runtime";
32 function Component(props) {
33 - const $ = useMemoCache(4);
33 + const $ = _c(4);
34 let y;
35 let t0;
36 if ($[0] !== props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/phi-type-inference-array-push.expect.md
+2 -2
@@ -29,9 +29,9 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime";
32 +import { c as _c } from "react/compiler-runtime";
33 function Component(props) {
34 - const $ = useMemoCache(6);
34 + const $ = _c(6);
35 let x;
36 let y;
37 if ($[0] !== props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/phi-type-inference-property-store.expect.md
+2 -2
@@ -30,9 +30,9 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react/compiler-runtime"; // @debug
33 +import { c as _c } from "react/compiler-runtime"; // @debug
34 function Component(props) {
35 - const $ = useMemoCache(5);
35 + const $ = _c(5);
36 let t0;
37 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
38 t0 = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-jsxtext-stringliteral-distinction.expect.md
+2 -2
@@ -16,9 +16,9 @@ export const FIXTURE_ENTRYPOINT = {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function Foo() {
21 - const $ = useMemoCache(1);
21 + const $ = _c(1);
22 let t0;
23 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
24 t0 = <div> {", "}</div>;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/todo-ensure-constant-prop-decls-get-removed.expect.md
+2 -2
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
30 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
31
32 import { useMemo } from "react";
33
@@ -37,7 +37,7 @@ import { useMemo } from "react";
37 // Fix is to rewrite StartMemoize instructions to remove constant
38 // propagated values
39 function useFoo() {
40 - const $ = useMemoCache(1);
40 + const $ = _c(1);
41 const constVal = 0;
42 let t0;
43 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-alias-property-load-dep.expect.md
+2 -2
@@ -23,12 +23,12 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
26 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
27 import { useCallback } from "react";
28 import { sum } from "shared-runtime";
29
30 function Component(t0) {
31 - const $ = useMemoCache(3);
31 + const $ = _c(3);
32 const { propA, propB } = t0;
33 const x = propB.x.y;
34 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-captures-reassigned-context-property.expect.md
+2 -2
@@ -29,12 +29,12 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
32 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
33 import { useCallback } from "react";
34 import { Stringify } from "shared-runtime";
35
36 function Foo(props) {
37 - const $ = useMemoCache(6);
37 + const $ = _c(6);
38 let contextVar;
39 if ($[0] !== props.cond) {
40 if (props.cond) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-captures-reassigned-context.expect.md
+2 -2
@@ -27,14 +27,14 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
30 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
31
32 import { useCallback } from "react";
33 import { makeArray } from "shared-runtime";
34
35 // This case is fine, as all reassignments happen before the useCallback
36 function Foo(props) {
37 - const $ = useMemoCache(4);
37 + const $ = _c(4);
38 let x;
39 if ($[0] !== props) {
40 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-conditional-access-own-scope.expect.md
+2 -2
@@ -25,11 +25,11 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
28 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
29 import { useCallback } from "react";
30
31 function Component(t0) {
32 - const $ = useMemoCache(3);
32 + const $ = _c(3);
33 const { propA, propB } = t0;
34 let t1;
35 if ($[0] !== propA || $[1] !== propB.x.y) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-in-other-reactive-block.expect.md
+2 -2
@@ -30,14 +30,14 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
33 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
34 import { useCallback, useState } from "react";
35 import { arrayPush } from "shared-runtime";
36
37 // useCallback-produced values can exist in nested reactive blocks, as long
38 // as their reactive dependencies are a subset of depslist from source
39 function useFoo(minWidth, otherProp) {
40 - const $ = useMemoCache(11);
40 + const $ = _c(11);
41 const [width] = useState(1);
42 let style;
43 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-infer-conditional-value-block.expect.md
+2 -2
@@ -28,12 +28,12 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
31 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
32 import { useCallback } from "react";
33 import { identity, mutate } from "shared-runtime";
34
35 function useHook(propA, propB) {
36 - const $ = useMemoCache(3);
36 + const $ = _c(3);
37 let t0;
38 if ($[0] !== propA.a || $[1] !== propB.x.y) {
39 t0 = () => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-infer-fewer-deps.expect.md
+2 -2
@@ -21,13 +21,13 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
24 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
25
26 import { useCallback } from "react";
27
28 // It's correct to produce memo blocks with fewer deps than source
29 function useFoo(a, b) {
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 let t0;
32 if ($[0] !== a) {
33 t0 = () => [a];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-infer-more-specific.expect.md
+2 -2
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
28 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
29
30 import { useCallback } from "react";
31
@@ -35,7 +35,7 @@ import { useCallback } from "react";
35 // x_new != x_prev does NOT imply x.y.z_new != x.y.z_prev
36 // x.y.z_new != x.y.z_prev does imply x_new != x_prev
37 function useHook(x) {
38 - const $ = useMemoCache(2);
38 + const $ = _c(2);
39 let t0;
40 if ($[0] !== x.y.z) {
41 t0 = () => [x.y.z];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-infer-read-dep.expect.md
+2 -2
@@ -24,12 +24,12 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
27 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
28 import { useCallback } from "react";
29 import { sum } from "shared-runtime";
30
31 function useFoo() {
32 - const $ = useMemoCache(2);
32 + const $ = _c(2);
33 let t0;
34 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
35 t0 = [1, 2, 3];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-infer-scope-global.expect.md
+2 -2
@@ -22,14 +22,14 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
25 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
26
27 import { useCallback } from "react";
28 import { CONST_STRING0 } from "shared-runtime";
29
30 // It's correct to infer a useCallback block has no reactive dependencies
31 function useFoo() {
32 - const $ = useMemoCache(1);
32 + const $ = _c(1);
33 let t0;
34 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
35 t0 = () => [CONST_STRING0];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-nonescaping-invoked-callback-escaping-return.expect.md
+2 -2
@@ -36,11 +36,11 @@ export const FIXTURE_ENTRYPOINT = {
36 ## Code
37
38 ```javascript
39 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
39 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
40 import { useCallback } from "react";
41
42 function Component(t0) {
43 - const $ = useMemoCache(11);
43 + const $ = _c(11);
44 const { entity, children } = t0;
45 let t1;
46 if ($[0] !== entity) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-nonescaping.expect.md
+2 -2
@@ -33,11 +33,11 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
36 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
37 import { useCallback } from "react";
38
39 function Component(t0) {
40 - const $ = useMemoCache(2);
40 + const $ = _c(2);
41 const { entity, children } = t0;
42
43 const showMessage = () => entity != null;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-reordering-deplist-controlflow.expect.md
+2 -2
@@ -35,12 +35,12 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react/compiler-runtime";
38 +import { c as _c } from "react/compiler-runtime";
39 import { useCallback } from "react";
40 import { Stringify } from "shared-runtime";
41
42 function Foo(t0) {
43 - const $ = useMemoCache(11);
43 + const $ = _c(11);
44 const { arr1, arr2, foo } = t0;
45 let t1;
46 if ($[0] !== arr1) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-reordering-depslist-assignment.expect.md
+2 -2
@@ -30,13 +30,13 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react/compiler-runtime";
33 +import { c as _c } from "react/compiler-runtime";
34 import { useCallback } from "react";
35 import { Stringify } from "shared-runtime";
36
37 // We currently produce invalid output (incorrect scoping for `y` declaration)
38 function useFoo(arr1, arr2) {
39 - const $ = useMemoCache(7);
39 + const $ = _c(7);
40 let t0;
41 if ($[0] !== arr1) {
42 t0 = [arr1];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-with-no-depslist.expect.md
+2 -2
@@ -24,13 +24,13 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
27 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
28 import { useCallback } from "react";
29
30 // Compiler can produce any memoization it finds valid if the
31 // source listed no memo deps
32 function Component(t0) {
33 - const $ = useMemoCache(2);
33 + const $ = _c(2);
34 const { propA } = t0;
35 let t1;
36 if ($[0] !== propA) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-alias-property-load-dep.expect.md
+2 -2
@@ -23,12 +23,12 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
26 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
27 import { useMemo } from "react";
28 import { sum } from "shared-runtime";
29
30 function Component(t0) {
31 - const $ = useMemoCache(3);
31 + const $ = _c(3);
32 const { propA, propB } = t0;
33 const x = propB.x.y;
34 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-conditional-access-alloc.expect.md
+2 -2
@@ -25,12 +25,12 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
28 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
29 import { useMemo } from "react";
30 import { identity } from "shared-runtime";
31
32 function Component(t0) {
33 - const $ = useMemoCache(5);
33 + const $ = _c(5);
34 const { propA, propB } = t0;
35 let t1;
36
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-conditional-access-noAlloc.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
27 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
28 import { useMemo } from "react";
29
30 function Component(t0) {
31 - const $ = useMemoCache(3);
31 + const $ = _c(3);
32 const { propA, propB } = t0;
33 let t1;
34
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-conditional-access-own-scope.expect.md
+2 -2
@@ -25,11 +25,11 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
28 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
29 import { useMemo } from "react";
30
31 function Component(t0) {
32 - const $ = useMemoCache(2);
32 + const $ = _c(2);
33 const { propA, propB } = t0;
34 let t1;
35 bb0: {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-constant-prop.expect.md
+2 -2
@@ -29,12 +29,12 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
32 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
33 import { useMemo } from "react";
34 import { identity } from "shared-runtime";
35
36 function useFoo(cond) {
37 - const $ = useMemoCache(5);
37 + const $ = _c(5);
38 const sourceDep = 0;
39 let t0;
40 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-in-other-reactive-block.expect.md
+2 -2
@@ -30,14 +30,14 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
33 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
34 import { useMemo, useState } from "react";
35 import { arrayPush } from "shared-runtime";
36
37 // useMemo-produced values can exist in nested reactive blocks, as long
38 // as their reactive dependencies are a subset of depslist from source
39 function useFoo(minWidth, otherProp) {
40 - const $ = useMemoCache(10);
40 + const $ = _c(10);
41 const [width] = useState(1);
42 let style;
43 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-infer-fewer-deps.expect.md
+2 -2
@@ -21,13 +21,13 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
24 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
25
26 import { useMemo } from "react";
27
28 // It's correct to produce memo blocks with fewer deps than source
29 function useFoo(a, b) {
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 let t0;
32 let t1;
33 if ($[0] !== a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-infer-more-specific.expect.md
+2 -2
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
28 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
29
30 import { useMemo } from "react";
31
@@ -35,7 +35,7 @@ import { useMemo } from "react";
35 // x_new != x_prev does NOT imply x.y.z_new != x.y.z_prev
36 // x.y.z_new != x.y.z_prev does imply x_new != x_prev
37 function useHook(x) {
38 - const $ = useMemoCache(2);
38 + const $ = _c(2);
39 let t0;
40 let t1;
41 if ($[0] !== x.y.z) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-infer-nonallocating.expect.md
+2 -2
@@ -22,14 +22,14 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
25 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
26
27 import { useMemo } from "react";
28
29 // It's correct to infer a useMemo value is non-allocating
30 // and not provide it with a reactive scope
31 function useFoo(num1, num2) {
32 - const $ = useMemoCache(3);
32 + const $ = _c(3);
33 let t0;
34 let t1;
35 if ($[0] !== num1 || $[1] !== num2) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-infer-scope-global.expect.md
+2 -2
@@ -22,14 +22,14 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
25 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
26
27 import { useMemo } from "react";
28 import { CONST_STRING0 } from "shared-runtime";
29
30 // It's correct to infer a useMemo block has no reactive dependencies
31 function useFoo() {
32 - const $ = useMemoCache(1);
32 + const $ = _c(1);
33 let t0;
34 let t1;
35 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-inner-decl.expect.md
+2 -2
@@ -23,12 +23,12 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
26 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
27 import { useMemo } from "react";
28 import { identity } from "shared-runtime";
29
30 function useFoo(data) {
31 - const $ = useMemoCache(4);
31 + const $ = _c(4);
32 let t0;
33 let t1;
34 if ($[0] !== data.a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-invoke-prop.expect.md
+2 -2
@@ -27,12 +27,12 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
30 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
31
32 import { useMemo } from "react";
33
34 function useFoo(t0) {
35 - const $ = useMemoCache(2);
35 + const $ = _c(2);
36 const { callback } = t0;
37 let t1;
38 let t2;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-reordering-depslist-assignment.expect.md
+2 -2
@@ -26,11 +26,11 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react/compiler-runtime";
29 +import { c as _c } from "react/compiler-runtime";
30 import { useMemo } from "react";
31
32 function useFoo(arr1, arr2) {
33 - const $ = useMemoCache(7);
33 + const $ = _c(7);
34 let t0;
35 if ($[0] !== arr1) {
36 t0 = [arr1];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-reordering-depslist-controlflow.expect.md
+2 -2
@@ -35,12 +35,12 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react/compiler-runtime";
38 +import { c as _c } from "react/compiler-runtime";
39 import { useMemo } from "react";
40 import { Stringify } from "shared-runtime";
41
42 function Foo(t0) {
43 - const $ = useMemoCache(11);
43 + const $ = _c(11);
44 const { arr1, arr2, foo } = t0;
45 let t1;
46 if ($[0] !== arr1) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-with-no-depslist.expect.md
+2 -2
@@ -24,13 +24,13 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
27 +import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
28 import { useMemo } from "react";
29
30 // Compiler can produce any memoization it finds valid if the
31 // source listed no memo deps
32 function Component(t0) {
33 - const $ = useMemoCache(2);
33 + const $ = _c(2);
34 const { propA } = t0;
35 let t1;
36 let t2;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/primitive-as-dep-nested-scope.expect.md
+2 -2
@@ -20,13 +20,13 @@ function PrimitiveAsDepNested(props) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime"; // props.b + 1 is an non-allocating expression, which means Forget can
23 +import { c as _c } from "react/compiler-runtime"; // props.b + 1 is an non-allocating expression, which means Forget can
24 // emit it trivially and repeatedly (e.g. no need to memoize props.b + 1
25 // separately from props.b)
26 // Correctness:
27 // y depends on either props.b or props.b + 1
28 function PrimitiveAsDepNested(props) {
29 - const $ = useMemoCache(9);
29 + const $ = _c(9);
30 let x;
31 let y;
32 if ($[0] !== props.b || $[1] !== props.a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/primitive-as-dep.expect.md
+2 -2
@@ -17,13 +17,13 @@ function PrimitiveAsDep(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime"; // props.b + 1 is an non-allocating expression, which means Forget can
20 +import { c as _c } from "react/compiler-runtime"; // props.b + 1 is an non-allocating expression, which means Forget can
21 // emit it trivially and repeatedly (e.g. no need to memoize props.b + 1
22 // separately from props.b)
23 // Correctness:
24 // y depends on either props.b or props.b + 1
25 function PrimitiveAsDep(props) {
26 - const $ = useMemoCache(2);
26 + const $ = _c(2);
27 const t0 = props.b + 1;
28 let t1;
29 if ($[0] !== t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/prop-capturing-function-1.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function component(a, b) {
26 - const $ = useMemoCache(5);
26 + const $ = _c(5);
27 let t0;
28 if ($[0] !== a || $[1] !== b) {
29 t0 = { a, b };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/property-assignment.expect.md
+2 -2
@@ -16,9 +16,9 @@ function Component(props) {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function Component(props) {
21 - const $ = useMemoCache(6);
21 + const $ = _c(6);
22 let x;
23 let child;
24 if ($[0] !== props.p0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/property-call-evaluation-order.expect.md
+2 -2
@@ -27,10 +27,10 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime"; // Should print A, arg, original
30 +import { c as _c } from "react/compiler-runtime"; // Should print A, arg, original
31
32 function Component() {
33 - const $ = useMemoCache(2);
33 + const $ = _c(2);
34 let t0;
35 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
36 t0 = (o) => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/property-call-spread.expect.md
+2 -2
@@ -12,9 +12,9 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime";
15 +import { c as _c } from "react/compiler-runtime";
16 function Component(props) {
17 - const $ = useMemoCache(3);
17 + const $ = _c(3);
18 let t0;
19 if ($[0] !== props.a || $[1] !== props.b) {
20 t0 = foo.bar(...props.a, null, ...props.b);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/prune-scopes-whose-deps-invalidate-jsx.expect.md
+2 -2
@@ -25,11 +25,11 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 import { useHook } from "shared-runtime";
30
31 function Component(props) {
32 - const $ = useMemoCache(6);
32 + const $ = _c(6);
33 const o = {};
34 let t0;
35 if ($[0] !== props.value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/prune-scopes-whose-deps-may-invalidate-array.expect.md
+2 -2
@@ -27,11 +27,11 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 import { useHook, identity } from "shared-runtime";
32
33 function Component(props) {
34 - const $ = useMemoCache(4);
34 + const $ = _c(4);
35 let x = 42;
36 if (props.cond) {
37 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/react-namespace.expect.md
+2 -2
@@ -25,11 +25,11 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 const FooContext = React.createContext({ current: null });
30
31 function Component(props) {
32 - const $ = useMemoCache(6);
32 + const $ = _c(6);
33 React.useContext(FooContext);
34 const ref = React.useRef();
35 const [x, setX] = React.useState(false);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-indirect.expect.md
+2 -2
@@ -34,9 +34,9 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react/compiler-runtime";
37 +import { c as _c } from "react/compiler-runtime";
38 function Component(props) {
39 - const $ = useMemoCache(2);
39 + const $ = _c(2);
40 let x = 0;
41 let y = 0;
42 let z;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-test.expect.md
+2 -2
@@ -40,9 +40,9 @@ export const FIXTURE_ENTRYPOINT = {
40 ## Code
41
42 ```javascript
43 -import { c as useMemoCache } from "react/compiler-runtime";
43 +import { c as _c } from "react/compiler-runtime";
44 function Component(props) {
45 - const $ = useMemoCache(2);
45 + const $ = _c(2);
46 let x;
47 let i = 0;
48 do {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-for-init.expect.md
+2 -2
@@ -39,9 +39,9 @@ export const FIXTURE_ENTRYPOINT = {
39 ## Code
40
41 ```javascript
42 -import { c as useMemoCache } from "react/compiler-runtime";
42 +import { c as _c } from "react/compiler-runtime";
43 function Component(props) {
44 - const $ = useMemoCache(2);
44 + const $ = _c(2);
45 let x;
46 for (const i = props.init; i < 10; ) {
47 if (i === 0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-for-test.expect.md
+2 -2
@@ -38,9 +38,9 @@ export const FIXTURE_ENTRYPOINT = {
38 ## Code
39
40 ```javascript
41 -import { c as useMemoCache } from "react/compiler-runtime";
41 +import { c as _c } from "react/compiler-runtime";
42 function Component(props) {
43 - const $ = useMemoCache(2);
43 + const $ = _c(2);
44 let x;
45 for (let i = 0; i < props.test; i++) {
46 if (i > 10) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-for-update.expect.md
+2 -2
@@ -38,9 +38,9 @@ export const FIXTURE_ENTRYPOINT = {
38 ## Code
39
40 ```javascript
41 -import { c as useMemoCache } from "react/compiler-runtime";
41 +import { c as _c } from "react/compiler-runtime";
42 function Component(props) {
43 - const $ = useMemoCache(2);
43 + const $ = _c(2);
44 let x;
45 for (let i = 0; i < 10; i = i + props.update, i) {
46 if (i > 0 && i % 2 === 0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-forin-collection.expect.md
+2 -2
@@ -39,9 +39,9 @@ export const FIXTURE_ENTRYPOINT = {
39 ## Code
40
41 ```javascript
42 -import { c as useMemoCache } from "react/compiler-runtime";
42 +import { c as _c } from "react/compiler-runtime";
43 function Component(props) {
44 - const $ = useMemoCache(2);
44 + const $ = _c(2);
45 let x;
46 for (const key in props.values) {
47 const i = parseInt(key, 10);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-forof-collection.expect.md
+2 -2
@@ -38,9 +38,9 @@ export const FIXTURE_ENTRYPOINT = {
38 ## Code
39
40 ```javascript
41 -import { c as useMemoCache } from "react/compiler-runtime";
41 +import { c as _c } from "react/compiler-runtime";
42 function Component(props) {
43 - const $ = useMemoCache(2);
43 + const $ = _c(2);
44 let x;
45 for (const i of props.values) {
46 if (i > 10) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-do-while.expect.md
+2 -2
@@ -37,9 +37,9 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react/compiler-runtime";
40 +import { c as _c } from "react/compiler-runtime";
41 function Component(props) {
42 - const $ = useMemoCache(1);
42 + const $ = _c(1);
43
44 const a = [];
45 const b = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-for-in.expect.md
+2 -2
@@ -37,9 +37,9 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react/compiler-runtime";
40 +import { c as _c } from "react/compiler-runtime";
41 function Component(props) {
42 - const $ = useMemoCache(1);
42 + const $ = _c(1);
43
44 const a = [];
45 const b = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-for-init.expect.md
+2 -2
@@ -37,9 +37,9 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react/compiler-runtime";
40 +import { c as _c } from "react/compiler-runtime";
41 function Component(props) {
42 - const $ = useMemoCache(1);
42 + const $ = _c(1);
43
44 const a = [];
45 const b = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-for-of.expect.md
+2 -2
@@ -37,9 +37,9 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react/compiler-runtime";
40 +import { c as _c } from "react/compiler-runtime";
41 function Component(props) {
42 - const $ = useMemoCache(1);
42 + const $ = _c(1);
43
44 const a = [];
45 const b = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-for-test.expect.md
+2 -2
@@ -37,9 +37,9 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react/compiler-runtime";
40 +import { c as _c } from "react/compiler-runtime";
41 function Component(props) {
42 - const $ = useMemoCache(1);
42 + const $ = _c(1);
43
44 const a = [];
45 const b = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-for-update.expect.md
+2 -2
@@ -37,9 +37,9 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react/compiler-runtime";
40 +import { c as _c } from "react/compiler-runtime";
41 function Component(props) {
42 - const $ = useMemoCache(1);
42 + const $ = _c(1);
43
44 const a = [];
45 const b = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-if.expect.md
+2 -2
@@ -39,9 +39,9 @@ export const FIXTURE_ENTRYPOINT = {
39 ## Code
40
41 ```javascript
42 -import { c as useMemoCache } from "react/compiler-runtime";
42 +import { c as _c } from "react/compiler-runtime";
43 function Component(props) {
44 - const $ = useMemoCache(1);
44 + const $ = _c(1);
45
46 const a = [];
47 const b = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-switch.expect.md
+2 -2
@@ -43,9 +43,9 @@ export const FIXTURE_ENTRYPOINT = {
43 ## Code
44
45 ```javascript
46 -import { c as useMemoCache } from "react/compiler-runtime";
46 +import { c as _c } from "react/compiler-runtime";
47 function Component(props) {
48 - const $ = useMemoCache(1);
48 + const $ = _c(1);
49
50 const a = [];
51 const b = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-while.expect.md
+2 -2
@@ -37,9 +37,9 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react/compiler-runtime";
40 +import { c as _c } from "react/compiler-runtime";
41 function Component(props) {
42 - const $ = useMemoCache(1);
42 + const $ = _c(1);
43
44 const a = [];
45 const b = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-if.expect.md
+2 -2
@@ -35,9 +35,9 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react/compiler-runtime";
38 +import { c as _c } from "react/compiler-runtime";
39 function Component(props) {
40 - const $ = useMemoCache(2);
40 + const $ = _c(2);
41 let x;
42 if (props.cond) {
43 x = 1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-on-context-variable.expect.md
+2 -2
@@ -45,11 +45,11 @@ export const FIXTURE_ENTRYPOINT = {
45 ## Code
46
47 ```javascript
48 -import { c as useMemoCache } from "react/compiler-runtime";
48 +import { c as _c } from "react/compiler-runtime";
49 import { identity } from "shared-runtime";
50
51 function Component(props) {
52 - const $ = useMemoCache(4);
52 + const $ = _c(4);
53 let x;
54 if ($[0] !== props.cond) {
55 const f = () => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-phi-setState-type.expect.md
+2 -2
@@ -55,12 +55,12 @@ export const FIXTURE_ENTRYPOINT = {
55 ## Code
56
57 ```javascript
58 -import { c as useMemoCache } from "react/compiler-runtime";
58 +import { c as _c } from "react/compiler-runtime";
59 import invariant from "invariant";
60 import { useState } from "react";
61
62 function Component(props) {
63 - const $ = useMemoCache(5);
63 + const $ = _c(5);
64 const [x, setX] = useState(false);
65 const [y, setY] = useState(false);
66 let setState;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-reactive-after-fixpoint.expect.md
+2 -2
@@ -49,9 +49,9 @@ export const FIXTURE_ENTRYPOINT = {
49 ## Code
50
51 ```javascript
52 -import { c as useMemoCache } from "react/compiler-runtime";
52 +import { c as _c } from "react/compiler-runtime";
53 function Component(props) {
54 - const $ = useMemoCache(2);
54 + const $ = _c(2);
55 let x = 0;
56
57 let value = null;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-case-test.expect.md
+2 -2
@@ -43,9 +43,9 @@ export const FIXTURE_ENTRYPOINT = {
43 ## Code
44
45 ```javascript
46 -import { c as useMemoCache } from "react/compiler-runtime";
46 +import { c as _c } from "react/compiler-runtime";
47 function Component(props) {
48 - const $ = useMemoCache(2);
48 + const $ = _c(2);
49 let x;
50 bb0: switch (props.cond) {
51 case true: {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-condition.expect.md
+2 -2
@@ -41,11 +41,11 @@ export const FIXTURE_ENTRYPOINT = {
41 ## Code
42
43 ```javascript
44 -import { c as useMemoCache } from "react/compiler-runtime";
44 +import { c as _c } from "react/compiler-runtime";
45 const GLOBAL = 42;
46
47 function Component(t0) {
48 - const $ = useMemoCache(2);
48 + const $ = _c(2);
49 const { value } = t0;
50 let x;
51 bb0: switch (GLOBAL) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-if.expect.md
+2 -2
@@ -38,9 +38,9 @@ export const FIXTURE_ENTRYPOINT = {
38 ## Code
39
40 ```javascript
41 -import { c as useMemoCache } from "react/compiler-runtime";
41 +import { c as _c } from "react/compiler-runtime";
42 function Component(props) {
43 - const $ = useMemoCache(2);
43 + const $ = _c(2);
44
45 const x = [];
46 if (props.cond) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-switch.expect.md
+2 -2
@@ -41,9 +41,9 @@ export const FIXTURE_ENTRYPOINT = {
41 ## Code
42
43 ```javascript
44 -import { c as useMemoCache } from "react/compiler-runtime";
44 +import { c as _c } from "react/compiler-runtime";
45 function Component(props) {
46 - const $ = useMemoCache(2);
46 + const $ = _c(2);
47
48 const x = [];
49 if (props.cond) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-while-test.expect.md
+2 -2
@@ -40,9 +40,9 @@ export const FIXTURE_ENTRYPOINT = {
40 ## Code
41
42 ```javascript
43 -import { c as useMemoCache } from "react/compiler-runtime";
43 +import { c as _c } from "react/compiler-runtime";
44 function Component(props) {
45 - const $ = useMemoCache(2);
45 + const $ = _c(2);
46 let x;
47 let i = 0;
48 while (i < props.test) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-dependencies-non-optional-properties-inside-optional-chain.expect.md
+2 -2
@@ -11,9 +11,9 @@ function Component(props) {
11 ## Code
12
13 ```javascript
14 -import { c as useMemoCache } from "react/compiler-runtime";
14 +import { c as _c } from "react/compiler-runtime";
15 function Component(props) {
16 - const $ = useMemoCache(2);
16 + const $ = _c(2);
17 let t0;
18 if ($[0] !== props.post.feedback.comments) {
19 t0 = props.post.feedback.comments?.edges?.map(render);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-dependency-fixpoint.expect.md
+2 -2
@@ -28,9 +28,9 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime";
31 +import { c as _c } from "react/compiler-runtime";
32 function Component(props) {
33 - const $ = useMemoCache(2);
33 + const $ = _c(2);
34 let x = 0;
35 let y = 0;
36 while (x === 0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-dependency-nonreactive-captured-with-reactive.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Component(props) {
23 - const $ = useMemoCache(3);
23 + const $ = _c(3);
24 let t0;
25 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
26 t0 = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-dependency-object-captured-with-reactive-mutated.expect.md
+2 -2
@@ -23,11 +23,11 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 const { mutate } = require("shared-runtime");
28
29 function Component(props) {
30 - const $ = useMemoCache(4);
30 + const $ = _c(4);
31 let x;
32 if ($[0] !== props.y) {
33 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-scope-grouping.expect.md
+2 -2
@@ -23,9 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function foo() {
28 - const $ = useMemoCache(1);
28 + const $ = _c(1);
29 let x;
30 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
31 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-scopes-if.expect.md
+2 -2
@@ -25,9 +25,9 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 function foo(a, b, c) {
30 - const $ = useMemoCache(8);
30 + const $ = _c(8);
31 let x;
32 if ($[0] !== a || $[1] !== b || $[2] !== c) {
33 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-scopes.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function f(a, b) {
29 - const $ = useMemoCache(5);
29 + const $ = _c(5);
30 let x;
31 if ($[0] !== a.length || $[1] !== b) {
32 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactivity-analysis-interleaved-reactivity.expect.md
+2 -2
@@ -33,9 +33,9 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react/compiler-runtime";
36 +import { c as _c } from "react/compiler-runtime";
37 function Component(props) {
38 - const $ = useMemoCache(7);
38 + const $ = _c(7);
39 let a;
40 if ($[0] !== props.b) {
41 a = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactivity-analysis-reactive-via-mutation-of-computed-load.expect.md
+2 -2
@@ -16,9 +16,9 @@ function Component(props) {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function Component(props) {
21 - const $ = useMemoCache(8);
21 + const $ = _c(8);
22 let items;
23 if ($[0] !== props.key || $[1] !== props.a) {
24 items = bar();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactivity-analysis-reactive-via-mutation-of-property-load.expect.md
+2 -2
@@ -16,9 +16,9 @@ function Component(props) {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function Component(props) {
21 - const $ = useMemoCache(7);
21 + const $ = _c(7);
22 let items;
23 if ($[0] !== props.a) {
24 items = bar();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactivity-via-aliased-mutation-array.expect.md
+2 -2
@@ -30,9 +30,9 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react/compiler-runtime";
33 +import { c as _c } from "react/compiler-runtime";
34 function Component(props) {
35 - const $ = useMemoCache(4);
35 + const $ = _c(4);
36 let x;
37 if ($[0] !== props.input) {
38 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactivity-via-aliased-mutation-lambda.expect.md
+2 -2
@@ -33,9 +33,9 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react/compiler-runtime";
36 +import { c as _c } from "react/compiler-runtime";
37 function Component(props) {
38 - const $ = useMemoCache(4);
38 + const $ = _c(4);
39 let x;
40 if ($[0] !== props.input) {
41 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactivity-via-aliased-mutation-through-property-load.expect.md
+2 -2
@@ -36,9 +36,9 @@ export const FIXTURE_ENTRYPOINT = {
36 ## Code
37
38 ```javascript
39 -import { c as useMemoCache } from "react/compiler-runtime";
39 +import { c as _c } from "react/compiler-runtime";
40 function Component(props) {
41 - const $ = useMemoCache(2);
41 + const $ = _c(2);
42 const x = {};
43 const y = [];
44 x.y = y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactivity-via-readonly-alias-of-mutable-value.expect.md
+2 -2
@@ -45,9 +45,9 @@ export const FIXTURE_ENTRYPOINT = {
45 ## Code
46
47 ```javascript
48 -import { c as useMemoCache } from "react/compiler-runtime";
48 +import { c as _c } from "react/compiler-runtime";
49 function Component(props) {
50 - const $ = useMemoCache(2);
50 + const $ = _c(2);
51 const x = [];
52 const y = x;
53
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/readonly-object-method-calls-mutable-lambda.expect.md
+2 -2
@@ -23,9 +23,9 @@ function Component(props) {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function Component(props) {
28 - const $ = useMemoCache(3);
28 + const $ = _c(3);
29 const x = makeObject();
30 const user = useFragment(
31 graphql`fragment Component_user on User { ... }`,
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/readonly-object-method-calls.expect.md
+2 -2
@@ -21,9 +21,9 @@ function Component(props) {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function Component(props) {
26 - const $ = useMemoCache(5);
26 + const $ = _c(5);
27 const user = useFragment(
28 graphql`fragment Component_user on User { ... }`,
29 props.user
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reanimated-no-memo-arg.expect.md
+2 -2
@@ -37,9 +37,9 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableCustomTypeDefinitionForReanimated
40 +import { c as _c } from "react/compiler-runtime"; // @enableCustomTypeDefinitionForReanimated
41 function Component() {
42 - const $ = useMemoCache(2);
42 + const $ = _c(2);
43 const radius = useSharedValue(50);
44
45 const animatedProps = useAnimatedProps(() => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassign-in-while-loop-condition.expect.md
+2 -2
@@ -25,12 +25,12 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 import { makeArray } from "shared-runtime";
30
31 // @flow
32 function Component() {
33 - const $ = useMemoCache(1);
33 + const $ = _c(1);
34 let t0;
35 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
36 const items = makeArray(0, 1, 2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassign-object-in-context.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function Component(props) {
26 - const $ = useMemoCache(1);
26 + const $ = _c(1);
27 let x;
28 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
29 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassign-primitive-in-context.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function Component(props) {
26 - const $ = useMemoCache(1);
26 + const $ = _c(1);
27 let x;
28 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
29 x = 5;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassigned-phi-in-returned-function-expression.expect.md
+2 -2
@@ -19,9 +19,9 @@ function Component(props) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function Component(props) {
24 - const $ = useMemoCache(2);
24 + const $ = _c(2);
25 let t0;
26 if ($[0] !== props.str) {
27 t0 = () => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassignment-conditional.expect.md
+2 -2
@@ -21,9 +21,9 @@ function Component(props) {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function Component(props) {
26 - const $ = useMemoCache(9);
26 + const $ = _c(9);
27 let x;
28 let y;
29 if ($[0] !== props.p0 || $[1] !== props.p1 || $[2] !== props.p2) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassignment-separate-scopes.expect.md
+2 -2
@@ -39,9 +39,9 @@ export const FIXTURE_ENTRYPOINT = {
39 ## Code
40
41 ```javascript
42 -import { c as useMemoCache } from "react/compiler-runtime";
42 +import { c as _c } from "react/compiler-runtime";
43 function foo(a, b, c) {
44 - const $ = useMemoCache(11);
44 + const $ = _c(11);
45 let x;
46 if ($[0] !== a) {
47 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassignment.expect.md
+2 -2
@@ -20,9 +20,9 @@ function Component(props) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function Component(props) {
25 - const $ = useMemoCache(8);
25 + const $ = _c(8);
26 let x;
27 let y;
28 if ($[0] !== props.p0 || $[1] !== props.p1) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-cond-deps-break-in-scope.expect.md
+2 -2
@@ -29,9 +29,9 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime";
32 +import { c as _c } from "react/compiler-runtime";
33 function useFoo(t0) {
34 - const $ = useMemoCache(3);
34 + const $ = _c(3);
35 const { obj, objIsNull } = t0;
36 let x;
37 if ($[0] !== objIsNull || $[1] !== obj) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-cond-deps-cfg-nested-testifelse.expect.md
+2 -2
@@ -34,11 +34,11 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react/compiler-runtime";
37 +import { c as _c } from "react/compiler-runtime";
38 import { setProperty } from "shared-runtime";
39
40 function useFoo(t0) {
41 - const $ = useMemoCache(3);
41 + const $ = _c(3);
42 const { o, branchCheck } = t0;
43 let x;
44 if ($[0] !== branchCheck || $[1] !== o.value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-cond-deps-return-in-scope.expect.md
+2 -2
@@ -27,9 +27,9 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 function useFoo(t0) {
32 - const $ = useMemoCache(4);
32 + const $ = _c(4);
33 const { obj, objIsNull } = t0;
34 let x;
35 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cfg-condexpr.expect.md
+2 -2
@@ -23,14 +23,14 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime"; // props.a.b should be added as a unconditional dependency to the reactive
26 +import { c as _c } from "react/compiler-runtime"; // props.a.b should be added as a unconditional dependency to the reactive
27 // scope that produces x, since it is accessed unconditionally in all cfg
28 // paths
29
30 import { identity, addOne } from "shared-runtime";
31
32 function useCondDepInConditionalExpr(props, cond) {
33 - const $ = useMemoCache(3);
33 + const $ = _c(3);
34 let t0;
35 if ($[0] !== cond || $[1] !== props.a.b) {
36 t0 = identity(cond) ? addOne(props.a.b) : identity(props.a.b);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cfg-ifelse.expect.md
+2 -2
@@ -28,14 +28,14 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime"; // props.a.b should be added as a unconditional dependency to the reactive
31 +import { c as _c } from "react/compiler-runtime"; // props.a.b should be added as a unconditional dependency to the reactive
32 // scope that produces x, since it is accessed unconditionally in all cfg
33 // paths
34
35 import { identity } from "shared-runtime";
36
37 function useCondDepInDirectIfElse(props, cond) {
38 - const $ = useMemoCache(3);
38 + const $ = _c(3);
39 let x;
40 if ($[0] !== cond || $[1] !== props.a.b) {
41 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cfg-nested-ifelse-missing.expect.md
+2 -2
@@ -29,13 +29,13 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime"; // props.a.b should NOT be added as a unconditional dependency to the reactive
32 +import { c as _c } from "react/compiler-runtime"; // props.a.b should NOT be added as a unconditional dependency to the reactive
33 // scope that produces x if it is not accessed in every path
34
35 import { identity, getNull } from "shared-runtime";
36
37 function useCondDepInNestedIfElse(props, cond) {
38 - const $ = useMemoCache(3);
38 + const $ = _c(3);
39 let x;
40 if ($[0] !== cond || $[1] !== props) {
41 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cfg-nested-ifelse.expect.md
+2 -2
@@ -34,14 +34,14 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react/compiler-runtime"; // props.a.b should be added as a unconditional dependency to the reactive
37 +import { c as _c } from "react/compiler-runtime"; // props.a.b should be added as a unconditional dependency to the reactive
38 // scope that produces x, since it is accessed unconditionally in all cfg
39 // paths
40
41 import { getNull, identity } from "shared-runtime";
42
43 function useCondDepInNestedIfElse(props, cond) {
44 - const $ = useMemoCache(3);
44 + const $ = _c(3);
45 let x;
46 if ($[0] !== cond || $[1] !== props.a.b) {
47 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cfg-switch-exhaustive.expect.md
+2 -2
@@ -33,14 +33,14 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react/compiler-runtime"; // props.a.b should be added as a unconditional dependency to the reactive
36 +import { c as _c } from "react/compiler-runtime"; // props.a.b should be added as a unconditional dependency to the reactive
37 // scope that produces x, since it is accessed unconditionally in all cfg
38 // paths
39
40 import { identity } from "shared-runtime";
41
42 function useCondDepInSwitch(props, other) {
43 - const $ = useMemoCache(3);
43 + const $ = _c(3);
44 let x;
45 if ($[0] !== other || $[1] !== props.a.b) {
46 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cfg-switch-missing-case.expect.md
+2 -2
@@ -33,13 +33,13 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react/compiler-runtime"; // props.a.b should NOT be added as a unconditional dependency to the reactive
36 +import { c as _c } from "react/compiler-runtime"; // props.a.b should NOT be added as a unconditional dependency to the reactive
37 // scope that produces x if it is not accessed in every path
38
39 import { identity } from "shared-runtime";
40
41 function useCondDepInSwitchMissingCase(props, other) {
42 - const $ = useMemoCache(3);
42 + const $ = _c(3);
43 let x;
44 if ($[0] !== other || $[1] !== props) {
45 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cfg-switch-missing-default.expect.md
+2 -2
@@ -30,13 +30,13 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react/compiler-runtime"; // props.a.b should NOT be added as a unconditional dependency to the reactive
33 +import { c as _c } from "react/compiler-runtime"; // props.a.b should NOT be added as a unconditional dependency to the reactive
34 // scope that produces x if it is not accessed in the default case.
35
36 import { identity } from "shared-runtime";
37
38 function useCondDepInSwitchMissingDefault(props, other) {
39 - const $ = useMemoCache(3);
39 + const $ = _c(3);
40 let x;
41 if ($[0] !== other || $[1] !== props) {
42 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cond-scope.expect.md
+2 -2
@@ -41,7 +41,7 @@ export const FIXTURE_ENTRYPOINT = {
41 ## Code
42
43 ```javascript
44 -import { c as useMemoCache } from "react/compiler-runtime"; // Some reactive scopes are created within a conditional. If a child scope
44 +import { c as _c } from "react/compiler-runtime"; // Some reactive scopes are created within a conditional. If a child scope
45 // is within a conditional, its reactive dependencies should be propagated
46 // as conditionals
47 //
@@ -62,7 +62,7 @@ import { c as useMemoCache } from "react/compiler-runtime"; // Some reactive sco
62 import { CONST_FALSE, identity } from "shared-runtime";
63
64 function useReactiveDepsInCondScope(props) {
65 - const $ = useMemoCache(4);
65 + const $ = _c(4);
66 let x;
67 if ($[0] !== props) {
68 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/conditional-member-expr.expect.md
+2 -2
@@ -22,12 +22,12 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime"; // To preserve the nullthrows behavior and reactive deps of this code,
25 +import { c as _c } from "react/compiler-runtime"; // To preserve the nullthrows behavior and reactive deps of this code,
26 // Forget needs to add `props.a` as a dependency (since `props.a.b` is
27 // a conditional dependency, i.e. gated behind control flow)
28
29 function Component(props) {
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 let x;
32 if ($[0] !== props.a) {
33 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/join-uncond-scopes-cond-deps.expect.md
+2 -2
@@ -41,7 +41,7 @@ export const FIXTURE_ENTRYPOINT = {
41 ## Code
42
43 ```javascript
44 -import { c as useMemoCache } from "react/compiler-runtime"; // This tests an optimization, NOT a correctness property.
44 +import { c as _c } from "react/compiler-runtime"; // This tests an optimization, NOT a correctness property.
45 // When propagating reactive dependencies of an inner scope up to its parent,
46 // we prefer to retain granularity.
47 //
@@ -61,7 +61,7 @@ import { c as useMemoCache } from "react/compiler-runtime"; // This tests an opt
61 import { CONST_TRUE, setProperty } from "shared-runtime";
62
63 function useJoinCondDepsInUncondScopes(props) {
64 - const $ = useMemoCache(8);
64 + const $ = _c(8);
65 let x;
66 let y;
67 if ($[0] !== props.a.b) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/break-in-scope.expect.md
+2 -2
@@ -31,9 +31,9 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react/compiler-runtime";
34 +import { c as _c } from "react/compiler-runtime";
35 function useFoo(t0) {
36 - const $ = useMemoCache(3);
36 + const $ = _c(3);
37 const { obj, objIsNull } = t0;
38 let x;
39 if ($[0] !== objIsNull || $[1] !== obj) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/break-poisons-outer-scope.expect.md
+2 -2
@@ -35,11 +35,11 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react/compiler-runtime";
38 +import { c as _c } from "react/compiler-runtime";
39 import { identity } from "shared-runtime";
40
41 function useFoo(t0) {
42 - const $ = useMemoCache(5);
42 + const $ = _c(5);
43 const { input, cond } = t0;
44 let x;
45 if ($[0] !== cond || $[1] !== input) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/loop-break-in-scope.expect.md
+2 -2
@@ -31,9 +31,9 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react/compiler-runtime";
34 +import { c as _c } from "react/compiler-runtime";
35 function useFoo(t0) {
36 - const $ = useMemoCache(3);
36 + const $ = _c(3);
37 const { obj, objIsNull } = t0;
38 let x;
39 if ($[0] !== objIsNull || $[1] !== obj) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/reduce-if-nonexhaustive-poisoned-deps.expect.md
+2 -2
@@ -36,11 +36,11 @@ export const FIXTURE_ENTRYPOINT = {
36 ## Code
37
38 ```javascript
39 -import { c as useMemoCache } from "react/compiler-runtime";
39 +import { c as _c } from "react/compiler-runtime";
40 import { identity } from "shared-runtime";
41
42 function useFoo(t0) {
43 - const $ = useMemoCache(9);
43 + const $ = _c(9);
44 const { input, cond, hasAB } = t0;
45 let x;
46 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/reduce-if-nonexhaustive-poisoned-deps1.expect.md
+2 -2
@@ -37,11 +37,11 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react/compiler-runtime";
40 +import { c as _c } from "react/compiler-runtime";
41 import { identity } from "shared-runtime";
42
43 function useFoo(t0) {
44 - const $ = useMemoCache(11);
44 + const $ = _c(11);
45 const { input, cond, hasAB } = t0;
46 let x;
47 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/return-in-scope.expect.md
+2 -2
@@ -29,9 +29,9 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime";
32 +import { c as _c } from "react/compiler-runtime";
33 function useFoo(t0) {
34 - const $ = useMemoCache(4);
34 + const $ = _c(4);
35 const { obj, objIsNull } = t0;
36 let x;
37 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/return-poisons-outer-scope.expect.md
+2 -2
@@ -33,11 +33,11 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react/compiler-runtime";
36 +import { c as _c } from "react/compiler-runtime";
37 import { identity } from "shared-runtime";
38
39 function useFoo(t0) {
40 - const $ = useMemoCache(6);
40 + const $ = _c(6);
41 const { input, cond } = t0;
42 let x;
43 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-unpoisoned/else-branch-scope-unpoisoned.expect.md
+2 -2
@@ -36,11 +36,11 @@ export const FIXTURE_ENTRYPOINT = {
36 ## Code
37
38 ```javascript
39 -import { c as useMemoCache } from "react/compiler-runtime";
39 +import { c as _c } from "react/compiler-runtime";
40 import { identity } from "shared-runtime";
41
42 function useFoo(t0) {
43 - const $ = useMemoCache(5);
43 + const $ = _c(5);
44 const { input, cond } = t0;
45 let x;
46 if ($[0] !== cond || $[1] !== input) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-unpoisoned/jump-target-within-scope-label.expect.md
+2 -2
@@ -33,9 +33,9 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react/compiler-runtime";
36 +import { c as _c } from "react/compiler-runtime";
37 function useFoo(t0) {
38 - const $ = useMemoCache(3);
38 + const $ = _c(3);
39 const { input, cond } = t0;
40 let x;
41 if ($[0] !== cond || $[1] !== input.a.b) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-unpoisoned/jump-target-within-scope-loop-break.expect.md
+2 -2
@@ -35,9 +35,9 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react/compiler-runtime";
38 +import { c as _c } from "react/compiler-runtime";
39 function useFoo(t0) {
40 - const $ = useMemoCache(3);
40 + const $ = _c(3);
41 const { input, max } = t0;
42 let x;
43 if ($[0] !== max || $[1] !== input.a.b) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-unpoisoned/reduce-if-exhaustive-nonpoisoned-deps.expect.md
+2 -2
@@ -27,11 +27,11 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 import { identity } from "shared-runtime";
32
33 function useFoo(t0) {
34 - const $ = useMemoCache(9);
34 + const $ = _c(9);
35 const { input, hasAB, returnNull } = t0;
36 let x;
37 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-unpoisoned/reduce-if-exhaustive-nonpoisoned-deps1.expect.md
+2 -2
@@ -37,11 +37,11 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react/compiler-runtime";
40 +import { c as _c } from "react/compiler-runtime";
41 import { identity } from "shared-runtime";
42
43 function useFoo(t0) {
44 - const $ = useMemoCache(11);
44 + const $ = _c(11);
45 const { input, cond2, cond1 } = t0;
46 let x;
47 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-unpoisoned/return-before-scope-starts.expect.md
+2 -2
@@ -35,11 +35,11 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react/compiler-runtime";
38 +import { c as _c } from "react/compiler-runtime";
39 import { arrayPush } from "shared-runtime";
40
41 function useFoo(t0) {
42 - const $ = useMemoCache(3);
42 + const $ = _c(3);
43 const { input, cond } = t0;
44 if (cond) {
45 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-unpoisoned/throw-before-scope-starts.expect.md
+2 -2
@@ -35,11 +35,11 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react/compiler-runtime";
38 +import { c as _c } from "react/compiler-runtime";
39 import { arrayPush } from "shared-runtime";
40
41 function useFoo(t0) {
42 - const $ = useMemoCache(2);
42 + const $ = _c(2);
43 const { input, cond } = t0;
44 if (cond) {
45 throw new Error("throw with error!");
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/memberexpr-join-optional-chain.expect.md
+2 -2
@@ -30,7 +30,7 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react/compiler-runtime"; // To preserve the nullthrows behavior and reactive deps of this code,
33 +import { c as _c } from "react/compiler-runtime"; // To preserve the nullthrows behavior and reactive deps of this code,
34 // Forget needs to add `props.a.b` or a subpath as a dependency.
35 //
36 // (1) Since the reactive block producing x unconditionally read props.a.<...>,
@@ -42,7 +42,7 @@ import { c as useMemoCache } from "react/compiler-runtime"; // To preserve the n
42 // we technically do not need to add `props.a` as a dependency.
43
44 function Component(props) {
45 - const $ = useMemoCache(2);
45 + const $ = _c(2);
46 let x;
47 if ($[0] !== props.a) {
48 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/memberexpr-join-optional-chain2.expect.md
+2 -2
@@ -19,9 +19,9 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function Component(props) {
24 - const $ = useMemoCache(2);
24 + const $ = _c(2);
25 let x;
26 if ($[0] !== props.items) {
27 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/no-uncond.expect.md
+2 -2
@@ -35,13 +35,13 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react/compiler-runtime"; // When an object's properties are only read conditionally, we should
38 +import { c as _c } from "react/compiler-runtime"; // When an object's properties are only read conditionally, we should
39
40 import { identity } from "shared-runtime";
41
42 // track the base object as a dependency.
43 function useOnlyConditionalDependencies(t0) {
44 - const $ = useMemoCache(3);
44 + const $ = _c(3);
45 const { props, cond } = t0;
46 let x;
47 if ($[0] !== cond || $[1] !== props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/promote-uncond.expect.md
+2 -2
@@ -27,14 +27,14 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime"; // When a conditional dependency `props.a.b.c` has no unconditional dependency
30 +import { c as _c } from "react/compiler-runtime"; // When a conditional dependency `props.a.b.c` has no unconditional dependency
31 // in its subpath or superpath, we should find the nearest unconditional access
32
33 import { identity } from "shared-runtime";
34
35 // and promote it to an unconditional dependency.
36 function usePromoteUnconditionalAccessToDependency(props, other) {
37 - const $ = useMemoCache(3);
37 + const $ = _c(3);
38 let x;
39 if ($[0] !== props.a || $[1] !== other) {
40 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/reduce-if-exhaustive-poisoned-deps.expect.md
+2 -2
@@ -28,11 +28,11 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime";
31 +import { c as _c } from "react/compiler-runtime";
32 import { identity } from "shared-runtime";
33
34 function useFoo(t0) {
35 - const $ = useMemoCache(11);
35 + const $ = _c(11);
36 const { input, inputHasAB, inputHasABC } = t0;
37 let x;
38 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/subpath-order1.expect.md
+2 -2
@@ -29,7 +29,7 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime"; // When a conditional dependency `props.a` is a subpath of an unconditional
32 +import { c as _c } from "react/compiler-runtime"; // When a conditional dependency `props.a` is a subpath of an unconditional
33 // dependency `props.a.b`, we can access `props.a` while preserving program
34 // semantics (with respect to nullthrows).
35 // deps: {`props.a`, `props.a.b`} can further reduce to just `props.a`
@@ -38,7 +38,7 @@ import { identity } from "shared-runtime";
38
39 // ordering of accesses should not matter
40 function useConditionalSubpath1(props, cond) {
41 - const $ = useMemoCache(3);
41 + const $ = _c(3);
42 let x;
43 if ($[0] !== props.a || $[1] !== cond) {
44 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/subpath-order2.expect.md
+2 -2
@@ -29,7 +29,7 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime"; // When a conditional dependency `props.a` is a subpath of an unconditional
32 +import { c as _c } from "react/compiler-runtime"; // When a conditional dependency `props.a` is a subpath of an unconditional
33 // dependency `props.a.b`, we can access `props.a` while preserving program
34 // semantics (with respect to nullthrows).
35 // deps: {`props.a`, `props.a.b`} can further reduce to just `props.a`
@@ -38,7 +38,7 @@ import { identity } from "shared-runtime";
38
39 // ordering of accesses should not matter
40 function useConditionalSubpath2(props, other) {
41 - const $ = useMemoCache(3);
41 + const $ = _c(3);
42 let x;
43 if ($[0] !== other || $[1] !== props.a) {
44 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/superpath-order1.expect.md
+2 -2
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react/compiler-runtime"; // When an unconditional dependency `props.a` is the subpath of a conditional
40 +import { c as _c } from "react/compiler-runtime"; // When an unconditional dependency `props.a` is the subpath of a conditional
41 // dependency `props.a.b`, we can safely overestimate and only track `props.a`
42 // as a dependency
43
@@ -45,7 +45,7 @@ import { identity } from "shared-runtime";
45
46 // ordering of accesses should not matter
47 function useConditionalSuperpath1(t0) {
48 - const $ = useMemoCache(3);
48 + const $ = _c(3);
49 const { props, cond } = t0;
50 let x;
51 if ($[0] !== props.a || $[1] !== cond) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/superpath-order2.expect.md
+2 -2
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react/compiler-runtime"; // When an unconditional dependency `props.a` is the subpath of a conditional
40 +import { c as _c } from "react/compiler-runtime"; // When an unconditional dependency `props.a` is the subpath of a conditional
41 // dependency `props.a.b`, we can safely overestimate and only track `props.a`
42 // as a dependency
43
@@ -45,7 +45,7 @@ import { identity } from "shared-runtime";
45
46 // ordering of accesses should not matter
47 function useConditionalSuperpath2(t0) {
48 - const $ = useMemoCache(3);
48 + const $ = _c(3);
49 const { props, cond } = t0;
50 let x;
51 if ($[0] !== cond || $[1] !== props.a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/uncond-nonoverlap-descendant.expect.md
+2 -2
@@ -22,10 +22,10 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime"; // Test that we can track non-overlapping dependencies separately.
25 +import { c as _c } from "react/compiler-runtime"; // Test that we can track non-overlapping dependencies separately.
26 // (not needed for correctness but for dependency granularity)
27 function TestNonOverlappingDescendantTracked(props) {
28 - const $ = useMemoCache(4);
28 + const $ = _c(4);
29 let x;
30 if ($[0] !== props.a.x.y || $[1] !== props.a.c.x.y.z || $[2] !== props.b) {
31 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/uncond-nonoverlap-direct.expect.md
+2 -2
@@ -21,10 +21,10 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime"; // Test that we can track non-overlapping dependencies separately.
24 +import { c as _c } from "react/compiler-runtime"; // Test that we can track non-overlapping dependencies separately.
25 // (not needed for correctness but for dependency granularity)
26 function TestNonOverlappingTracked(props) {
27 - const $ = useMemoCache(3);
27 + const $ = _c(3);
28 let x;
29 if ($[0] !== props.a.b || $[1] !== props.a.c) {
30 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/uncond-overlap-descendant.expect.md
+2 -2
@@ -22,10 +22,10 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime"; // Test that we correctly track a subpath if the subpath itself is accessed as
25 +import { c as _c } from "react/compiler-runtime"; // Test that we correctly track a subpath if the subpath itself is accessed as
26 // a dependency
27 function TestOverlappingDescendantTracked(props) {
28 - const $ = useMemoCache(2);
28 + const $ = _c(2);
29 let x;
30 if ($[0] !== props.a) {
31 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/uncond-overlap-direct.expect.md
+2 -2
@@ -22,10 +22,10 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime"; // Test that we correctly track a subpath if the subpath itself is accessed as
25 +import { c as _c } from "react/compiler-runtime"; // Test that we correctly track a subpath if the subpath itself is accessed as
26 // a dependency
27 function TestOverlappingTracked(props) {
28 - const $ = useMemoCache(2);
28 + const $ = _c(2);
29 let x;
30 if ($[0] !== props.a) {
31 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/uncond-subpath-order1.expect.md
+2 -2
@@ -22,10 +22,10 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime"; // Determine that we only need to track p.a here
25 +import { c as _c } from "react/compiler-runtime"; // Determine that we only need to track p.a here
26 // Ordering of access should not matter
27 function TestDepsSubpathOrder1(props) {
28 - const $ = useMemoCache(2);
28 + const $ = _c(2);
29 let x;
30 if ($[0] !== props.a) {
31 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/uncond-subpath-order2.expect.md
+2 -2
@@ -22,10 +22,10 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime"; // Determine that we only need to track p.a here
25 +import { c as _c } from "react/compiler-runtime"; // Determine that we only need to track p.a here
26 // Ordering of access should not matter
27 function TestDepsSubpathOrder2(props) {
28 - const $ = useMemoCache(2);
28 + const $ = _c(2);
29 let x;
30 if ($[0] !== props.a) {
31 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/uncond-subpath-order3.expect.md
+2 -2
@@ -22,10 +22,10 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime"; // Determine that we only need to track p.a here
25 +import { c as _c } from "react/compiler-runtime"; // Determine that we only need to track p.a here
26 // Ordering of access should not matter
27 function TestDepsSubpathOrder3(props) {
28 - const $ = useMemoCache(2);
28 + const $ = _c(2);
29 let x;
30 if ($[0] !== props.a) {
31 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-current-aliased-no-added-to-dep.expect.md
+2 -2
@@ -18,9 +18,9 @@ function VideoTab() {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime"; // @validateRefAccessDuringRender false
21 +import { c as _c } from "react/compiler-runtime"; // @validateRefAccessDuringRender false
22 function VideoTab() {
23 - const $ = useMemoCache(3);
23 + const $ = _c(3);
24 const ref = useRef();
25 const t = ref.current;
26 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-current-aliased-not-added-to-dep-2.expect.md
+2 -2
@@ -16,9 +16,9 @@ function Foo({ a }) {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime"; // @validateRefAccessDuringRender:false
19 +import { c as _c } from "react/compiler-runtime"; // @validateRefAccessDuringRender:false
20 function Foo(t0) {
21 - const $ = useMemoCache(4);
21 + const $ = _c(4);
22 const { a } = t0;
23 const ref = useRef();
24 const val = ref.current;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-current-field-not-added-to-dep.expect.md
+2 -2
@@ -17,9 +17,9 @@ function VideoTab() {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime"; // @validateRefAccessDuringRender false
20 +import { c as _c } from "react/compiler-runtime"; // @validateRefAccessDuringRender false
21 function VideoTab() {
22 - const $ = useMemoCache(3);
22 + const $ = _c(3);
23 const ref = useRef();
24 let t0;
25 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-current-field-write-not-added-to-dep.expect.md
+2 -2
@@ -23,11 +23,11 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 import { useRef } from "react";
28
29 function Component() {
30 - const $ = useMemoCache(4);
30 + const $ = _c(4);
31 let t0;
32 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
33 t0 = { text: { value: null } };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-current-not-added-to-dep-2.expect.md
+2 -2
@@ -15,9 +15,9 @@ function Foo({ a }) {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react/compiler-runtime"; // @validateRefAccessDuringRender:false
18 +import { c as _c } from "react/compiler-runtime"; // @validateRefAccessDuringRender:false
19 function Foo(t0) {
20 - const $ = useMemoCache(4);
20 + const $ = _c(4);
21 const { a } = t0;
22 const ref = useRef();
23 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-current-not-added-to-dep.expect.md
+2 -2
@@ -16,9 +16,9 @@ function VideoTab() {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function VideoTab() {
21 - const $ = useMemoCache(3);
21 + const $ = _c(3);
22 const ref = useRef();
23 let t0;
24 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-current-optional-field-no-added-to-dep.expect.md
+2 -2
@@ -16,9 +16,9 @@ function VideoTab() {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function VideoTab() {
21 - const $ = useMemoCache(3);
21 + const $ = _c(3);
22 const ref = useRef();
23 let t0;
24 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-current-write-not-added-to-dep.expect.md
+2 -2
@@ -16,9 +16,9 @@ function VideoTab() {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function VideoTab() {
21 - const $ = useMemoCache(3);
21 + const $ = _c(3);
22 const ref = useRef();
23 let t0;
24 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-in-effect.expect.md
+2 -2
@@ -19,9 +19,9 @@ function Component(props) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function Component(props) {
24 - const $ = useMemoCache(4);
24 + const $ = _c(4);
25 const ref = useRef(null);
26 let t0;
27 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-parameter-mutate-in-effect.expect.md
+2 -2
@@ -22,11 +22,11 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 import { useEffect } from "react";
27
28 function Foo(props, ref) {
29 - const $ = useMemoCache(4);
29 + const $ = _c(4);
30 let t0;
31 let t1;
32 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/regexp-literal.expect.md
+2 -2
@@ -18,9 +18,9 @@ function Component(props) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Component(props) {
23 - const $ = useMemoCache(4);
23 + const $ = _c(4);
24 let t0;
25 let value;
26 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rename-source-variables-nested-function.expect.md
+2 -2
@@ -34,14 +34,14 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableChangeVariableCodegen
37 +import { c as _c } from "react/compiler-runtime"; // @enableChangeVariableCodegen
38 import { identity } from "shared-runtime";
39
40 const $ = "module_$";
41 const t0 = "module_t0";
42 const c_0 = "module_c_0";
43 function useFoo(props) {
44 - const $0 = useMemoCache(4);
44 + const $0 = _c(4);
45 const c_00 = $0[0] !== props.value;
46 let t1;
47 if (c_00) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rename-source-variables-nested-object-method.expect.md
+2 -2
@@ -35,14 +35,14 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableChangeVariableCodegen
38 +import { c as _c } from "react/compiler-runtime"; // @enableChangeVariableCodegen
39 import { identity } from "shared-runtime";
40
41 const $ = "module_$";
42 const t0 = "module_t0";
43 const c_0 = "module_c_0";
44 function useFoo(props) {
45 - const $0 = useMemoCache(2);
45 + const $0 = _c(2);
46 const c_00 = $0[0] !== props.value;
47 let t1;
48 if (c_00) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rename-source-variables.expect.md
+2 -2
@@ -26,14 +26,14 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableChangeVariableCodegen
29 +import { c as _c } from "react/compiler-runtime"; // @enableChangeVariableCodegen
30 import { identity } from "shared-runtime";
31
32 const $ = "module_$";
33 const t0 = "module_t0";
34 const c_0 = "module_c_0";
35 function useFoo(props) {
36 - const $0 = useMemoCache(2);
36 + const $0 = _c(2);
37 const c_00 = $0[0] !== props.value;
38 let t1;
39 if (c_00) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-allocating-ternary-test-instruction-scope.expect.md
+2 -2
@@ -28,11 +28,11 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime";
31 +import { c as _c } from "react/compiler-runtime";
32 import { identity, makeObject_Primitives } from "shared-runtime";
33
34 function useTest(t0) {
35 - const $ = useMemoCache(3);
35 + const $ = _c(3);
36 const { cond } = t0;
37 let t1;
38 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-dce-circular-reference.expect.md
+2 -2
@@ -31,11 +31,11 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react/compiler-runtime";
34 +import { c as _c } from "react/compiler-runtime";
35 import { identity } from "shared-runtime";
36
37 function Component(t0) {
38 - const $ = useMemoCache(2);
38 + const $ = _c(2);
39 const { data } = t0;
40 let x = 0;
41 for (const item of data) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-dont-memoize-array-with-capturing-map-after-hook.expect.md
+2 -2
@@ -34,12 +34,12 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react/compiler-runtime";
37 +import { c as _c } from "react/compiler-runtime";
38 import { useEffect, useState } from "react";
39 import { mutate } from "shared-runtime";
40
41 function Component(props) {
42 - const $ = useMemoCache(6);
42 + const $ = _c(6);
43 const x = [{ ...props.value }];
44 let t0;
45 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-dont-memoize-array-with-mutable-map-after-hook.expect.md
+2 -2
@@ -34,12 +34,12 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react/compiler-runtime";
37 +import { c as _c } from "react/compiler-runtime";
38 import { useEffect, useState } from "react";
39 import { mutate } from "shared-runtime";
40
41 function Component(props) {
42 - const $ = useMemoCache(6);
42 + const $ = _c(6);
43 const x = [{ ...props.value }];
44 let t0;
45 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-duplicate-import-specifier.expect.md
+2 -2
@@ -20,12 +20,12 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 import type { SetStateAction, Dispatch } from "react";
25 import { useState } from "react";
26
27 function Component(_props) {
28 - const $ = useMemoCache(2);
28 + const $ = _c(2);
29 const [x] = useState(0);
30 let t0;
31 if ($[0] !== x) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-duplicate-instruction-from-merge-consecutive-scopes.expect.md
+2 -2
@@ -25,11 +25,11 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 import { Stringify } from "shared-runtime";
30
31 function Component(t0) {
32 - const $ = useMemoCache(3);
32 + const $ = _c(3);
33 const { id } = t0;
34 let t1;
35 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-duplicate-type-import.expect.md
+2 -2
@@ -18,11 +18,11 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 import type { ReactElement } from "react";
23
24 function Component(_props) {
25 - const $ = useMemoCache(1);
25 + const $ = _c(1);
26 let t0;
27 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28 t0 = <div>hello world</div>;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-hoisting-variable-collision.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Component(props) {
23 - const $ = useMemoCache(5);
23 + const $ = _c(5);
24 let t0;
25 if ($[0] !== props.items) {
26 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-hoisting.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function Component(props) {
29 - const $ = useMemoCache(4);
29 + const $ = _c(4);
30 let t0;
31 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
32 t0 = () => {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-independently-memoized-property-load-for-method-call.expect.md
+2 -2
@@ -52,9 +52,9 @@ export const FIXTURE_ENTRYPOINT = {
52 ## Code
53
54 ```javascript
55 -import { c as useMemoCache } from "react/compiler-runtime";
55 +import { c as _c } from "react/compiler-runtime";
56 function Component(t0) {
57 - const $ = useMemoCache(8);
57 + const $ = _c(8);
58 const { label, highlightedItem } = t0;
59 const serverTime = useServerTime();
60 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-instruction-part-of-already-closed-scope.expect.md
+2 -2
@@ -31,11 +31,11 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableAssumeHooksFollowRulesOfReact
34 +import { c as _c } from "react/compiler-runtime"; // @enableAssumeHooksFollowRulesOfReact
35 import { Stringify, identity, useHook } from "shared-runtime";
36
37 function Component(t0) {
38 - const $ = useMemoCache(17);
38 + const $ = _c(17);
39 const { index } = t0;
40 const data = useHook();
41 let T0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-memoize-array-with-immutable-map-after-hook.expect.md
+2 -2
@@ -30,11 +30,11 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react/compiler-runtime";
33 +import { c as _c } from "react/compiler-runtime";
34 import { useEffect, useState } from "react";
35
36 function Component(props) {
37 - const $ = useMemoCache(11);
37 + const $ = _c(11);
38 let t0;
39 if ($[0] !== props.value) {
40 t0 = [props.value];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-missing-dependency-if-within-while.expect.md
+2 -2
@@ -36,10 +36,10 @@ export const FIXTURE_ENTRYPOINT = {
36 ## Code
37
38 ```javascript
39 -import { c as useMemoCache } from "react/compiler-runtime";
39 +import { c as _c } from "react/compiler-runtime";
40 const someGlobal = true;
41 export default function Component(props) {
42 - const $ = useMemoCache(4);
42 + const $ = _c(4);
43 const { b } = props;
44 let items;
45 if ($[0] !== b) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-mutable-range-shared-inner-outer-function.expect.md
+2 -2
@@ -31,10 +31,10 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
34 +import { c as _c } from "react/compiler-runtime"; // @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
35 let cond = true;
36 function Component(props) {
37 - const $ = useMemoCache(2);
37 + const $ = _c(2);
38 let a;
39 let b;
40 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-no-declarations-in-reactive-scope-with-early-return.expect.md
+2 -2
@@ -37,9 +37,9 @@ function Component() {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
40 +import { c as _c } from "react/compiler-runtime"; // @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
41 function Component() {
42 - const $ = useMemoCache(9);
42 + const $ = _c(9);
43 const items = useItems();
44 let t0;
45 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-no-value-for-temporary-reactive-scope-with-early-return.expect.md
+2 -2
@@ -33,12 +33,12 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react/compiler-runtime";
36 +import { c as _c } from "react/compiler-runtime";
37 import { identity, makeObject_Primitives } from "shared-runtime";
38 import fbt from "fbt";
39
40 function Component(props) {
41 - const $ = useMemoCache(2);
41 + const $ = _c(2);
42 let t0;
43 let t1;
44 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-no-value-for-temporary.expect.md
+2 -2
@@ -15,9 +15,9 @@ function Component(listItem, thread) {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react/compiler-runtime";
18 +import { c as _c } from "react/compiler-runtime";
19 function Component(listItem, thread) {
20 - const $ = useMemoCache(7);
20 + const $ = _c(7);
21 let t0;
22 let t1;
23 let t2;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-non-identifier-object-keys.expect.md
+2 -2
@@ -23,9 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function Foo() {
28 - const $ = useMemoCache(1);
28 + const $ = _c(1);
29 let t0;
30 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
31 t0 = { "a.b": 1, "a\b": 2, "a/b": 3, "a+b": 4, "a b": 5 };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-object-pattern.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function component(t) {
23 - const $ = useMemoCache(2);
23 + const $ = _c(2);
24 const { a } = t;
25 let t0;
26 if ($[0] !== a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-reassign-to-variable-without-mutable-range.expect.md
+2 -2
@@ -19,9 +19,9 @@ function Component(a, b) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime"; // @debug
22 +import { c as _c } from "react/compiler-runtime"; // @debug
23 function Component(a, b) {
24 - const $ = useMemoCache(11);
24 + const $ = _c(11);
25 let t0;
26 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
27 t0 = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-renaming-conflicting-decls.expect.md
+2 -2
@@ -41,12 +41,12 @@ export const FIXTURE_ENTRYPOINT = {
41 ## Code
42
43 ```javascript
44 -import { c as useMemoCache } from "react/compiler-runtime";
44 +import { c as _c } from "react/compiler-runtime";
45 import { Stringify, identity, makeArray, toJSON } from "shared-runtime";
46 import { useMemo } from "react";
47
48 function Component(props) {
49 - const $ = useMemoCache(29);
49 + const $ = _c(29);
50 let t0;
51 let t1;
52 let t2;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-scope-missing-mutable-range.expect.md
+2 -2
@@ -18,9 +18,9 @@ function HomeDiscoStoreItemTileRating(props) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function HomeDiscoStoreItemTileRating(props) {
23 - const $ = useMemoCache(4);
23 + const $ = _c(4);
24 const item = useFragment();
25 let count;
26 if ($[0] !== item) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-separate-scopes-for-divs.expect.md
+2 -2
@@ -39,12 +39,12 @@ const styles = {
39 ## Code
40
41 ```javascript
42 -import { c as useMemoCache } from "react/compiler-runtime";
42 +import { c as _c } from "react/compiler-runtime";
43 import { identity } from "shared-runtime";
44
45 const DISPLAY = true;
46 function Component(t0) {
47 - const $ = useMemoCache(9);
47 + const $ = _c(9);
48 const { cond: t1, id } = t0;
49 const cond = t1 === undefined ? false : t1;
50 let t2;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-undefined-expression-of-jsxexpressioncontainer.expect.md
+2 -2
@@ -44,11 +44,11 @@ export const FIXTURE_ENTRYPOINT = {
44 ## Code
45
46 ```javascript
47 -import { c as useMemoCache } from "react/compiler-runtime";
47 +import { c as _c } from "react/compiler-runtime";
48 import { StaticText1, Stringify, Text } from "shared-runtime";
49
50 function Component(props) {
51 - const $ = useMemoCache(7);
51 + const $ = _c(7);
52 const { buttons } = props;
53 let nonPrimaryButtons;
54 if ($[0] !== buttons) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-unmerged-fbt-call-merge-overlapping-reactive-scopes.expect.md
+2 -2
@@ -31,12 +31,12 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react/compiler-runtime";
34 +import { c as _c } from "react/compiler-runtime";
35 import fbt from "fbt";
36 import { Stringify } from "shared-runtime";
37
38 function Component(props) {
39 - const $ = useMemoCache(3);
39 + const $ = _c(3);
40 let t0;
41 if ($[0] !== props.value.length || $[1] !== props.cond) {
42 const label = fbt._(
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-unreachable-code-early-return-in-useMemo.expect.md
+2 -2
@@ -40,12 +40,12 @@ export const FIXTURE_ENTRYPOINT = {
40 ## Code
41
42 ```javascript
43 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
43 +import { c as _c } from "react/compiler-runtime"; // @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
44 import { useMemo, useState } from "react";
45 import { ValidateMemoization, identity } from "shared-runtime";
46
47 function Component(t0) {
48 - const $ = useMemoCache(7);
48 + const $ = _c(7);
49 const { value } = t0;
50 let t1;
51 bb0: {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro.expect.md
+2 -2
@@ -22,9 +22,9 @@ function Component(props) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function Component(props) {
27 - const $ = useMemoCache(6);
27 + const $ = _c(6);
28 const item = props.item;
29 let baseVideos;
30 let thumbnails;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rest-param-with-array-pattern.expect.md
+2 -2
@@ -16,9 +16,9 @@ export const FIXTURE_ENTRYPOINT = {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function Component(foo, ...t0) {
21 - const $ = useMemoCache(3);
21 + const $ = _c(3);
22 const [bar] = t0;
23 let t1;
24 if ($[0] !== foo || $[1] !== bar) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rest-param-with-identifier.expect.md
+2 -2
@@ -16,9 +16,9 @@ export const FIXTURE_ENTRYPOINT = {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function Component(foo, ...t0) {
21 - const $ = useMemoCache(3);
21 + const $ = _c(3);
22 const bar = t0;
23 let t1;
24 if ($[0] !== foo || $[1] !== bar) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rest-param-with-object-spread-pattern.expect.md
+2 -2
@@ -16,9 +16,9 @@ export const FIXTURE_ENTRYPOINT = {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function Component(foo, ...t0) {
21 - const $ = useMemoCache(3);
21 + const $ = _c(3);
22 const { bar } = t0;
23 let t1;
24 if ($[0] !== foo || $[1] !== bar) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rewrite-phis-in-lambda-capture-context.expect.md
+2 -2
@@ -22,9 +22,9 @@ function Component() {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function Component() {
27 - const $ = useMemoCache(1);
27 + const $ = _c(1);
28 let t0;
29 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
30 t0 = () => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/allow-locals-named-like-hooks.expect.md
+2 -2
@@ -31,11 +31,11 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react/compiler-runtime";
34 +import { c as _c } from "react/compiler-runtime";
35 import { makeObject_Primitives } from "shared-runtime";
36
37 function Component(props) {
38 - const $ = useMemoCache(2);
38 + const $ = _c(2);
39 const useFeature = makeObject_Primitives();
40 let x;
41 if (useFeature) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/allow-props-named-like-hooks.expect.md
+2 -2
@@ -30,11 +30,11 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react/compiler-runtime";
33 +import { c as _c } from "react/compiler-runtime";
34 import { Stringify } from "shared-runtime";
35
36 function Component(t0) {
37 - const $ = useMemoCache(8);
37 + const $ = _c(8);
38 const { useFeature } = t0;
39 let x;
40 if (useFeature) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/rules-of-hooks-93dc5d5e538a.expect.md
+2 -2
@@ -17,9 +17,9 @@ function RegressionTest() {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime"; // Valid because the loop doesn't change the order of hooks calls.
20 +import { c as _c } from "react/compiler-runtime"; // Valid because the loop doesn't change the order of hooks calls.
21 function RegressionTest() {
22 - const $ = useMemoCache(1);
22 + const $ = _c(1);
23 const res = [];
24 for (let i = 0; i !== 10 && true; ++i) {
25 res.push(i);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/rules-of-hooks-9a47e97b5d13.expect.md
+2 -2
@@ -14,10 +14,10 @@ const FancyButton = React.forwardRef(function (props, ref) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react/compiler-runtime"; // Valid because hooks can be used in anonymous function arguments to
17 +import { c as _c } from "react/compiler-runtime"; // Valid because hooks can be used in anonymous function arguments to
18 // forwardRef.
19 const FancyButton = React.forwardRef(function (props, ref) {
20 - const $ = useMemoCache(3);
20 + const $ = _c(3);
21 useHook();
22 let t0;
23 if ($[0] !== props || $[1] !== ref) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/rules-of-hooks-e66a744cffbe.expect.md
+2 -2
@@ -14,10 +14,10 @@ const FancyButton = forwardRef(function (props, ref) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react/compiler-runtime"; // Valid because hooks can be used in anonymous function arguments to
17 +import { c as _c } from "react/compiler-runtime"; // Valid because hooks can be used in anonymous function arguments to
18 // forwardRef.
19 const FancyButton = forwardRef(function (props, ref) {
20 - const $ = useMemoCache(3);
20 + const $ = _c(3);
21 useHook();
22 let t0;
23 if ($[0] !== props || $[1] !== ref) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/rules-of-hooks-eacfcaa6ef89.expect.md
+2 -2
@@ -14,10 +14,10 @@ const MemoizedFunction = memo(function (props) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react/compiler-runtime"; // Valid because hooks can be used in anonymous function arguments to
17 +import { c as _c } from "react/compiler-runtime"; // Valid because hooks can be used in anonymous function arguments to
18 // memo.
19 const MemoizedFunction = memo(function (props) {
20 - const $ = useMemoCache(2);
20 + const $ = _c(2);
21 useHook();
22 let t0;
23 if ($[0] !== props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/todo.bail.rules-of-hooks-28a78701970c.expect.md
+2 -2
@@ -17,13 +17,13 @@ const MemoizedFunction = React.memo((props) => {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime"; // @skip
20 +import { c as _c } from "react/compiler-runtime"; // @skip
21 // Unsupported input
22
23 // Valid because hooks can be used in anonymous function arguments to
24 // React.memo.
25 const MemoizedFunction = React.memo((props) => {
26 - const $ = useMemoCache(2);
26 + const $ = _c(2);
27 useHook();
28 let t0;
29 if ($[0] !== props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/todo.bail.rules-of-hooks-6949b255e7eb.expect.md
+2 -2
@@ -78,7 +78,7 @@ const SomeName = () => {
78 ## Code
79
80 ```javascript
81 -import { c as useMemoCache } from "react/compiler-runtime"; // @skip
81 +import { c as _c } from "react/compiler-runtime"; // @skip
82 // Unsupported input
83
84 // Valid because the neither the conditions before or after the hook affect the hook call
@@ -86,7 +86,7 @@ import { c as useMemoCache } from "react/compiler-runtime"; // @skip
86 const useSomeHook = () => {};
87
88 const SomeName = () => {
89 - const $ = useMemoCache(1);
89 + const $ = _c(1);
90 (FILLER ?? FILLER, FILLER) ?? FILLER;
91 (FILLER ?? FILLER, FILLER) ?? FILLER;
92 (FILLER ?? FILLER, FILLER) ?? FILLER;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/todo.bail.rules-of-hooks-e9f9bac89f8f.expect.md
+2 -2
@@ -17,13 +17,13 @@ const FancyButton = React.forwardRef((props, ref) => {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime"; // @skip
20 +import { c as _c } from "react/compiler-runtime"; // @skip
21 // Unsupported input
22
23 // Valid because hooks can be used in anonymous arrow-function arguments
24 // to forwardRef.
25 const FancyButton = React.forwardRef((props, ref) => {
26 - const $ = useMemoCache(3);
26 + const $ = _c(3);
27 useHook();
28 let t0;
29 if ($[0] !== props || $[1] !== ref) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/todo.invalid.invalid-rules-of-hooks-e675f0a672d8.expect.md
+2 -2
@@ -20,7 +20,7 @@ function List(props) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime"; // @skip
23 +import { c as _c } from "react/compiler-runtime"; // @skip
24 // Passed but should have failed
25
26 // Invalid because it's dangerous and might not warn otherwise.
@@ -30,7 +30,7 @@ function renderItem() {
30 }
31
32 function List(props) {
33 - const $ = useMemoCache(2);
33 + const $ = _c(2);
34 let t0;
35 if ($[0] !== props.items) {
36 t0 = props.items.map(renderItem);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/same-variable-as-dep-and-redeclare-maybe-frozen.expect.md
+2 -2
@@ -49,10 +49,10 @@ export const FIXTURE_ENTRYPOINT = {
49 ## Code
50
51 ```javascript
52 -import { c as useMemoCache } from "react/compiler-runtime"; // note: comments are for the ideal scopes, not what is currently
52 +import { c as _c } from "react/compiler-runtime"; // note: comments are for the ideal scopes, not what is currently
53 // emitted
54 function foo(props) {
55 - const $ = useMemoCache(16);
55 + const $ = _c(16);
56 let x;
57 if ($[0] !== props.a) {
58 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/same-variable-as-dep-and-redeclare.expect.md
+2 -2
@@ -49,10 +49,10 @@ export const FIXTURE_ENTRYPOINT = {
49 ## Code
50
51 ```javascript
52 -import { c as useMemoCache } from "react/compiler-runtime"; // note: comments are for the ideal scopes, not what is currently
52 +import { c as _c } from "react/compiler-runtime"; // note: comments are for the ideal scopes, not what is currently
53 // emitted
54 function foo(props) {
55 - const $ = useMemoCache(15);
55 + const $ = _c(15);
56 let x;
57 if ($[0] !== props.a) {
58 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/sequence-expression.expect.md
+2 -2
@@ -17,9 +17,9 @@ function foo() {}
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime";
20 +import { c as _c } from "react/compiler-runtime";
21 function sequence(props) {
22 - const $ = useMemoCache(2);
22 + const $ = _c(2);
23 let t0;
24 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
25 t0 = (Math.max(1, 2), foo());
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/sequential-destructuring-assignment-to-scope-declarations.expect.md
+4 -4
@@ -38,11 +38,11 @@ export const FIXTURE_ENTRYPOINT = {
38 ## Code
39
40 ```javascript
41 -import { c as useMemoCache } from "react/compiler-runtime";
41 +import { c as _c } from "react/compiler-runtime";
42 import { identity } from "shared-runtime";
43
44 function Component(statusName) {
45 - const $ = useMemoCache(12);
45 + const $ = _c(12);
46 let text;
47 let t0;
48 let t1;
@@ -92,7 +92,7 @@ function Component(statusName) {
92 }
93
94 function foo(name) {
95 - const $ = useMemoCache(2);
95 + const $ = _c(2);
96
97 const t0 = `${name}!`;
98 let t1;
@@ -107,7 +107,7 @@ function foo(name) {
107 }
108
109 function getStyles(status) {
110 - const $ = useMemoCache(1);
110 + const $ = _c(1);
111 let t0;
112 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
113 t0 = { bg: "#eee8d5", color: "#657b83" };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/sequential-destructuring-both-mixed-local-and-scope-declaration.expect.md
+4 -4
@@ -41,11 +41,11 @@ export const FIXTURE_ENTRYPOINT = {
41 ## Code
42
43 ```javascript
44 -import { c as useMemoCache } from "react/compiler-runtime";
44 +import { c as _c } from "react/compiler-runtime";
45 import { identity } from "shared-runtime";
46
47 function Component(statusName) {
48 - const $ = useMemoCache(12);
48 + const $ = _c(12);
49 let t0;
50 let text;
51 let font;
@@ -97,7 +97,7 @@ function Component(statusName) {
97 }
98
99 function foo(name) {
100 - const $ = useMemoCache(2);
100 + const $ = _c(2);
101
102 const t0 = `${name}!`;
103 let t1;
@@ -112,7 +112,7 @@ function foo(name) {
112 }
113
114 function getStyles(status) {
115 - const $ = useMemoCache(1);
115 + const $ = _c(1);
116 let t0;
117 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
118 t0 = { font: "comic-sans", color: "#657b83" };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/simple-alias.expect.md
+2 -2
@@ -19,10 +19,10 @@ function foo() {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function mutate() {}
24 function foo() {
25 - const $ = useMemoCache(2);
25 + const $ = _c(2);
26 let a;
27 let c;
28 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/simple-function-1.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function component() {
25 - const $ = useMemoCache(1);
25 + const $ = _c(1);
26 let t0;
27 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28 t0 = function (a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/simple-scope.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function foo(a) {
23 - const $ = useMemoCache(2);
23 + const $ = _c(2);
24 let t0;
25 if ($[0] !== a.b) {
26 t0 = [a.b];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/simple.expect.md
+2 -2
@@ -14,9 +14,9 @@ export default function foo(x, y) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react/compiler-runtime";
17 +import { c as _c } from "react/compiler-runtime";
18 export default function foo(x, y) {
19 - const $ = useMemoCache(4);
19 + const $ = _c(4);
20 if (x) {
21 let t0;
22 if ($[0] !== y) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-arrayexpression.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function Component(props) {
25 - const $ = useMemoCache(1);
25 + const $ = _c(1);
26 let t0;
27 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28 t0 = [1, 2];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-call-jsx-2.expect.md
+2 -2
@@ -21,11 +21,11 @@ function Component(props) {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime"; // @Pass runMutableRangeAnalysis
24 +import { c as _c } from "react/compiler-runtime"; // @Pass runMutableRangeAnalysis
25 function foo() {}
26
27 function Component(props) {
28 - const $ = useMemoCache(1);
28 + const $ = _c(1);
29 let t0;
30 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
31 const a = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-call-jsx.expect.md
+2 -2
@@ -18,11 +18,11 @@ function Component(props) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function foo() {}
23
24 function Component(props) {
25 - const $ = useMemoCache(1);
25 + const $ = _c(1);
26 let t0;
27 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28 const a = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-cascading-eliminated-phis.expect.md
+2 -2
@@ -29,9 +29,9 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime";
32 +import { c as _c } from "react/compiler-runtime";
33 function Component(props) {
34 - const $ = useMemoCache(4);
34 + const $ = _c(4);
35 let x = 0;
36 let values;
37 if ($[0] !== props || $[1] !== x) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-for-of.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function foo(cond) {
29 - const $ = useMemoCache(1);
29 + const $ = _c(1);
30 let t0;
31 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
32 t0 = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-leave-case.expect.md
+2 -2
@@ -22,9 +22,9 @@ function Component(props) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function Component(props) {
27 - const $ = useMemoCache(6);
27 + const $ = _c(6);
28 let x;
29 let y;
30 if ($[0] !== props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-newexpression.expect.md
+2 -2
@@ -16,11 +16,11 @@ function Component(props) {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react/compiler-runtime";
19 +import { c as _c } from "react/compiler-runtime";
20 function Foo() {}
21
22 function Component(props) {
23 - const $ = useMemoCache(1);
23 + const $ = _c(1);
24 let t0;
25 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
26 const a = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-non-empty-initializer.expect.md
+2 -2
@@ -23,9 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function foo(a, b) {
28 - const $ = useMemoCache(1);
28 + const $ = _c(1);
29 let t0;
30 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
31 t0 = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-objectexpression-phi.expect.md
+2 -2
@@ -27,9 +27,9 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 function foo() {
32 - const $ = useMemoCache(1);
32 + const $ = _c(1);
33 let t0;
34 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
35 t0 = { x: 1, y: 3 };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-objectexpression.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function Component(props) {
25 - const $ = useMemoCache(1);
25 + const $ = _c(1);
26 let t0;
27 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28 t0 = { a: 1, b: 2 };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-alias-alias-mutate-if.expect.md
+2 -2
@@ -21,9 +21,9 @@ function foo(a) {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function foo(a) {
26 - const $ = useMemoCache(2);
26 + const $ = _c(2);
27 let x;
28 if ($[0] !== a) {
29 const b = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-alias-if.expect.md
+2 -2
@@ -25,9 +25,9 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 function foo(a) {
30 - const $ = useMemoCache(4);
30 + const $ = _c(4);
31 let x;
32 if ($[0] !== a) {
33 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-alias-mutate-if.expect.md
+2 -2
@@ -20,9 +20,9 @@ function foo(a) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function foo(a) {
25 - const $ = useMemoCache(2);
25 + const $ = _c(2);
26 let x;
27 if ($[0] !== a) {
28 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-alias-mutate-inside-if.expect.md
+2 -2
@@ -20,9 +20,9 @@ function foo(a) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function foo(a) {
25 - const $ = useMemoCache(3);
25 + const $ = _c(3);
26 let x;
27 if ($[0] !== a) {
28 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-alias-mutate.expect.md
+2 -2
@@ -18,9 +18,9 @@ function foo() {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function foo() {
23 - const $ = useMemoCache(1);
23 + const $ = _c(1);
24 let y;
25 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
26 const a = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-call.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function foo() {
25 - const $ = useMemoCache(1);
25 + const $ = _c(1);
26 let y;
27 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28 const x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-mutate-2.expect.md
+2 -2
@@ -15,9 +15,9 @@ function foo() {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react/compiler-runtime";
18 +import { c as _c } from "react/compiler-runtime";
19 function foo() {
20 - const $ = useMemoCache(1);
20 + const $ = _c(1);
21 let y;
22 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
23 const x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-mutate-alias.expect.md
+2 -2
@@ -18,9 +18,9 @@ function foo() {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function foo() {
23 - const $ = useMemoCache(1);
23 + const $ = _c(1);
24 let y;
25 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
26 const a = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-mutate.expect.md
+2 -2
@@ -15,9 +15,9 @@ function foo() {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react/compiler-runtime";
18 +import { c as _c } from "react/compiler-runtime";
19 function foo() {
20 - const $ = useMemoCache(1);
20 + const $ = _c(1);
21 let y;
22 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
23 const x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function foo() {
25 - const $ = useMemoCache(2);
25 + const $ = _c(2);
26 let t0;
27 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28 t0 = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-reassign-in-rval.expect.md
+2 -2
@@ -14,9 +14,9 @@ function Component() {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react/compiler-runtime"; // Forget should call the original x (x = foo()) to compute result
17 +import { c as _c } from "react/compiler-runtime"; // Forget should call the original x (x = foo()) to compute result
18 function Component() {
19 - const $ = useMemoCache(3);
19 + const $ = _c(3);
20 let t0;
21 let x;
22 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-ternary-destruction-with-mutation.expect.md
+2 -2
@@ -15,9 +15,9 @@ function foo(props) {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react/compiler-runtime";
18 +import { c as _c } from "react/compiler-runtime";
19 function foo(props) {
20 - const $ = useMemoCache(2);
20 + const $ = _c(2);
21 let x;
22 if ($[0] !== props) {
23 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-ternary-destruction.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function foo(props) {
25 - const $ = useMemoCache(4);
25 + const $ = _c(4);
26 let x;
27 if ($[0] !== props.bar) {
28 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-ternary-with-mutation.expect.md
+2 -2
@@ -15,9 +15,9 @@ function foo(props) {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react/compiler-runtime";
18 +import { c as _c } from "react/compiler-runtime";
19 function foo(props) {
20 - const $ = useMemoCache(2);
20 + const $ = _c(2);
21 let x;
22 if ($[0] !== props) {
23 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-ternary.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function foo(props) {
25 - const $ = useMemoCache(4);
25 + const $ = _c(4);
26 let x;
27 if ($[0] !== props.bar) {
28 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-unconditional-ternary-with-mutation.expect.md
+2 -2
@@ -28,10 +28,10 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime";
31 +import { c as _c } from "react/compiler-runtime";
32 import { arrayPush } from "shared-runtime";
33 function foo(props) {
34 - const $ = useMemoCache(2);
34 + const $ = _c(2);
35 let x;
36 if ($[0] !== props) {
37 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-unconditional-ternary.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function foo(props) {
27 - const $ = useMemoCache(4);
27 + const $ = _c(4);
28 let x;
29 if ($[0] !== props.bar) {
30 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-unconditional-with-mutation.expect.md
+2 -2
@@ -23,9 +23,9 @@ function foo(props) {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function foo(props) {
28 - const $ = useMemoCache(2);
28 + const $ = _c(2);
29 let x;
30 if ($[0] !== props) {
31 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-via-destructuring-with-mutation.expect.md
+2 -2
@@ -19,9 +19,9 @@ function foo(props) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function foo(props) {
24 - const $ = useMemoCache(2);
24 + const $ = _c(2);
25 let x;
26 if ($[0] !== props) {
27 ({ x } = { x: [] });
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-via-destructuring.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function foo(props) {
29 - const $ = useMemoCache(4);
29 + const $ = _c(4);
30 let x;
31 if ($[0] !== props.bar) {
32 ({ x } = { x: [] });
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-with-mutation.expect.md
+2 -2
@@ -19,9 +19,9 @@ function foo(props) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function foo(props) {
24 - const $ = useMemoCache(2);
24 + const $ = _c(2);
25 let x;
26 if ($[0] !== props) {
27 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function foo(props) {
29 - const $ = useMemoCache(4);
29 + const $ = _c(4);
30 let x;
31 if ($[0] !== props.bar) {
32 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/store-via-call.expect.md
+2 -2
@@ -14,9 +14,9 @@ function foo() {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react/compiler-runtime";
17 +import { c as _c } from "react/compiler-runtime";
18 function foo() {
19 - const $ = useMemoCache(1);
19 + const $ = _c(1);
20 let x;
21 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
22 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/store-via-new.expect.md
+2 -2
@@ -14,9 +14,9 @@ function Foo() {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react/compiler-runtime";
17 +import { c as _c } from "react/compiler-runtime";
18 function Foo() {
19 - const $ = useMemoCache(1);
19 + const $ = _c(1);
20 let x;
21 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
22 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/switch-non-final-default.expect.md
+2 -2
@@ -31,9 +31,9 @@ function Component(props) {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react/compiler-runtime";
34 +import { c as _c } from "react/compiler-runtime";
35 function Component(props) {
36 - const $ = useMemoCache(9);
36 + const $ = _c(9);
37 let x;
38 let y;
39 if ($[0] !== props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/switch-with-only-default.expect.md
+2 -2
@@ -21,11 +21,11 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 import { Stringify } from "shared-runtime";
26
27 function Component(t0) {
28 - const $ = useMemoCache(5);
28 + const $ = _c(5);
29 let kind;
30 let props;
31 if ($[0] !== t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/switch.expect.md
+2 -2
@@ -26,9 +26,9 @@ function Component(props) {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react/compiler-runtime";
29 +import { c as _c } from "react/compiler-runtime";
30 function Component(props) {
31 - const $ = useMemoCache(8);
31 + const $ = _c(8);
32 let x;
33 let y;
34 if ($[0] !== props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/tagged-template-literal.expect.md
+2 -2
@@ -24,9 +24,9 @@ function component() {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function component() {
29 - const $ = useMemoCache(1);
29 + const $ = _c(1);
30 let t0;
31 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
32 t0 = graphql`
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/temporary-accessed-outside-scope.expect.md
+2 -2
@@ -13,9 +13,9 @@ function Component(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react/compiler-runtime";
16 +import { c as _c } from "react/compiler-runtime";
17 function Component(props) {
18 - const $ = useMemoCache(6);
18 + const $ = _c(6);
19 let t0;
20 let t1;
21 if ($[0] !== props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/temporary-at-start-of-value-block.expect.md
+2 -2
@@ -13,9 +13,9 @@ function component(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react/compiler-runtime";
16 +import { c as _c } from "react/compiler-runtime";
17 function component(props) {
18 - const $ = useMemoCache(2);
18 + const $ = _c(2);
19 let t0;
20 if ($[0] !== props) {
21 t0 = isMenuShown ? <Bar> {props.a ? props.b : props.c}</Bar> : null;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/temporary-property-load-accessed-outside-scope.expect.md
+2 -2
@@ -13,9 +13,9 @@ function Component(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react/compiler-runtime";
16 +import { c as _c } from "react/compiler-runtime";
17 function Component(props) {
18 - const $ = useMemoCache(6);
18 + const $ = _c(6);
19 let t0;
20 let t1;
21 if ($[0] !== props.value) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/timers.expect.md
+2 -2
@@ -18,9 +18,9 @@ function Component(props) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Component(props) {
23 - const $ = useMemoCache(2);
23 + const $ = _c(2);
24 const start = performance.now();
25 let t0;
26 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/todo-function-expression-captures-value-later-frozen.expect.md
+2 -2
@@ -22,9 +22,9 @@ function Component(props) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function Component(props) {
27 - const $ = useMemoCache(4);
27 + const $ = _c(4);
28 let x;
29 if ($[0] !== props.cond) {
30 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/todo.unnecessary-lambda-memoization.expect.md
+2 -2
@@ -22,9 +22,9 @@ function Component(props) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function Component(props) {
27 - const $ = useMemoCache(5);
27 + const $ = _c(5);
28 const data = useFreeze();
29 let t0;
30 if ($[0] !== data.items) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/transitive-freeze-array.expect.md
+2 -2
@@ -25,11 +25,11 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
28 +import { c as _c } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
29 const { mutate } = require("shared-runtime");
30
31 function Component(props) {
32 - const $ = useMemoCache(1);
32 + const $ = _c(1);
33 let t0;
34 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
35 const x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/transitive-freeze-function-expressions.expect.md
+2 -2
@@ -31,9 +31,9 @@ function Component(props) {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableTransitivelyFreezeFunctionExpressions
34 +import { c as _c } from "react/compiler-runtime"; // @enableTransitivelyFreezeFunctionExpressions
35 function Component(props) {
36 - const $ = useMemoCache(10);
36 + const $ = _c(10);
37 const { data, loadNext, isLoadingNext } =
38 usePaginationFragment(props.key).items ?? [];
39 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-alias-try-values.expect.md
+2 -2
@@ -28,11 +28,11 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime";
31 +import { c as _c } from "react/compiler-runtime";
32 const { throwInput } = require("shared-runtime");
33
34 function Component(props) {
35 - const $ = useMemoCache(1);
35 + const $ = _c(1);
36 let x;
37 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
38 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-in-nested-scope.expect.md
+2 -2
@@ -36,11 +36,11 @@ export const FIXTURE_ENTRYPOINT = {
36 ## Code
37
38 ```javascript
39 -import { c as useMemoCache } from "react/compiler-runtime";
39 +import { c as _c } from "react/compiler-runtime";
40 import { mutate, setProperty, throwErrorWithMessageIf } from "shared-runtime";
41
42 function useFoo(t0) {
43 - const $ = useMemoCache(6);
43 + const $ = _c(6);
44 const { value, cond } = t0;
45 let y;
46 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-mutate-outer-value.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 const { shallowCopy, throwErrorWithMessage } = require("shared-runtime");
29
30 function Component(props) {
31 - const $ = useMemoCache(3);
31 + const $ = _c(3);
32 let x;
33 if ($[0] !== props.a) {
34 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-try-value-modified-in-catch-escaping.expect.md
+2 -2
@@ -27,11 +27,11 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 const { throwInput } = require("shared-runtime");
32
33 function Component(props) {
34 - const $ = useMemoCache(3);
34 + const $ = _c(3);
35 let x;
36 if ($[0] !== props.y || $[1] !== props.e) {
37 try {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-try-value-modified-in-catch.expect.md
+2 -2
@@ -26,11 +26,11 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react/compiler-runtime";
29 +import { c as _c } from "react/compiler-runtime";
30 const { throwInput } = require("shared-runtime");
31
32 function Component(props) {
33 - const $ = useMemoCache(3);
33 + const $ = _c(3);
34 let t0;
35 if ($[0] !== props.y || $[1] !== props.e) {
36 t0 = Symbol.for("react.early_return_sentinel");
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-with-catch-param.expect.md
+2 -2
@@ -27,11 +27,11 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 const { throwInput } = require("shared-runtime");
32
33 function Component(props) {
34 - const $ = useMemoCache(2);
34 + const $ = _c(2);
35 let x;
36 let t0;
37 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-with-return.expect.md
+2 -2
@@ -28,11 +28,11 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime";
31 +import { c as _c } from "react/compiler-runtime";
32 const { shallowCopy, throwInput } = require("shared-runtime");
33
34 function Component(props) {
35 - const $ = useMemoCache(2);
35 + const $ = _c(2);
36 let x;
37 let t0;
38 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-within-function-expression-returns-caught-value.expect.md
+2 -2
@@ -25,11 +25,11 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 import { throwInput } from "shared-runtime";
30
31 function Component(props) {
32 - const $ = useMemoCache(4);
32 + const $ = _c(4);
33 let t0;
34 if ($[0] !== props.value) {
35 t0 = () => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-within-function-expression.expect.md
+2 -2
@@ -23,9 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function Component(props) {
28 - const $ = useMemoCache(2);
28 + const $ = _c(2);
29 let t0;
30 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
31 t0 = () => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-within-mutable-range.expect.md
+2 -2
@@ -25,11 +25,11 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 const { throwErrorWithMessage, shallowCopy } = require("shared-runtime");
30
31 function Component(props) {
32 - const $ = useMemoCache(4);
32 + const $ = _c(4);
33 let x;
34 if ($[0] !== props.value) {
35 x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-within-object-method-returns-caught-value.expect.md
+2 -2
@@ -27,11 +27,11 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 import { throwInput } from "shared-runtime";
32
33 function Component(props) {
34 - const $ = useMemoCache(2);
34 + const $ = _c(2);
35 let t0;
36 if ($[0] !== props.value) {
37 const object = {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-within-object-method.expect.md
+2 -2
@@ -25,9 +25,9 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 function Component(props) {
30 - const $ = useMemoCache(1);
30 + const $ = _c(1);
31 let t0;
32 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
33 const object = {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch.expect.md
+2 -2
@@ -24,11 +24,11 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 const { throwErrorWithMessage } = require("shared-runtime");
29
30 function Component(props) {
31 - const $ = useMemoCache(1);
31 + const $ = _c(1);
32 let x;
33 try {
34 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-alias-declaration.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Component(props) {
23 - const $ = useMemoCache(2);
23 + const $ = _c(2);
24 let t0;
25 if ($[0] !== props.name) {
26 t0 = { name: props.name };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-alias.flow.expect.md
+2 -2
@@ -18,9 +18,9 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function Component(props) {
23 - const $ = useMemoCache(2);
23 + const $ = _c(2);
24 let t0;
25 if ($[0] !== props.name) {
26 t0 = { name: props.name };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-annotations/todo_type-annotations-props.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableUseTypeAnnotations
23 +import { c as _c } from "react/compiler-runtime"; // @enableUseTypeAnnotations
24 function useArray(items) {
25 - const $ = useMemoCache(3);
25 + const $ = _c(3);
26 let t0;
27 if ($[0] !== items) {
28 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-annotations/type-annotation-as-array.expect.md
+3 -3
@@ -23,9 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableUseTypeAnnotations
26 +import { c as _c } from "react/compiler-runtime"; // @enableUseTypeAnnotations
27 function Component(props) {
28 - const $ = useMemoCache(4);
28 + const $ = _c(4);
29 let t0;
30 if ($[0] !== props.id) {
31 t0 = makeArray(props.id);
@@ -48,7 +48,7 @@ function Component(props) {
48 }
49
50 function makeArray(x) {
51 - const $ = useMemoCache(2);
51 + const $ = _c(2);
52 let t0;
53 if ($[0] !== x) {
54 t0 = [x];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-annotations/type-annotation-as-array_.flow.expect.md
+2 -2
@@ -21,11 +21,11 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 import { identity, makeArray } from "shared-runtime";
26
27 function Component(props) {
28 - const $ = useMemoCache(4);
28 + const $ = _c(4);
29 let t0;
30 if ($[0] !== props.id) {
31 t0 = makeArray(props.id);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-annotations/type-annotation-var-array.expect.md
+3 -3
@@ -23,9 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableUseTypeAnnotations
26 +import { c as _c } from "react/compiler-runtime"; // @enableUseTypeAnnotations
27 function Component(props) {
28 - const $ = useMemoCache(4);
28 + const $ = _c(4);
29 let t0;
30 if ($[0] !== props.id) {
31 t0 = makeArray(props.id);
@@ -48,7 +48,7 @@ function Component(props) {
48 }
49
50 function makeArray(x) {
51 - const $ = useMemoCache(2);
51 + const $ = _c(2);
52 let t0;
53 if ($[0] !== x) {
54 t0 = [x];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-annotations/type-annotation-var-array_.flow.expect.md
+3 -3
@@ -25,11 +25,11 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 import { identity } from "shared-runtime";
30
31 function Component(props) {
32 - const $ = useMemoCache(4);
32 + const $ = _c(4);
33 let t0;
34 if ($[0] !== props.id) {
35 t0 = makeArray(props.id);
@@ -52,7 +52,7 @@ function Component(props) {
52 }
53
54 function makeArray(x) {
55 - const $ = useMemoCache(2);
55 + const $ = _c(2);
56 let t0;
57 if ($[0] !== x) {
58 t0 = [x];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-cast-expression.flow.expect.md
+2 -2
@@ -22,10 +22,10 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 type Foo = { bar: string };
27 function Component(props) {
28 - const $ = useMemoCache(2);
28 + const $ = _c(2);
29 let y;
30 if ($[0] !== props.bar) {
31 const x = { bar: props.bar };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-field-load.expect.md
+2 -2
@@ -19,9 +19,9 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function component() {
24 - const $ = useMemoCache(1);
24 + const $ = _c(1);
25 let t0;
26 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
27 t0 = { t: 1 };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-test-field-load-binary-op.expect.md
+2 -2
@@ -19,9 +19,9 @@ function component() {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function component() {
24 - const $ = useMemoCache(2);
24 + const $ = _c(2);
25 let t0;
26 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
27 t0 = makeSomePrimitive();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-test-field-store.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react/compiler-runtime";
24 +import { c as _c } from "react/compiler-runtime";
25 function component() {
26 - const $ = useMemoCache(1);
26 + const $ = _c(1);
27 let x;
28 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
29 x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-test-polymorphic.expect.md
+2 -2
@@ -22,9 +22,9 @@ function component() {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function component() {
27 - const $ = useMemoCache(2);
27 + const $ = _c(2);
28 const p = makePrimitive();
29 let t0;
30 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-test-return-type-inference.expect.md
+2 -2
@@ -18,9 +18,9 @@ function component() {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react/compiler-runtime";
21 +import { c as _c } from "react/compiler-runtime";
22 function component() {
23 - const $ = useMemoCache(1);
23 + const $ = _c(1);
24 const x = foo();
25 const y = foo();
26 if (x > y) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/unary-expr.expect.md
+2 -2
@@ -25,9 +25,9 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 function component(a) {
30 - const $ = useMemoCache(8);
30 + const $ = _c(8);
31 const t = { t: a };
32 const z = +t.t;
33 const q = -t.t;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/uninitialized-declaration-in-reactive-scope.expect.md
+2 -2
@@ -14,9 +14,9 @@ function Component(props) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react/compiler-runtime";
17 +import { c as _c } from "react/compiler-runtime";
18 function Component(props) {
19 - const $ = useMemoCache(1);
19 + const $ = _c(1);
20 let t0;
21 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
22 const x = mutate();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/unlabeled-break-within-label-loop.expect.md
+2 -2
@@ -27,9 +27,9 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime";
30 +import { c as _c } from "react/compiler-runtime";
31 function useHook(end) {
32 - const $ = useMemoCache(2);
32 + const $ = _c(2);
33 let log;
34 if ($[0] !== end) {
35 log = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/unlabeled-break-within-label-switch.expect.md
+2 -2
@@ -30,11 +30,11 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react/compiler-runtime";
33 +import { c as _c } from "react/compiler-runtime";
34 import { CONST_STRING0 } from "shared-runtime";
35
36 function useHook(cond) {
37 - const $ = useMemoCache(2);
37 + const $ = _c(2);
38 let log;
39 if ($[0] !== cond) {
40 log = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/unmemoized-nonreactive-dependency-is-pruned-as-dependency.expect.md
+2 -2
@@ -25,11 +25,11 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 import { mutate, useNoAlias } from "shared-runtime";
30
31 function Component(props) {
32 - const $ = useMemoCache(1);
32 + const $ = _c(1);
33
34 const x = [];
35 useNoAlias();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/unused-object-element-with-rest.expect.md
+2 -2
@@ -19,9 +19,9 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function Foo(props) {
24 - const $ = useMemoCache(2);
24 + const $ = _c(2);
25 let rest;
26 if ($[0] !== props.a) {
27 const { unused, ...t0 } = props.a;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/update-expression-constant-propagation.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function Component() {
27 - const $ = useMemoCache(1);
27 + const $ = _c(1);
28 let t0;
29 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
30 t0 = { a: 0, b: 0, c: 2, d: 2, e: 0 };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/update-expression-in-sequence.expect.md
+2 -2
@@ -24,9 +24,9 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function Component(props) {
29 - const $ = useMemoCache(5);
29 + const $ = _c(5);
30 let a = props.x;
31 let b;
32 let c;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/update-expression-on-function-parameter-1.expect.md
+2 -2
@@ -23,9 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react/compiler-runtime";
26 +import { c as _c } from "react/compiler-runtime";
27 function Component(t0) {
28 - const $ = useMemoCache(10);
28 + const $ = _c(10);
29 let { a, b: t1, c: t2 } = t0;
30 let [b] = t1;
31 let { c } = t2;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/update-expression-on-function-parameter-2.expect.md
+2 -2
@@ -19,9 +19,9 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function Component(a) {
24 - const $ = useMemoCache(4);
24 + const $ = _c(4);
25 const d = a++;
26 const e = ++a;
27 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/update-expression-on-function-parameter-3.expect.md
+2 -2
@@ -19,9 +19,9 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function Component(t0) {
24 - const $ = useMemoCache(4);
24 + const $ = _c(4);
25 let { c } = t0;
26 const h = c++;
27 const i = --c;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/update-expression-on-function-parameter-4.expect.md
+2 -2
@@ -19,9 +19,9 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function Component(t0) {
24 - const $ = useMemoCache(4);
24 + const $ = _c(4);
25 let [b] = t0;
26 const f = b--;
27 const g = --b;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/update-expression.expect.md
+2 -2
@@ -20,9 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 function foo(props) {
25 - const $ = useMemoCache(4);
25 + const $ = _c(4);
26 let x = props.x;
27 const y = x++;
28 const z = x--;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/use-callback-simple.expect.md
+2 -2
@@ -14,9 +14,9 @@ function component() {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react/compiler-runtime";
17 +import { c as _c } from "react/compiler-runtime";
18 function component() {
19 - const $ = useMemoCache(4);
19 + const $ = _c(4);
20 const [count, setCount] = useState(0);
21 let t0;
22 if ($[0] !== count) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/use-memo-simple.expect.md
+2 -2
@@ -19,10 +19,10 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 function Component(props) {
24 "use memo";
25 - const $ = useMemoCache(4);
25 + const $ = _c(4);
26 let t0;
27 if ($[0] !== props.foo) {
28 t0 = [props.foo];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/use-operator-call-expression.expect.md
+3 -3
@@ -41,13 +41,13 @@ export const FIXTURE_ENTRYPOINT = {
41 ## Code
42
43 ```javascript
44 -import { c as useMemoCache } from "react/compiler-runtime";
44 +import { c as _c } from "react/compiler-runtime";
45 import { ValidateMemoization } from "shared-runtime";
46 import { use, useMemo } from "react";
47
48 const FooContext = React.createContext(null);
49 function Component(props) {
50 - const $ = useMemoCache(3);
50 + const $ = _c(3);
51 let t0;
52 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
53 t0 = <Inner />;
@@ -67,7 +67,7 @@ function Component(props) {
67 }
68
69 function Inner(props) {
70 - const $ = useMemoCache(7);
70 + const $ = _c(7);
71 const input = use(FooContext);
72 let t0;
73 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/use-operator-conditional.expect.md
+3 -3
@@ -50,13 +50,13 @@ export const FIXTURE_ENTRYPOINT = {
50 ## Code
51
52 ```javascript
53 -import { c as useMemoCache } from "react/compiler-runtime";
53 +import { c as _c } from "react/compiler-runtime";
54 import { ValidateMemoization } from "shared-runtime";
55 import { use, useMemo } from "react";
56
57 const FooContext = React.createContext(null);
58 function Component(props) {
59 - const $ = useMemoCache(5);
59 + const $ = _c(5);
60 let t0;
61 if ($[0] !== props.cond) {
62 t0 = <Inner cond={props.cond} />;
@@ -78,7 +78,7 @@ function Component(props) {
78 }
79
80 function Inner(props) {
81 - const $ = useMemoCache(7);
81 + const $ = _c(7);
82 let input;
83 input = null;
84 if (props.cond) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/use-operator-method-call.expect.md
+3 -3
@@ -42,14 +42,14 @@ export const FIXTURE_ENTRYPOINT = {
42 ## Code
43
44 ```javascript
45 -import { c as useMemoCache } from "react/compiler-runtime";
45 +import { c as _c } from "react/compiler-runtime";
46 import { ValidateMemoization } from "shared-runtime";
47 import { useMemo } from "react";
48 import * as React from "react";
49
50 const FooContext = React.createContext(null);
51 function Component(props) {
52 - const $ = useMemoCache(3);
52 + const $ = _c(3);
53 let t0;
54 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
55 t0 = <Inner />;
@@ -69,7 +69,7 @@ function Component(props) {
69 }
70
71 function Inner(props) {
72 - const $ = useMemoCache(7);
72 + const $ = _c(7);
73 const input = React.use(FooContext);
74 let t0;
75 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useCallback-call-second-function-which-captures-maybe-mutable-value-dont-preserve-memoization.expect.md
+2 -2
@@ -39,7 +39,7 @@ export const FIXTURE_ENTRYPOINT = {
39 ## Code
40
41 ```javascript
42 -import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees:false @enableTransitivelyFreezeFunctionExpressions:false
42 +import { c as _c } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees:false @enableTransitivelyFreezeFunctionExpressions:false
43 import { useCallback } from "react";
44 import {
45 identity,
@@ -49,7 +49,7 @@ import {
49 } from "shared-runtime";
50
51 function Component(props) {
52 - const $ = useMemoCache(1);
52 + const $ = _c(1);
53 const object = makeObject_Primitives();
54
55 useHook();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useCallback-call-second-function-which-captures-maybe-mutable-value-preserve-memoization.expect.md
+2 -2
@@ -39,7 +39,7 @@ export const FIXTURE_ENTRYPOINT = {
39 ## Code
40
41 ```javascript
42 -import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
42 +import { c as _c } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
43 import { useCallback } from "react";
44 import {
45 identity,
@@ -49,7 +49,7 @@ import {
49 } from "shared-runtime";
50
51 function Component(props) {
52 - const $ = useMemoCache(4);
52 + const $ = _c(4);
53 let t0;
54 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
55 t0 = makeObject_Primitives();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useCallback-maybe-modify-free-variable-preserve-memoization-guarantee.expect.md
+2 -2
@@ -35,7 +35,7 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
38 +import { c as _c } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
39 import { useCallback } from "react";
40 import {
41 identity,
@@ -45,7 +45,7 @@ import {
45 } from "shared-runtime";
46
47 function Component(props) {
48 - const $ = useMemoCache(4);
48 + const $ = _c(4);
49 let t0;
50 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
51 t0 = makeObject_Primitives();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useCallback-multiple-callbacks-modifying-same-ref-preserve-memoization.expect.md
+2 -2
@@ -31,11 +31,11 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
34 +import { c as _c } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
35 import { useCallback, useRef } from "react";
36
37 function Component(props) {
38 - const $ = useMemoCache(6);
38 + const $ = _c(6);
39 let t0;
40 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
41 t0 = { inner: null };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useCallback-set-ref-nested-property-dont-preserve-memoization.expect.md
+2 -2
@@ -29,11 +29,11 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees:false
32 +import { c as _c } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees:false
33 import { useCallback, useRef } from "react";
34
35 function Component(props) {
36 - const $ = useMemoCache(3);
36 + const $ = _c(3);
37 let t0;
38 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
39 t0 = { inner: null };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useCallback-set-ref-nested-property-preserve-memoization.expect.md
+2 -2
@@ -27,11 +27,11 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
30 +import { c as _c } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
31 import { useCallback, useRef } from "react";
32
33 function Component(props) {
34 - const $ = useMemoCache(4);
34 + const $ = _c(4);
35 let t0;
36 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
37 t0 = { inner: null };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useCallback-set-ref-nested-property.expect.md
+2 -2
@@ -28,13 +28,13 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react/compiler-runtime";
31 +import { c as _c } from "react/compiler-runtime";
32 import { useCallback, useRef } from "react";
33
34 // Identical to useCallback-set-ref-nested-property-preserve-memoization,
35 // but with a different set of compiler flags
36 function Component(t0) {
37 - const $ = useMemoCache(4);
37 + const $ = _c(4);
38 let t1;
39 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
40 t1 = { inner: null };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useCallback-set-ref-value-dont-preserve-memoization.expect.md
+2 -2
@@ -27,11 +27,11 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
30 +import { c as _c } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
31 import { useCallback, useRef } from "react";
32
33 function Component(props) {
34 - const $ = useMemoCache(3);
34 + const $ = _c(3);
35 const ref = useRef(null);
36 let t0;
37 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useCallback-set-ref-value-preserve-memoization.expect.md
+2 -2
@@ -27,11 +27,11 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
30 +import { c as _c } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
31 import { useCallback, useRef } from "react";
32
33 function Component(props) {
34 - const $ = useMemoCache(3);
34 + const $ = _c(3);
35 const ref = useRef(null);
36 let t0;
37 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useContext-maybe-mutate-context-in-callback.expect.md
+2 -2
@@ -30,7 +30,7 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react/compiler-runtime";
33 +import { c as _c } from "react/compiler-runtime";
34 import * as React from "react";
35 import { useContext } from "react";
36 import { mutate } from "shared-runtime";
@@ -38,7 +38,7 @@ import { mutate } from "shared-runtime";
38 const FooContext = React.createContext({ current: null });
39
40 function Component(props) {
41 - const $ = useMemoCache(5);
41 + const $ = _c(5);
42 const Foo = useContext(FooContext);
43 let t0;
44 if ($[0] !== Foo.current) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useContext-read-context-in-callback-if-condition.expect.md
+2 -2
@@ -32,14 +32,14 @@ export const FIXTURE_ENTRYPOINT = {
32 ## Code
33
34 ```javascript
35 -import { c as useMemoCache } from "react/compiler-runtime";
35 +import { c as _c } from "react/compiler-runtime";
36 import { createContext, useContext } from "react";
37 import { Stringify } from "shared-runtime";
38
39 const FooContext = createContext({ current: true });
40
41 function Component(props) {
42 - const $ = useMemoCache(6);
42 + const $ = _c(6);
43 const foo = useContext(FooContext);
44 let t0;
45 if ($[0] !== foo.current) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useContext-read-context-in-callback.expect.md
+2 -2
@@ -25,13 +25,13 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react/compiler-runtime";
28 +import { c as _c } from "react/compiler-runtime";
29 import { createContext, useContext } from "react";
30
31 const FooContext = createContext({ current: null });
32
33 function Component(props) {
34 - const $ = useMemoCache(5);
34 + const $ = _c(5);
35 const foo = useContext(FooContext);
36 let t0;
37 if ($[0] !== foo.current) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useEffect-arg-memoized.expect.md
+2 -2
@@ -24,9 +24,9 @@ function Component(props) {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react/compiler-runtime";
27 +import { c as _c } from "react/compiler-runtime";
28 function Component(props) {
29 - const $ = useMemoCache(6);
29 + const $ = _c(6);
30 const dispatch = useDispatch();
31 useFreeze(dispatch);
32 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useEffect-external-mutate.expect.md
+2 -2
@@ -22,13 +22,13 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 import { useEffect } from "react";
27
28 let x = { a: 42 };
29
30 function Component(props) {
31 - const $ = useMemoCache(1);
31 + const $ = _c(1);
32 let t0;
33 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
34 t0 = () => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useEffect-global-pruned.expect.md
+2 -2
@@ -31,12 +31,12 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react/compiler-runtime";
34 +import { c as _c } from "react/compiler-runtime";
35 import { useEffect } from "react";
36
37 function someGlobal() {}
38 function useFoo() {
39 - const $ = useMemoCache(3);
39 + const $ = _c(3);
40 let t0;
41 let t1;
42 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useEffect-method-call.expect.md
+2 -2
@@ -19,10 +19,10 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react/compiler-runtime";
22 +import { c as _c } from "react/compiler-runtime";
23 let x = {};
24 function Component() {
25 - const $ = useMemoCache(1);
25 + const $ = _c(1);
26 let t0;
27 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28 t0 = () => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useEffect-namespace-pruned.expect.md
+2 -2
@@ -31,12 +31,12 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react/compiler-runtime";
34 +import { c as _c } from "react/compiler-runtime";
35 import * as React from "react";
36
37 function someGlobal() {}
38 function useFoo() {
39 - const $ = useMemoCache(3);
39 + const $ = _c(3);
40 let t0;
41 let t1;
42 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useEffect-nested-lambdas.expect.md
+2 -2
@@ -32,10 +32,10 @@ function Component(props) {
32 ## Code
33
34 ```javascript
35 -import { c as useMemoCache } from "react/compiler-runtime"; // @enableTransitivelyFreezeFunctionExpressions:false
35 +import { c as _c } from "react/compiler-runtime"; // @enableTransitivelyFreezeFunctionExpressions:false
36
37 function Component(props) {
38 - const $ = useMemoCache(9);
38 + const $ = _c(9);
39 const item = useMutable(props.itemId);
40 const dispatch = useDispatch();
41 useFreeze(dispatch);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-if-else-multiple-return.expect.md
+2 -2
@@ -17,9 +17,9 @@ function Component(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime";
20 +import { c as _c } from "react/compiler-runtime";
21 function Component(props) {
22 - const $ = useMemoCache(4);
22 + const $ = _c(4);
23 let t0;
24 bb0: {
25 if (props.cond) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-independently-memoizeable.expect.md
+2 -2
@@ -17,9 +17,9 @@ function Component(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react/compiler-runtime";
20 +import { c as _c } from "react/compiler-runtime";
21 function Component(props) {
22 - const $ = useMemoCache(10);
22 + const $ = _c(10);
23 let t0;
24 let t1;
25 if ($[0] !== props.a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-inlining-block-return.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime";
25 +import { c as _c } from "react/compiler-runtime";
26 function component(a, b) {
27 - const $ = useMemoCache(2);
27 + const $ = _c(2);
28 let t0;
29 bb0: {
30 if (a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-mabye-modified-free-variable-preserve-memoization-guarantees.expect.md
+2 -2
@@ -46,7 +46,7 @@ export const FIXTURE_ENTRYPOINT = {
46 ## Code
47
48 ```javascript
49 -import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
49 +import { c as _c } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
50 import { useMemo } from "react";
51 import {
52 identity,
@@ -56,7 +56,7 @@ import {
56 } from "shared-runtime";
57
58 function Component(props) {
59 - const $ = useMemoCache(4);
59 + const $ = _c(4);
60 let t0;
61 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
62 t0 = makeObject_Primitives();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-maybe-modified-later-dont-preserve-memoization-guarantees.expect.md
+2 -2
@@ -22,12 +22,12 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees:false
25 +import { c as _c } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees:false
26 import { useMemo } from "react";
27 import { identity, makeObject_Primitives, mutate } from "shared-runtime";
28
29 function Component(props) {
30 - const $ = useMemoCache(2);
30 + const $ = _c(2);
31 let t0;
32 let object;
33 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-maybe-modified-later-preserve-memoization-guarantees.expect.md
+2 -2
@@ -22,12 +22,12 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
25 +import { c as _c } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
26 import { useMemo } from "react";
27 import { identity, makeObject_Primitives, mutate } from "shared-runtime";
28
29 function Component(props) {
30 - const $ = useMemoCache(1);
30 + const $ = _c(1);
31 let t0;
32 let t1;
33 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-multiple-if-else.expect.md
+2 -2
@@ -29,11 +29,11 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react/compiler-runtime";
32 +import { c as _c } from "react/compiler-runtime";
33 import { useMemo } from "react";
34
35 function Component(props) {
36 - const $ = useMemoCache(3);
36 + const $ = _c(3);
37 let t0;
38 bb0: {
39 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-named-function.expect.md
+2 -2
@@ -20,12 +20,12 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react/compiler-runtime";
23 +import { c as _c } from "react/compiler-runtime";
24 import { useMemo } from "react";
25 import { makeArray } from "shared-runtime";
26
27 function Component() {
28 - const $ = useMemoCache(1);
28 + const $ = _c(1);
29 let t0;
30 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
31 t0 = makeArray();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-simple.expect.md
+2 -2
@@ -12,9 +12,9 @@ function component(a) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react/compiler-runtime";
15 +import { c as _c } from "react/compiler-runtime";
16 function component(a) {
17 - const $ = useMemoCache(4);
17 + const $ = _c(4);
18 let t0;
19 let t1;
20 if ($[0] !== a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/userspace-use-memo-cache.expect.md
+2 -2
@@ -29,9 +29,9 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react-forget-runtime"; // @runtimeModule="react-forget-runtime"
32 +import { c as _c } from "react-forget-runtime"; // @runtimeModule="react-forget-runtime"
33 function Component(props) {
34 - const $ = useMemoCache(5);
34 + const $ = _c(5);
35 const [x, setX] = useState(1);
36 let y;
37 if ($[0] !== props.cond || $[1] !== x) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/validate-no-set-state-in-render-uncalled-function-with-mutable-range-is-valid.expect.md
+2 -2
@@ -33,9 +33,9 @@ function Component(props) {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react/compiler-runtime"; // @validateNoSetStateInRender @enableAssumeHooksFollowRulesOfReact
36 +import { c as _c } from "react/compiler-runtime"; // @validateNoSetStateInRender @enableAssumeHooksFollowRulesOfReact
37 function Component(props) {
38 - const $ = useMemoCache(7);
38 + const $ = _c(7);
39 const logEvent = useLogging(props.appId);
40 const [currentStep, setCurrentStep] = useState(0);
41 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/validate-no-set-state-in-render-unconditional-lambda-which-conditionally-sets-state-ok.expect.md
+2 -2
@@ -37,11 +37,11 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react/compiler-runtime"; // @validateNoSetStateInRender
40 +import { c as _c } from "react/compiler-runtime"; // @validateNoSetStateInRender
41 import { useState } from "react";
42
43 function Component(props) {
44 - const $ = useMemoCache(2);
44 + const $ = _c(2);
45 const [x, setX] = useState(0);
46
47 const foo = () => {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/value-block-mutates-outer-value.expect.md
+2 -2
@@ -34,7 +34,7 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react/compiler-runtime";
37 +import { c as _c } from "react/compiler-runtime";
38 import { makeArray, useHook } from "shared-runtime";
39
40 /**
@@ -46,7 +46,7 @@ import { makeArray, useHook } from "shared-runtime";
46 * merged with the scope producing customList
47 */
48 function Foo(t0) {
49 - const $ = useMemoCache(1);
49 + const $ = _c(1);
50 const { defaultList, cond } = t0;
51 let t1;
52 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {