@samitouri / QOS-React-1 / commits / e2d47342be

Use default runtimeModule setting in Snap tests (#2940)

Lots of updated snapshots. The only updated code is resolving this TODO: https://github.com/facebook/react-forget/blob/2b14805f98e47acdf4b83c7d078fe6727800b3f9/packages/snap/src/compiler.ts#L41

Jan Kassens committed May 6, 2024 at 19:57 UTC e2d47342bee8e2c83ade7764a37e04dc6e9ab0e5
737 files changed +822 -787
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/alias-capture-in-method-receiver-and-mutate.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 import { makeObject_Primitives, mutate } from "shared-runtime";
32
33 function Component() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/alias-capture-in-method-receiver.expect.md
+1 -1
@@ -18,7 +18,7 @@ function Component() {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Component() {
23 const $ = useMemoCache(2);
24 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/alias-computed-load.expect.md
+1 -1
@@ -16,7 +16,7 @@ function component(a) {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function component(a) {
21 const $ = useMemoCache(2);
22 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/alias-nested-member-path-mutate.expect.md
+1 -1
@@ -17,7 +17,7 @@ function component() {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react";
20 +import { c as useMemoCache } from "react/compiler-runtime";
21 function component() {
22 const $ = useMemoCache(1);
23 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/alias-nested-member-path.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function component() {
27 const $ = useMemoCache(2);
28 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/alias-while.expect.md
+1 -1
@@ -26,7 +26,7 @@ function mutate(x, y) {}
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react";
29 +import { c as useMemoCache } from "react/compiler-runtime";
30 function foo(cond) {
31 const $ = useMemoCache(2);
32 let a;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/align-scopes-within-nested-valueblock-in-array.expect.md
+1 -1
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react"; // @enableReactiveScopesInHIR:false
40 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
41
42 import { Stringify, identity, makeArray, mutate } from "shared-runtime";
43
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allocating-logical-expression-instruction-scope.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } 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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allocating-primitive-as-dep-nested-scope.expect.md
+1 -1
@@ -19,7 +19,7 @@ function AllocatingPrimitiveAsDepNested(props) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react"; // bar(props.b) is an allocating expression that produces a primitive, which means
22 +import { c as useMemoCache } 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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allocating-primitive-as-dep.expect.md
+1 -1
@@ -16,7 +16,7 @@ function AllocatingPrimitiveAsDep(props) {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react"; // bar(props.b) is an allocating expression that produces a primitive, which means
19 +import { c as useMemoCache } 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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allow-global-reassignment-in-effect-indirect.expect.md
+2 -1
@@ -33,7 +33,8 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { useEffect, useState, c as useMemoCache } from "react";
36 +import { c as useMemoCache } from "react/compiler-runtime";
37 +import { useEffect, useState } from "react";
38
39 let someGlobal = false;
40
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allow-global-reassignment-in-effect.expect.md
+2 -1
@@ -30,7 +30,8 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { useEffect, useState, c as useMemoCache } from "react";
33 +import { c as useMemoCache } from "react/compiler-runtime";
34 +import { useEffect, useState } from "react";
35
36 let someGlobal = false;
37
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allow-mutate-global-in-effect-fixpoint.expect.md
+2 -1
@@ -40,7 +40,8 @@ export const FIXTURE_ENTRYPOINT = {
40 ## Code
41
42 ```javascript
43 -import { useEffect, useState, c as useMemoCache } from "react";
43 +import { c as useMemoCache } from "react/compiler-runtime";
44 +import { useEffect, useState } from "react";
45
46 let someGlobal = { value: null };
47
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allow-passing-refs-as-props.expect.md
+1 -1
@@ -12,7 +12,7 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react";
15 +import { c as useMemoCache } from "react/compiler-runtime";
16 function Component(props) {
17 const $ = useMemoCache(2);
18 const ref = useRef(null);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-access-assignment.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function foo(a, b, c) {
27 const $ = useMemoCache(10);
28 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-at-closure.expect.md
+1 -1
@@ -17,7 +17,7 @@ function Component(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react";
20 +import { c as useMemoCache } from "react/compiler-runtime";
21 function Component(props) {
22 const $ = useMemoCache(7);
23 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-at-effect.expect.md
+1 -1
@@ -17,7 +17,7 @@ function ArrayAtTest(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react"; // arrayInstance.at should have the following effects:
20 +import { c as useMemoCache } from "react/compiler-runtime"; // arrayInstance.at should have the following effects:
21 // - read on arg0
22 // - read on receiver
23 // - mutate on lvalue
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-at-mutate-after-capture.expect.md
+1 -1
@@ -18,7 +18,7 @@ function Component(props) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react"; // x's mutable range should extend to `mutate(y)`
21 +import { c as useMemoCache } from "react/compiler-runtime"; // x's mutable range should extend to `mutate(y)`
22
23 function Component(props) {
24 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-expression-spread.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Component(props) {
23 const $ = useMemoCache(3);
24 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-join.expect.md
+1 -1
@@ -14,7 +14,7 @@ function Component(props) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react";
17 +import { c as useMemoCache } from "react/compiler-runtime";
18 function Component(props) {
19 const $ = useMemoCache(8);
20 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-map-captures-receiver-noAlias.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function Component(props) {
26 const $ = useMemoCache(6);
27 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-map-frozen-array-noAlias.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function Component(props) {
25 const $ = useMemoCache(3);
26 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-map-frozen-array.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function Component(props) {
25 const $ = useMemoCache(3);
26 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-map-mutable-array-mutating-lambda-noAlias.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function Component(props) {
27 const $ = useMemoCache(3);
28 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-map-mutable-array-mutating-lambda.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function Component(props) {
27 const $ = useMemoCache(3);
28 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-map-mutable-array-non-mutating-lambda-mutated-result.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function Component(props) {
27 const $ = useMemoCache(1);
28 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-map-noAlias-escaping-function.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function Component(props) {
24 const $ = useMemoCache(5);
25 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-pattern-params.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function component(t0) {
24 const $ = useMemoCache(7);
25 const [a, b] = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-properties.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function Component(props) {
25 const $ = useMemoCache(7);
26 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-property-call.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function Component(props) {
26 const $ = useMemoCache(11);
27 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-push-effect.expect.md
+1 -1
@@ -19,7 +19,7 @@ function Component(props) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react"; // arrayInstance.push should have the following effects:
22 +import { c as useMemoCache } 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) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/arrow-expr-directive.expect.md
+1 -1
@@ -17,7 +17,7 @@ function Component() {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react";
20 +import { c as useMemoCache } from "react/compiler-runtime";
21 function Component() {
22 "use strict";
23 const $ = useMemoCache(3);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/arrow-function-expr-gating-test.expect.md
+1 -1
@@ -13,7 +13,7 @@ export default ErrorView;
13
14 ```javascript
15 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
16 -import { c as useMemoCache } from "react"; // @gating
16 +import { c as useMemoCache } from "react/compiler-runtime"; // @gating
17 const ErrorView = isForgetEnabled_Fixtures()
18 ? (error, _retry) => {
19 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/arrow-function-one-line-directive.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function useFoo() {
26 const $ = useMemoCache(1);
27 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/assignment-expression-computed.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function Component(props) {
26 const $ = useMemoCache(2);
27 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/assignment-expression-nested-path.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function g(props) {
25 const $ = useMemoCache(2);
26 let a;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/assignment-in-nested-if.expect.md
+1 -1
@@ -19,7 +19,7 @@ function useBar(props) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function useBar(props) {
24 const $ = useMemoCache(1);
25 let z;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/assignment-variations-complex-lvalue-array.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function foo() {
25 const $ = useMemoCache(1);
26 let a;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/assignment-variations-complex-lvalue.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function g() {
25 const $ = useMemoCache(1);
26 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/await-side-effecting-promise.expect.md
+1 -1
@@ -13,7 +13,7 @@ async function Component(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react";
16 +import { c as useMemoCache } from "react/compiler-runtime";
17 async function Component(props) {
18 const $ = useMemoCache(2);
19 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/await.expect.md
+1 -1
@@ -12,7 +12,7 @@ async function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react";
15 +import { c as useMemoCache } from "react/compiler-runtime";
16 async function Component(props) {
17 const $ = useMemoCache(4);
18 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/babel-existing-react-import.expect.md
+2 -1
@@ -23,7 +23,8 @@ function Component2(props) {
23 ## Code
24
25 ```javascript
26 -import { useState, useMemo, c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 +import { useState, useMemo } from "react";
28
29 function Component(props) {
30 const $ = useMemoCache(4);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/babel-existing-react-kitchensink-import.expect.md
+2 -1
@@ -24,8 +24,9 @@ function Component2(props) {
24 ## Code
25
26 ```javascript
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import * as React from "react";
28 -import { useState, useMemo, c as useMemoCache } from "react";
29 +import { useState, useMemo } from "react";
30
31 function Component(props) {
32 const $ = useMemoCache(4);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/babel-existing-react-namespace-import.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 import * as React from "react";
27 import { calculateExpensiveNumber } from "shared-runtime";
28
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/block-scoping-switch-variable-scoping.expect.md
+2 -1
@@ -30,7 +30,8 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { useMemo, c as useMemoCache } from "react";
33 +import { c as useMemoCache } from "react/compiler-runtime";
34 +import { useMemo } from "react";
35
36 function Component(props) {
37 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/bug-invalid-reactivity-value-block.expect.md
+1 -1
@@ -46,7 +46,7 @@ export const FIXTURE_ENTRYPOINT = {
46 ## Code
47
48 ```javascript
49 -import { c as useMemoCache } from "react";
49 +import { c as useMemoCache } from "react/compiler-runtime";
50 import {
51 CONST_TRUE,
52 identity,
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/builtin-jsx-tag-lowered-between-mutations.expect.md
+1 -1
@@ -12,7 +12,7 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react";
15 +import { c as useMemoCache } from "react/compiler-runtime";
16 function Component(props) {
17 const $ = useMemoCache(1);
18 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/call-args-assignment.expect.md
+1 -1
@@ -13,7 +13,7 @@ function Component(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react";
16 +import { c as useMemoCache } from "react/compiler-runtime";
17 function Component(props) {
18 const $ = useMemoCache(1);
19 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/call-args-destructuring-assignment.expect.md
+1 -1
@@ -13,7 +13,7 @@ function Component(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react";
16 +import { c as useMemoCache } from "react/compiler-runtime";
17 function Component(props) {
18 const $ = useMemoCache(1);
19 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/call-spread.expect.md
+1 -1
@@ -12,7 +12,7 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react";
15 +import { c as useMemoCache } from "react/compiler-runtime";
16 function Component(props) {
17 const $ = useMemoCache(3);
18 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/call-with-independently-memoizable-arg.expect.md
+1 -1
@@ -17,7 +17,7 @@ function Component(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react";
20 +import { c as useMemoCache } from "react/compiler-runtime";
21 function Component(props) {
22 const $ = useMemoCache(4);
23 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/call.expect.md
+1 -1
@@ -18,7 +18,7 @@ function Component(props) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function foo() {}
23
24 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capture-indirect-mutate-alias-iife.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function component(a) {
29 const $ = useMemoCache(2);
30 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capture-indirect-mutate-alias.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 function component(a) {
32 const $ = useMemoCache(2);
33 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capture-param-mutate.expect.md
+1 -1
@@ -45,7 +45,7 @@ function getNativeLogFunction(level) {
45 ## Code
46
47 ```javascript
48 -import { c as useMemoCache } from "react";
48 +import { c as useMemoCache } from "react/compiler-runtime";
49 function getNativeLogFunction(level) {
50 const $ = useMemoCache(2);
51 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capture-ref-for-later-mutation.expect.md
+2 -1
@@ -31,7 +31,8 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { useRef, c as useMemoCache } from "react";
34 +import { c as useMemoCache } from "react/compiler-runtime";
35 +import { useRef } from "react";
36 import { addOne } from "shared-runtime";
37
38 function useKeyCommand() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capture_mutate-across-fns-iife.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function component(a) {
27 const $ = useMemoCache(2);
28 let z;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capture_mutate-across-fns.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 function component(a) {
30 const $ = useMemoCache(2);
31 let z;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-arrow-function-1.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function component(a) {
26 const $ = useMemoCache(4);
27 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-fun-alias-captured-mutate-2-iife.expect.md
+1 -1
@@ -26,7 +26,7 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react";
29 +import { c as useMemoCache } from "react/compiler-runtime";
30 import { mutate } from "shared-runtime";
31
32 function component(foo, bar) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-fun-alias-captured-mutate-2.expect.md
+1 -1
@@ -20,7 +20,7 @@ function component(foo, bar) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function component(foo, bar) {
25 const $ = useMemoCache(3);
26 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-fun-alias-captured-mutate-arr-2-iife.expect.md
+1 -1
@@ -26,7 +26,7 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react";
29 +import { c as useMemoCache } from "react/compiler-runtime";
30 const { mutate } = require("shared-runtime");
31
32 function component(foo, bar) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-fun-alias-captured-mutate-arr-2.expect.md
+1 -1
@@ -20,7 +20,7 @@ function component(foo, bar) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function component(foo, bar) {
25 const $ = useMemoCache(3);
26 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-captured-mutate-arr-iife.expect.md
+1 -1
@@ -26,7 +26,7 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react";
29 +import { c as useMemoCache } from "react/compiler-runtime";
30 const { mutate } = require("shared-runtime");
31
32 function component(foo, bar) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-captured-mutate-arr.expect.md
+1 -1
@@ -20,7 +20,7 @@ function component(foo, bar) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function component(foo, bar) {
25 const $ = useMemoCache(3);
26 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-captured-mutate-iife.expect.md
+1 -1
@@ -26,7 +26,7 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react";
29 +import { c as useMemoCache } from "react/compiler-runtime";
30 const { mutate } = require("shared-runtime");
31
32 function component(foo, bar) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-captured-mutate.expect.md
+1 -1
@@ -20,7 +20,7 @@ function component(foo, bar) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function component(foo, bar) {
25 const $ = useMemoCache(3);
26 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-computed-mutate-iife.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 const { mutate } = require("shared-runtime");
29
30 function component(a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-computed-mutate.expect.md
+1 -1
@@ -18,7 +18,7 @@ function component(a) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function component(a) {
23 const $ = useMemoCache(2);
24 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-mutate-iife.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 const { mutate } = require("shared-runtime");
29
30 function component(a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-mutate.expect.md
+1 -1
@@ -18,7 +18,7 @@ function component(a) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function component(a) {
23 const $ = useMemoCache(2);
24 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-receiver-computed-mutate-iife.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 import { mutate } from "shared-runtime";
30
31 function component(a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-receiver-computed-mutate.expect.md
+1 -1
@@ -19,7 +19,7 @@ function component(a) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function component(a) {
24 const $ = useMemoCache(2);
25 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-receiver-mutate-iife.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 const { mutate } = require("shared-runtime");
30
31 function component(a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-receiver-mutate.expect.md
+1 -1
@@ -19,7 +19,7 @@ function component(a) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function component(a) {
24 const $ = useMemoCache(2);
25 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-mutate-2.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function component(a, b) {
29 const $ = useMemoCache(5);
30 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-mutate-3.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function component(a, b) {
28 const $ = useMemoCache(2);
29 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-mutate-nested.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function component(a) {
27 const $ = useMemoCache(2);
28 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-mutate.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function component(a, b) {
29 const $ = useMemoCache(3);
30 let z;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-simple-alias-iife.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 const { mutate } = require("shared-runtime");
29
30 function component(a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-simple-alias.expect.md
+1 -1
@@ -18,7 +18,7 @@ function component(a) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function component(a) {
23 const $ = useMemoCache(2);
24 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-1.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function component(a) {
26 const $ = useMemoCache(4);
27 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-2-iife.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function bar(a) {
28 const $ = useMemoCache(2);
29 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-2.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function bar(a) {
29 const $ = useMemoCache(2);
30 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-3-iife.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 function bar(a, b) {
32 const $ = useMemoCache(3);
33 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-3.expect.md
+1 -1
@@ -28,7 +28,7 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react";
31 +import { c as useMemoCache } from "react/compiler-runtime";
32 function bar(a, b) {
33 const $ = useMemoCache(3);
34 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-4-iife.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function bar(a) {
28 const $ = useMemoCache(2);
29 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-4.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function bar(a) {
29 const $ = useMemoCache(2);
30 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-iife.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function bar(a) {
27 const $ = useMemoCache(2);
28 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function bar(a) {
29 const $ = useMemoCache(2);
30 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-capture-ref-before-rename.expect.md
+1 -1
@@ -22,7 +22,7 @@ function component(a, b) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function component(a, b) {
27 const $ = useMemoCache(7);
28 let z;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-conditional-capture-mutate.expect.md
+1 -1
@@ -22,7 +22,7 @@ function component(a, b) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react"; // @debug
25 +import { c as useMemoCache } from "react/compiler-runtime"; // @debug
26 function component(a, b) {
27 const $ = useMemoCache(5);
28 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-decl.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function component(a) {
27 const $ = useMemoCache(2);
28 let t;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-member-expr-arguments.expect.md
+1 -1
@@ -18,7 +18,7 @@ function Foo(props) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Foo(props) {
23 const $ = useMemoCache(2);
24 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-member-expr-call.expect.md
+1 -1
@@ -19,7 +19,7 @@ function component({ mutator }) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function component(t0) {
24 const $ = useMemoCache(7);
25 const { mutator } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-renamed-ref.expect.md
+1 -1
@@ -18,7 +18,7 @@ function component(a, b) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function component(a, b) {
23 const $ = useMemoCache(2);
24 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-runs-inference.expect.md
+1 -1
@@ -13,7 +13,7 @@ function component(a, b) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react";
16 +import { c as useMemoCache } from "react/compiler-runtime";
17 function component(a, b) {
18 const $ = useMemoCache(6);
19 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-shadow-captured.expect.md
+1 -1
@@ -16,7 +16,7 @@ function component(a) {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function component(a) {
21 const $ = useMemoCache(1);
22 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-skip-computed-path.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function StoreLandingUnseenGiftModalContainer(a) {
23 const $ = useMemoCache(2);
24 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-within-block.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function component(a) {
29 const $ = useMemoCache(4);
30 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-member-expr.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function component(a) {
26 const $ = useMemoCache(4);
27 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-nested-member-call.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function component(a) {
26 const $ = useMemoCache(2);
27 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-nested-member-expr-in-nested-func.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function component(a) {
28 const $ = useMemoCache(4);
29 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-nested-member-expr.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function component(a) {
26 const $ = useMemoCache(4);
27 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-reference-changes-type.expect.md
+1 -1
@@ -17,7 +17,7 @@ function component(a) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react";
20 +import { c as useMemoCache } from "react/compiler-runtime";
21 function component(a) {
22 const $ = useMemoCache(2);
23 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-variable-in-nested-block.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function component(a) {
28 const $ = useMemoCache(4);
29 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-variable-in-nested-function.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function component(a) {
28 const $ = useMemoCache(4);
29 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/chained-assignment-context-variable.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import { makeArray } from "shared-runtime";
29
30 function Component() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/chained-assignment-expressions.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function foo() {
27 const $ = useMemoCache(1);
28 let z;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/codegen-emit-imports-same-source.expect.md
+1 -1
@@ -18,7 +18,7 @@ import {
18 shouldInstrument,
19 makeReadOnly,
20 } from "react-compiler-runtime";
21 -import { c as useMemoCache } from "react"; // @enableEmitFreeze @instrumentForget
21 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableEmitFreeze @instrumentForget
22
23 function useFoo(props) {
24 if (__DEV__ && shouldInstrument)
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/codegen-emit-make-read-only.expect.md
+1 -1
@@ -20,7 +20,7 @@ function MyComponentName(props) {
20
21 ```javascript
22 import { makeReadOnly } from "react-compiler-runtime";
23 -import { c as useMemoCache } from "react"; // @enableEmitFreeze true
23 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableEmitFreeze true
24
25 function MyComponentName(props) {
26 const $ = useMemoCache(5);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/codegen-instrument-forget-gating-test.expect.md
+1 -1
@@ -25,7 +25,7 @@ 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"; // @instrumentForget @compilationMode(annotation) @gating
28 +import { c as useMemoCache } from "react/compiler-runtime"; // @instrumentForget @compilationMode(annotation) @gating
29 const Bar = isForgetEnabled_Fixtures()
30 ? function Bar(props) {
31 "use forget";
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/codegen-instrument-forget-test.expect.md
+1 -1
@@ -24,7 +24,7 @@ function Foo(props) {
24
25 ```javascript
26 import { useRenderCounter, shouldInstrument } from "react-compiler-runtime";
27 -import { c as useMemoCache } from "react"; // @instrumentForget @compilationMode(annotation)
27 +import { c as useMemoCache } from "react/compiler-runtime"; // @instrumentForget @compilationMode(annotation)
28
29 function Bar(props) {
30 "use forget";
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/component-declaration-basic.flow.expect.md
+1 -1
@@ -13,7 +13,7 @@ function shouldNotCompile() {}
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react";
16 +import { c as useMemoCache } from "react/compiler-runtime";
17 export default function Foo(t0) {
18 const $ = useMemoCache(2);
19 const { bar } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/component-inner-function-with-many-args.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 import { Stringify } from "shared-runtime";
24 function Component(props) {
25 const $ = useMemoCache(3);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/component.expect.md
+1 -1
@@ -40,7 +40,7 @@ export const FIXTURE_ENTRYPOINT = {
40 ## Code
41
42 ```javascript
43 -import { c as useMemoCache } from "react";
43 +import { c as useMemoCache } from "react/compiler-runtime";
44 function Component(props) {
45 const $ = useMemoCache(8);
46 const items = props.items;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/computed-call-evaluation-order.expect.md
+1 -1
@@ -28,7 +28,7 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react"; // Should print A, B, arg, original
31 +import { c as useMemoCache } from "react/compiler-runtime"; // Should print A, B, arg, original
32 function Component() {
33 const $ = useMemoCache(2);
34 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/computed-call-spread.expect.md
+1 -1
@@ -12,7 +12,7 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react";
15 +import { c as useMemoCache } from "react/compiler-runtime";
16 function Component(props) {
17 const $ = useMemoCache(4);
18 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/computed-load-primitive-as-dependency.expect.md
+1 -1
@@ -17,7 +17,7 @@ function Component(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react";
20 +import { c as useMemoCache } from "react/compiler-runtime";
21 function Component(props) {
22 const $ = useMemoCache(2);
23 const a = foo();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/computed-store-alias.expect.md
+1 -1
@@ -15,7 +15,7 @@ function component(a, b) {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react";
18 +import { c as useMemoCache } from "react/compiler-runtime";
19 function component(a, b) {
20 const $ = useMemoCache(3);
21 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/concise-arrow-expr.expect.md
+1 -1
@@ -13,7 +13,7 @@ function component() {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react";
16 +import { c as useMemoCache } from "react/compiler-runtime";
17 function component() {
18 const $ = useMemoCache(2);
19 const [x, setX] = useState(0);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/conditional-break-labeled.expect.md
+1 -1
@@ -29,7 +29,7 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react";
32 +import { c as useMemoCache } from "react/compiler-runtime";
33 /**
34 * props.b *does* influence `a`
35 */
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/conditional-early-return.expect.md
+1 -1
@@ -66,7 +66,7 @@ export const FIXTURE_ENTRYPOINT = {
66 ## Code
67
68 ```javascript
69 -import { c as useMemoCache } from "react";
69 +import { c as useMemoCache } from "react/compiler-runtime";
70 /**
71 * props.b does *not* influence `a`
72 */
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/conditional-on-mutable.expect.md
+1 -1
@@ -34,7 +34,7 @@ function mayMutate() {}
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react";
37 +import { c as useMemoCache } from "react/compiler-runtime";
38 function ComponentA(props) {
39 const $ = useMemoCache(6);
40 let a;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/conflicting-dollar-sign-variable.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 import { identity } from "shared-runtime";
25
26 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/consecutive-use-memo.expect.md
+2 -1
@@ -21,7 +21,8 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { useMemo, c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 +import { useMemo } from "react";
26 import { identity } from "shared-runtime";
27
28 function useHook(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/console-readonly.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 import { shallowCopy } from "shared-runtime";
32
33 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/const-propagation-into-function-expression-global.expect.md
+1 -1
@@ -16,7 +16,7 @@ function foo() {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function foo() {
21 const $ = useMemoCache(2);
22 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/const-propagation-phi-nodes.expect.md
+1 -1
@@ -26,7 +26,7 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react";
29 +import { c as useMemoCache } from "react/compiler-runtime";
30 function useFoo(setOne) {
31 const $ = useMemoCache(4);
32 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constant-computed.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function Component(props) {
26 const $ = useMemoCache(2);
27 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constant-prop-to-object-method.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import { identity } from "shared-runtime";
29
30 function Foo() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constant-propagate-global-phis-constant.expect.md
+1 -1
@@ -26,7 +26,7 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react";
29 +import { c as useMemoCache } from "react/compiler-runtime";
30 import { CONST_STRING0, Text } from "shared-runtime";
31 function useFoo() {
32 "use no forget";
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constant-propagate-global-phis.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 import { CONST_STRING0, CONST_STRING1, Text } from "shared-runtime";
32
33 function useFoo() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constant-propagation-into-function-expressions.expect.md
+1 -1
@@ -15,7 +15,7 @@ function Component(props) {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react";
18 +import { c as useMemoCache } from "react/compiler-runtime";
19 function Component(props) {
20 const $ = useMemoCache(2);
21 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constructor.expect.md
+1 -1
@@ -18,7 +18,7 @@ function Component(props) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Foo() {}
23
24 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/context-variable-as-jsx-element-tag.expect.md
+2 -1
@@ -25,7 +25,8 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { useMemo, c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 +import { useMemo } from "react";
30 import { Stringify } from "shared-runtime";
31
32 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/context-variable-only-chained-assign.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 import { identity, invoke } from "shared-runtime";
32
33 function foo() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/context-variable-reactive-explicit-control-flow.expect.md
+1 -1
@@ -26,7 +26,7 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react";
29 +import { c as useMemoCache } from "react/compiler-runtime";
30 import { invoke } from "shared-runtime";
31
32 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/context-variable-reactive-implicit-control-flow.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 import { conditionalInvoke } from "shared-runtime";
32
33 // same as context-variable-reactive-explicit-control-flow.js, but make
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/context-variable-reassigned-objectmethod.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 import { invoke } from "shared-runtime";
32
33 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/context-variable-reassigned-outside-of-lambda.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 import { Stringify } from "shared-runtime";
28
29 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/context-variable-reassigned-reactive-capture.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import { invoke } from "shared-runtime";
29
30 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/context-variable-reassigned-two-lambdas.expect.md
+1 -1
@@ -32,7 +32,7 @@ export const FIXTURE_ENTRYPOINT = {
32 ## Code
33
34 ```javascript
35 -import { c as useMemoCache } from "react";
35 +import { c as useMemoCache } from "react/compiler-runtime";
36 import { conditionalInvoke } from "shared-runtime";
37
38 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/controlled-input.expect.md
+2 -1
@@ -20,7 +20,8 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { useState, c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 +import { useState } from "react";
25 function component() {
26 const $ = useMemoCache(3);
27 const [x, setX] = useState(0);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/createElement-freeze.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 import React from "react";
27 import { shallowCopy } from "shared-runtime";
28
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/debugger-memoized.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function Component(props) {
25 const $ = useMemoCache(2);
26 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/declare-reassign-variable-in-closure.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function Component(p) {
28 const $ = useMemoCache(1);
29 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/declare-reassign-variable-in-function-declaration.expect.md
+1 -1
@@ -16,7 +16,7 @@ function Component() {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function Component() {
21 const $ = useMemoCache(2);
22 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/deeply-nested-function-expressions-with-params.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function Foo() {
29 const $ = useMemoCache(1);
30 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/default-param-array-with-unary.expect.md
+1 -1
@@ -16,7 +16,7 @@ export const FIXTURE_ENTRYPOINT = {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function Component(t0) {
21 const $ = useMemoCache(2);
22 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/default-param-calls-global-function.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 import { identity } from "shared-runtime";
23
24 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/default-param-with-empty-callback.expect.md
+1 -1
@@ -16,7 +16,7 @@ export const FIXTURE_ENTRYPOINT = {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function Component(t0) {
21 const $ = useMemoCache(2);
22 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/default-param-with-reorderable-callback.expect.md
+1 -1
@@ -16,7 +16,7 @@ export const FIXTURE_ENTRYPOINT = {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function Component(t0) {
21 const $ = useMemoCache(2);
22 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/delete-computed-property.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function Component(props) {
25 const $ = useMemoCache(3);
26 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/delete-property.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function Component(props) {
24 const $ = useMemoCache(3);
25 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/dependencies-outputs.expect.md
+1 -1
@@ -28,7 +28,7 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react";
31 +import { c as useMemoCache } from "react/compiler-runtime";
32 function foo(a, b) {
33 const $ = useMemoCache(5);
34 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/dependencies.expect.md
+1 -1
@@ -29,7 +29,7 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react";
32 +import { c as useMemoCache } from "react/compiler-runtime";
33 function foo(x, y, z) {
34 const $ = useMemoCache(3);
35 const items = [z];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-array-assignment-to-context-var.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import { identity } from "shared-runtime";
29
30 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-array-declaration-to-context-var.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 import { identity } from "shared-runtime";
28
29 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-capture-global.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 let someGlobal = {};
24 function component(a) {
25 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-default-array-with-unary.expect.md
+1 -1
@@ -17,7 +17,7 @@ export const FIXTURE_ENTRYPOINT = {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react";
20 +import { c as useMemoCache } from "react/compiler-runtime";
21 function Component(props) {
22 const $ = useMemoCache(2);
23 const [t0] = props.value;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-in-branch-ssa.expect.md
+1 -1
@@ -34,7 +34,7 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react";
37 +import { c as useMemoCache } from "react/compiler-runtime";
38 function useFoo(props) {
39 const $ = useMemoCache(9);
40
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-mixed-property-key-types.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function foo() {
27 const $ = useMemoCache(2);
28 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-object-assignment-to-context-var.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import { identity } from "shared-runtime";
29
30 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-object-declaration-to-context-var.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 import { identity } from "shared-runtime";
28
29 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-string-literal-invalid-identifier-property-key.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function foo() {
23 const $ = useMemoCache(1);
24 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructure-string-literal-property-key.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function foo() {
23 const $ = useMemoCache(1);
24 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-array-default.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Component(props) {
23 const $ = useMemoCache(2);
24 const [t0] = props.y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-assignment-array-default.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function Component(props) {
28 const $ = useMemoCache(2);
29 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-assignment.expect.md
+1 -1
@@ -32,7 +32,7 @@ export const FIXTURE_ENTRYPOINT = {
32 ## Code
33
34 ```javascript
35 -import { c as useMemoCache } from "react";
35 +import { c as useMemoCache } from "react/compiler-runtime";
36 function foo(a, b, c) {
37 const $ = useMemoCache(5);
38 let d;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-mixed-scope-and-local-variables-with-default.expect.md
+1 -1
@@ -44,7 +44,7 @@ export const FIXTURE_ENTRYPOINT = {
44 ## Code
45
46 ```javascript
47 -import { c as useMemoCache } from "react";
47 +import { c as useMemoCache } from "react/compiler-runtime";
48 import { Stringify, graphql } from "shared-runtime";
49
50 function useFragment(_arg1, _arg2) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-mixed-scope-declarations-and-locals.expect.md
+1 -1
@@ -28,7 +28,7 @@ function Component(props) {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react";
31 +import { c as useMemoCache } from "react/compiler-runtime";
32 function Component(props) {
33 const $ = useMemoCache(8);
34 const post = useFragment(graphql`...`, props.post);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-object-default.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Component(props) {
23 const $ = useMemoCache(2);
24 const { x: t0 } = props.y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-object-pattern-within-rest.expect.md
+1 -1
@@ -17,7 +17,7 @@ export const FIXTURE_ENTRYPOINT = {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react";
20 +import { c as useMemoCache } from "react/compiler-runtime";
21 function Component(props) {
22 const $ = useMemoCache(6);
23 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-property-inference.expect.md
+1 -1
@@ -15,7 +15,7 @@ function Component(props) {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react";
18 +import { c as useMemoCache } from "react/compiler-runtime";
19 function Component(props) {
20 const $ = useMemoCache(5);
21 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-same-property-identifier-names.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import { identity } from "shared-runtime";
29
30 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-with-typecast-as-default-value.flow.expect.md
+1 -1
@@ -17,7 +17,7 @@ export const FIXTURE_ENTRYPOINT = {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react";
20 +import { c as useMemoCache } from "react/compiler-runtime";
21 function Component(props) {
22 const $ = useMemoCache(2);
23 const [t0] = props.y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring.expect.md
+1 -1
@@ -33,7 +33,7 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react";
36 +import { c as useMemoCache } from "react/compiler-runtime";
37 function foo(a, b, c) {
38 const $ = useMemoCache(18);
39 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/do-while-compound-test.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function Component(props) {
28 const $ = useMemoCache(2);
29 let ret;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/do-while-conditional-break.expect.md
+1 -1
@@ -18,7 +18,7 @@ function Component(props) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Component(props) {
23 const $ = useMemoCache(2);
24 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/do-while-continue.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 function Component() {
32 const $ = useMemoCache(1);
33 let ret;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/do-while-early-unconditional-break.expect.md
+1 -1
@@ -16,7 +16,7 @@ function Component(props) {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function Component(props) {
21 const $ = useMemoCache(1);
22 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/do-while-simple.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function Component() {
28 const $ = useMemoCache(1);
29 let ret;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/drop-methodcall-usecallback.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 import * as React from "react";
26
27 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/drop-methodcall-usememo.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 import * as React from "react";
28
29 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/early-return-nested-early-return-within-reactive-scope.expect.md
+1 -1
@@ -29,7 +29,7 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react";
32 +import { c as useMemoCache } from "react/compiler-runtime";
33 function Component(props) {
34 const $ = useMemoCache(5);
35 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/early-return-no-declarations-reassignments-dependencies.expect.md
+1 -1
@@ -50,7 +50,7 @@ export const FIXTURE_ENTRYPOINT = {
50 ## Code
51
52 ```javascript
53 -import { c as useMemoCache } from "react";
53 +import { c as useMemoCache } from "react/compiler-runtime";
54 import { makeArray } from "shared-runtime";
55
56 /**
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/early-return-within-reactive-scope.expect.md
+1 -1
@@ -41,7 +41,7 @@ export const FIXTURE_ENTRYPOINT = {
41 ## Code
42
43 ```javascript
44 -import { c as useMemoCache } from "react";
44 +import { c as useMemoCache } from "react/compiler-runtime";
45 import { makeArray } from "shared-runtime";
46
47 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/empty-catch-statement.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 import { getNumber } from "shared-runtime";
24
25 function useFoo() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/escape-analysis-destructured-rest-element.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function Component(props) {
26 const $ = useMemoCache(7);
27 let b;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/escape-analysis-jsx-child.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 function foo(a, b, c) {
30 const $ = useMemoCache(9);
31 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/escape-analysis-logical.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function Component(props) {
27 const $ = useMemoCache(6);
28 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/escape-analysis-non-escaping-interleaved-allocating-dependency.expect.md
+1 -1
@@ -29,7 +29,7 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react";
32 +import { c as useMemoCache } from "react/compiler-runtime";
33 function Component(props) {
34 const $ = useMemoCache(5);
35 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/escape-analysis-non-escaping-interleaved-allocating-nested-dependency.expect.md
+1 -1
@@ -38,7 +38,7 @@ export const FIXTURE_ENTRYPOINT = {
38 ## Code
39
40 ```javascript
41 -import { c as useMemoCache } from "react";
41 +import { c as useMemoCache } from "react/compiler-runtime";
42 function Component(props) {
43 const $ = useMemoCache(7);
44 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/escape-analysis-non-escaping-interleaved-primitive-dependency.expect.md
+1 -1
@@ -31,7 +31,7 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react";
34 +import { c as useMemoCache } from "react/compiler-runtime";
35 function Component(props) {
36 const $ = useMemoCache(3);
37
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/extend-scopes-if.expect.md
+1 -1
@@ -28,7 +28,7 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react";
31 +import { c as useMemoCache } from "react/compiler-runtime";
32 function foo(a, b, c) {
33 const $ = useMemoCache(4);
34 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbs-params.expect.md
+1 -1
@@ -28,7 +28,7 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react";
31 +import { c as useMemoCache } from "react/compiler-runtime";
32 import { fbs } from "fbt";
33
34 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-call-complex-param-value.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 import fbt from "fbt";
28 import { identity } from "shared-runtime";
29
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-call.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 import fbt from "fbt";
27
28 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-no-whitespace-btw-text-and-param.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 import fbt from "fbt";
28
29 const _ = fbt;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-param-with-leading-whitespace.expect.md
+1 -1
@@ -39,7 +39,7 @@ export const FIXTURE_ENTRYPOINT = {
39 ## Code
40
41 ```javascript
42 -import { c as useMemoCache } from "react";
42 +import { c as useMemoCache } from "react/compiler-runtime";
43 import fbt from "fbt";
44 import { identity } from "shared-runtime";
45
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-param-with-trailing-whitespace.expect.md
+1 -1
@@ -39,7 +39,7 @@ export const FIXTURE_ENTRYPOINT = {
39 ## Code
40
41 ```javascript
42 -import { c as useMemoCache } from "react";
42 +import { c as useMemoCache } from "react/compiler-runtime";
43 import fbt from "fbt";
44 import { identity } from "shared-runtime";
45
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-params-complex-param-value.expect.md
+1 -1
@@ -17,7 +17,7 @@ function Component(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react";
20 +import { c as useMemoCache } from "react/compiler-runtime";
21 import fbt from "fbt";
22
23 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-params.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 import fbt from "fbt";
28
29 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-preserve-jsxtext.expect.md
+1 -1
@@ -22,7 +22,7 @@ function Foo(props) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 import fbt from "fbt";
27
28 function Foo(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-preserve-whitespace.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import fbt from "fbt";
29
30 const _ = fbt;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-single-space-btw-param-and-text.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 import fbt from "fbt";
28
29 const _ = fbt;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-template-string-same-scope.expect.md
+1 -1
@@ -31,7 +31,7 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react";
34 +import { c as useMemoCache } from "react/compiler-runtime";
35 import fbt from "fbt";
36 import { Stringify } from "shared-runtime";
37
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-whitespace-around-param-value.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 import fbt from "fbt";
28
29 const _ = fbt;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbt-whitespace-within-text.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 import fbt from "fbt";
30
31 const _ = fbt;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbtparam-text-must-use-expression-container.expect.md
+1 -1
@@ -21,7 +21,7 @@ function Component(props) {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 import fbt from "fbt";
26
27 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbtparam-with-jsx-element-content.expect.md
+1 -1
@@ -25,7 +25,7 @@ function Component({ name, data, icon }) {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 import fbt from "fbt";
30
31 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/fbtparam-with-jsx-fragment-value.expect.md
+1 -1
@@ -22,7 +22,7 @@ function Component(props) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 import fbt from "fbt";
27 import { identity } from "shared-runtime";
28
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/lambda-with-fbt.expect.md
+1 -1
@@ -38,7 +38,7 @@ function Component() {
38 ## Code
39
40 ```javascript
41 -import { c as useMemoCache } from "react";
41 +import { c as useMemoCache } from "react/compiler-runtime";
42 import { fbt } from "fbt";
43
44 function Component() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/flag-enable-emit-hook-guards.expect.md
+3 -8
@@ -36,14 +36,9 @@ export const FIXTURE_ENTRYPOINT = {
36 ## Code
37
38 ```javascript
39 -import { $dispatcherGuard } from "react-compiler-runtime"; // @enableEmitHookGuards
40 -import {
41 - createContext,
42 - useContext,
43 - useEffect,
44 - useState,
45 - c as useMemoCache,
46 -} from "react";
39 +import { $dispatcherGuard } from "react-compiler-runtime";
40 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableEmitHookGuards
41 +import { createContext, useContext, useEffect, useState } from "react";
42 import {
43 CONST_STRING0,
44 ObjectWithHooks,
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-in-statement-break.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 function Component(props) {
30 const $ = useMemoCache(2);
31 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-in-statement-continue.expect.md
+1 -1
@@ -34,7 +34,7 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react";
37 +import { c as useMemoCache } from "react/compiler-runtime";
38 function Component(props) {
39 const $ = useMemoCache(2);
40 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-in-statement.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function Component(props) {
25 const $ = useMemoCache(4);
26 let items;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-loop-with-value-block-initializer.expect.md
+1 -1
@@ -30,7 +30,7 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react";
33 +import { c as useMemoCache } from "react/compiler-runtime";
34 const TOTAL = 10;
35 function Component(props) {
36 const $ = useMemoCache(5);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-multiple-variable-declarations-in-initializer.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function Component(props) {
27 const $ = useMemoCache(2);
28 let items;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-break.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function Component() {
26 const $ = useMemoCache(1);
27 let 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
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 import { makeObject_Primitives } from "shared-runtime";
32
33 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-capture-item-of-local-collection-mutate-later.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 import { makeObject_Primitives } from "shared-runtime";
32
33 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-conditional-break.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function Component() {
29 const $ = useMemoCache(1);
30 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-continue.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 function Component() {
30 const $ = useMemoCache(2);
31 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-destructure.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function Component() {
27 const $ = useMemoCache(1);
28 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-immutable-collection.expect.md
+1 -1
@@ -35,7 +35,7 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react";
38 +import { c as useMemoCache } from "react/compiler-runtime";
39 function Router(t0) {
40 const $ = useMemoCache(3);
41 const { title, mapping } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-iterator-of-immutable-collection.expect.md
+1 -1
@@ -35,7 +35,7 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react";
38 +import { c as useMemoCache } from "react/compiler-runtime";
39 function Router(t0) {
40 const $ = useMemoCache(3);
41 const { title, mapping } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-mutate-item-of-local-collection.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 import { makeObject_Primitives } from "shared-runtime";
28
29 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-mutate.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import { makeObject_Primitives, mutateAndReturn, toJSON } from "shared-runtime";
29
30 function Component(_props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-nonmutating-loop-local-collection.expect.md
+2 -1
@@ -39,7 +39,8 @@ export const FIXTURE_ENTRYPOINT = {
39 ## Code
40
41 ```javascript
42 -import { useMemo, c as useMemoCache } from "react";
42 +import { c as useMemoCache } from "react/compiler-runtime";
43 +import { useMemo } from "react";
44 import { ValidateMemoization } from "shared-runtime";
45
46 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-simple.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function Component() {
27 const $ = useMemoCache(1);
28 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/frozen-after-alias.expect.md
+1 -1
@@ -18,7 +18,7 @@ function foo(x) {}
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Component() {
23 const $ = useMemoCache(1);
24 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/function-declaration-reassign.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function component() {
26 const $ = useMemoCache(1);
27 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/function-declaration-redeclare.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function component() {
26 const $ = useMemoCache(1);
27 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/function-declaration-simple.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function component(a) {
27 const $ = useMemoCache(3);
28 let t;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/function-expr-directive.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function Component() {
28 "use strict";
29 const $ = useMemoCache(3);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/function-expression-captures-value-later-frozen-jsx.expect.md
+1 -1
@@ -20,7 +20,7 @@ function Component(props) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function Component(props) {
25 const $ = useMemoCache(3);
26 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/function-expression-maybe-mutates-hook-return-value.expect.md
+1 -1
@@ -20,7 +20,7 @@ function Component(props) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function Component(props) {
25 const $ = useMemoCache(4);
26 const id = useSelectedEntitytId();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/function-expression-with-store-to-parameter.expect.md
+1 -1
@@ -17,7 +17,7 @@ function Component(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react";
20 +import { c as useMemoCache } from "react/compiler-runtime";
21 function Component(props) {
22 const $ = useMemoCache(3);
23 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/function-param-assignment-pattern.expect.md
+1 -1
@@ -17,7 +17,7 @@ export const FIXTURE_ENTRYPOINT = {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react";
20 +import { c as useMemoCache } from "react/compiler-runtime";
21 function Component(t0, t1) {
22 const $ = useMemoCache(5);
23 const x = t0 === undefined ? "default" : t0;
"b/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/functionexpr\342\200\223conditional-access.expect.md" renamed
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react"; // @enableTreatFunctionDepsAsConditional
24 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableTreatFunctionDepsAsConditional
25 function Component(props) {
26 const $ = useMemoCache(5);
27 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/gating-access-function-name-in-component.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19
20 ```javascript
21 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
22 -import { c as useMemoCache } from "react"; // @gating
22 +import { c as useMemoCache } from "react/compiler-runtime"; // @gating
23 const Component = isForgetEnabled_Fixtures()
24 ? function Component() {
25 const $ = useMemoCache(1);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/gating-test-export-default-function.expect.md
+1 -1
@@ -23,7 +23,7 @@ function Foo(props) {
23
24 ```javascript
25 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
26 -import { c as useMemoCache } from "react"; // @gating @compilationMode(annotation)
26 +import { c as useMemoCache } from "react/compiler-runtime"; // @gating @compilationMode(annotation)
27 export default isForgetEnabled_Fixtures()
28 ? function Bar(props) {
29 "use forget";
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/gating-test-export-function-and-default.expect.md
+1 -1
@@ -23,7 +23,7 @@ export function Foo(props) {
23
24 ```javascript
25 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
26 -import { c as useMemoCache } from "react"; // @gating @compilationMode(annotation)
26 +import { c as useMemoCache } from "react/compiler-runtime"; // @gating @compilationMode(annotation)
27 export default isForgetEnabled_Fixtures()
28 ? function Bar(props) {
29 "use forget";
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/gating-test-export-function.expect.md
+1 -1
@@ -23,7 +23,7 @@ export function Foo(props) {
23
24 ```javascript
25 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
26 -import { c as useMemoCache } from "react"; // @gating @compilationMode(annotation)
26 +import { c as useMemoCache } from "react/compiler-runtime"; // @gating @compilationMode(annotation)
27 export const Bar = isForgetEnabled_Fixtures()
28 ? function Bar(props) {
29 "use forget";
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/gating-test.expect.md
+1 -1
@@ -23,7 +23,7 @@ function Foo(props) {
23
24 ```javascript
25 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
26 -import { c as useMemoCache } from "react"; // @gating @compilationMode(annotation)
26 +import { c as useMemoCache } from "react/compiler-runtime"; // @gating @compilationMode(annotation)
27 const Bar = isForgetEnabled_Fixtures()
28 ? function Bar(props) {
29 "use forget";
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/gating-with-hoisted-type-reference.flow.expect.md
+2 -1
@@ -19,7 +19,8 @@ export default memo<Props>(Component);
19
20 ```javascript
21 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
22 -import { memo, c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 +import { memo } from "react";
24
25 type Props = React.ElementConfig<typeof Component>;
26 const Component = isForgetEnabled_Fixtures()
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/global-jsx-tag-lowered-between-mutations.expect.md
+1 -1
@@ -23,7 +23,7 @@ function Component(props) {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function Component(props) {
28 const $ = useMemoCache(1);
29 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/globals-Boolean.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function Component(props) {
24 const $ = useMemoCache(2);
25 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/globals-Number.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function Component(props) {
24 const $ = useMemoCache(2);
25 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/globals-String.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function Component(props) {
24 const $ = useMemoCache(2);
25 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-computed-member-expression.expect.md
+1 -1
@@ -29,7 +29,7 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react";
32 +import { c as useMemoCache } from "react/compiler-runtime";
33 import { Stringify } from "shared-runtime";
34
35 function hoisting() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-member-expression.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import { Stringify } from "shared-runtime";
29
30 function hoisting() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-nested-const-declaration-2.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 function hoisting(cond) {
30 const $ = useMemoCache(2);
31 let items;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-nested-const-declaration.expect.md
+1 -1
@@ -29,7 +29,7 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react";
32 +import { c as useMemoCache } from "react/compiler-runtime";
33 function hoisting() {
34 const $ = useMemoCache(1);
35 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-object-method.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 function hoisting() {
30 const $ = useMemoCache(1);
31 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-recursive-call-within-lambda.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 function Foo(t0) {
30 const $ = useMemoCache(2);
31 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-recursive-call.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function Foo(t0) {
29 const $ = useMemoCache(2);
30 const { value } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-repro-variable-used-in-assignment.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function get2() {
26 const $ = useMemoCache(1);
27 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-simple-const-declaration.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function hoisting() {
27 const $ = useMemoCache(1);
28 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-simple-function-expression.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function hoisting() {
29 const $ = useMemoCache(1);
30 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-within-lambda.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function Component(t0) {
28 const $ = useMemoCache(2);
29 let t1;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/holey-array-expr.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 import { CONST_STRING0 } from "shared-runtime";
25
26 function t(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hook-call.expect.md
+1 -1
@@ -22,7 +22,7 @@ function Component(props) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function useFreeze() {}
27 function foo() {}
28
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hook-declaration-basic.flow.expect.md
+1 -1
@@ -12,7 +12,7 @@ export default hook useFoo(bar: number) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react";
15 +import { c as useMemoCache } from "react/compiler-runtime";
16 export default function useFoo(bar) {
17 const $ = useMemoCache(2);
18 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hook-noAlias.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 import { useNoAlias } from "shared-runtime";
32
33 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hooks-freeze-arguments.expect.md
+1 -1
@@ -18,7 +18,7 @@ function call(x) {}
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Component() {
23 const $ = useMemoCache(1);
24 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hooks-freeze-possibly-mutable-arguments.expect.md
+1 -1
@@ -25,7 +25,7 @@ function call(x) {}
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 function Component(props) {
30 const $ = useMemoCache(1);
31 const cond = props.cond;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hooks-with-prefix.expect.md
+1 -1
@@ -36,7 +36,7 @@ export const FIXTURE_ENTRYPOINT = {
36 ## Code
37
38 ```javascript
39 -import { c as useMemoCache } from "react"; // @hookPattern:".*\b(use[^$]+)$"
39 +import { c as useMemoCache } from "react/compiler-runtime"; // @hookPattern:".*\b(use[^$]+)$"
40
41 import * as React from "react";
42 import { makeArray, useHook } from "shared-runtime";
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ignore-use-no-forget.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react"; // @ignoreUseNoForget
22 +import { c as useMemoCache } from "react/compiler-runtime"; // @ignoreUseNoForget
23 function Component(prop) {
24 "use no forget";
25 const $ = useMemoCache(4);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/iife-return-modified-later-phi.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function Component(props) {
29 const $ = useMemoCache(2);
30 let items;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/iife-return-modified-later.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function Component(props) {
25 const $ = useMemoCache(3);
26 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/immutable-hooks.expect.md
+1 -1
@@ -17,7 +17,7 @@ function Component(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react"; // @enableAssumeHooksFollowRulesOfReact true
20 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableAssumeHooksFollowRulesOfReact true
21 function Component(props) {
22 const $ = useMemoCache(3);
23 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inadvertent-mutability-readonly-lambda.expect.md
+1 -1
@@ -21,7 +21,7 @@ function Component(props) {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function Component(props) {
26 const $ = useMemoCache(2);
27 const [value, setValue] = useState(null);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/incompatible-destructuring-kinds.expect.md
+2 -1
@@ -23,7 +23,8 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { useMemo, c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 +import { useMemo } from "react";
28 import { Stringify } from "shared-runtime";
29
30 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/independent-across-if.expect.md
+1 -1
@@ -36,7 +36,7 @@ function Component(props) {
36 ## Code
37
38 ```javascript
39 -import { c as useMemoCache } from "react";
39 +import { c as useMemoCache } from "react/compiler-runtime";
40 function compute() {}
41 function mutate() {}
42 function foo() {}
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/independent.expect.md
+1 -1
@@ -27,7 +27,7 @@ function Foo() {}
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 /**
32 * Should produce 3 scopes:
33 *
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/independently-memoize-object-property.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function foo(a, b, c) {
26 const $ = useMemoCache(7);
27 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-compile-hooks-with-multiple-params.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react"; // @compilationMode(infer)
25 +import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
26 import { useNoAlias } from "shared-runtime";
27
28 // This should be compiled by Forget
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-function-React-memo.expect.md
+1 -1
@@ -12,7 +12,7 @@ React.memo((props) => {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react"; // @compilationMode(infer)
15 +import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
16 React.memo((props) => {
17 const $ = useMemoCache(1);
18 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-function-assignment.expect.md
+1 -1
@@ -12,7 +12,7 @@ const Component = (props) => {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react"; // @compilationMode(infer)
15 +import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
16 const Component = (props) => {
17 const $ = useMemoCache(1);
18 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-function-expression-React-memo-gating.expect.md
+1 -1
@@ -14,7 +14,7 @@ export default React.forwardRef(function notNamedLikeAComponent(props) {
14
15 ```javascript
16 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
17 -import { c as useMemoCache } from "react"; // @gating @compilationMode(infer)
17 +import { c as useMemoCache } from "react/compiler-runtime"; // @gating @compilationMode(infer)
18 import React from "react";
19 export default React.forwardRef(
20 isForgetEnabled_Fixtures()
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-function-expression-component.expect.md
+1 -1
@@ -13,7 +13,7 @@ const Component = function ComponentName(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react"; // @compilationMode(infer)
16 +import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
17
18 const Component = function ComponentName(props) {
19 const $ = useMemoCache(1);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-function-forwardRef.expect.md
+1 -1
@@ -12,7 +12,7 @@ React.forwardRef((props) => {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react"; // @compilationMode(infer)
15 +import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
16 React.forwardRef((props) => {
17 const $ = useMemoCache(1);
18 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-functions-component-with-hook-call.expect.md
+1 -1
@@ -13,7 +13,7 @@ function Component(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react"; // @compilationMode(infer)
16 +import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
17 function Component(props) {
18 const $ = useMemoCache(2);
19 const [state] = useState(null);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-functions-component-with-jsx.expect.md
+1 -1
@@ -12,7 +12,7 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react"; // @compilationMode(infer)
15 +import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
16 function Component(props) {
17 const $ = useMemoCache(1);
18 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-functions-component-with-ref-arg.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react"; // @compilationMode(infer)
21 +import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
22
23 function Foo(t0, ref) {
24 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-functions-hook-with-hook-call.expect.md
+1 -1
@@ -13,7 +13,7 @@ function useStateValue(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react"; // @compilationMode(infer)
16 +import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
17 function useStateValue(props) {
18 const $ = useMemoCache(2);
19 const [state] = useState(null);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-functions-hook-with-jsx.expect.md
+1 -1
@@ -12,7 +12,7 @@ function useDiv(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react"; // @compilationMode(infer)
15 +import { c as useMemoCache } from "react/compiler-runtime"; // @compilationMode(infer)
16 function useDiv(props) {
17 const $ = useMemoCache(1);
18 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-global-object.expect.md
+1 -1
@@ -29,7 +29,7 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react";
32 +import { c as useMemoCache } 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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inner-memo-value-not-promoted-to-outer-scope-dynamic.expect.md
+1 -1
@@ -22,7 +22,7 @@ function Component(props) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function Component(props) {
27 const $ = useMemoCache(15);
28 const item = useFragment(FRAGMENT, props.item);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inner-memo-value-not-promoted-to-outer-scope-static.expect.md
+1 -1
@@ -19,7 +19,7 @@ function Component(props) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function Component(props) {
24 const $ = useMemoCache(1);
25 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/interdependent-across-if.expect.md
+1 -1
@@ -30,7 +30,7 @@ function Component(props) {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react";
33 +import { c as useMemoCache } from "react/compiler-runtime";
34 function compute() {}
35 function foo() {}
36 function Foo() {}
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/interdependent.expect.md
+1 -1
@@ -27,7 +27,7 @@ function Foo() {}
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 /**
32 * Should produce 1 scope:
33 *
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inverted-if.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 function foo(a, b, c, d) {
30 const $ = useMemoCache(5);
31 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/issue933-disjoint-set-infinite-loop.expect.md
+1 -1
@@ -30,7 +30,7 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react";
33 +import { c as useMemoCache } from "react/compiler-runtime";
34 function makeObj() {
35 "use no forget";
36 const result = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-attribute-default-to-true.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 import { Stringify } from "shared-runtime";
24
25 function Component() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-attribute-with-jsx-element-value.expect.md
+1 -1
@@ -42,7 +42,7 @@ export const FIXTURE_ENTRYPOINT = {
42 ## Code
43
44 ```javascript
45 -import { c as useMemoCache } from "react";
45 +import { c as useMemoCache } from "react/compiler-runtime";
46 function Component(t0) {
47 const $ = useMemoCache(2);
48 const { items } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-attribute-with-jsx-fragment-value.flow.expect.md
+1 -1
@@ -31,7 +31,7 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react";
34 +import { c as useMemoCache } from "react/compiler-runtime";
35 import { Stringify } from "shared-runtime";
36
37 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-empty-expression.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 export function Component(props) {
26 const $ = useMemoCache(2);
27 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-fragment.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function Foo(props) {
29 const $ = useMemoCache(3);
30 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-freeze.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 import { jsx as _jsx } from "react/jsx-runtime";
30 import { shallowCopy } from "shared-runtime";
31
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-local-memberexpr-tag-conditional.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 import * as SharedRuntime from "shared-runtime";
27 function useFoo(t0) {
28 const $ = useMemoCache(1);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-local-memberexpr-tag.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 import * as SharedRuntime from "shared-runtime";
23 function useFoo() {
24 const $ = useMemoCache(1);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-local-tag-in-lambda.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 import { Stringify } from "shared-runtime";
26 function useFoo() {
27 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-member-expression-tag-grouping.expect.md
+1 -1
@@ -12,7 +12,7 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react";
15 +import { c as useMemoCache } from "react/compiler-runtime";
16 function Component(props) {
17 const $ = useMemoCache(1);
18 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-member-expression.expect.md
+1 -1
@@ -15,7 +15,7 @@ function Component(props) {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react";
18 +import { c as useMemoCache } from "react/compiler-runtime";
19 function Component(props) {
20 const $ = useMemoCache(1);
21 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-memberexpr-tag-in-lambda.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 import * as SharedRuntime from "shared-runtime";
26 function useFoo() {
27 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-namespaced-name.expect.md
+1 -1
@@ -17,7 +17,7 @@ export const FIXTURE_ENTRYPOINT = {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react";
20 +import { c as useMemoCache } from "react/compiler-runtime";
21 function Component(props) {
22 const $ = useMemoCache(2);
23 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-preserve-whitespace.expect.md
+1 -1
@@ -32,7 +32,7 @@ export const FIXTURE_ENTRYPOINT = {
32 ## Code
33
34 ```javascript
35 -import { c as useMemoCache } from "react";
35 +import { c as useMemoCache } from "react/compiler-runtime";
36 import { StaticText1 } from "shared-runtime";
37
38 function Component() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-reactive-local-variable-member-expr.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 import * as sharedRuntime from "shared-runtime";
28
29 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-spread.expect.md
+1 -1
@@ -13,7 +13,7 @@ function Component(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react";
16 +import { c as useMemoCache } from "react/compiler-runtime";
17 function Component(props) {
18 const $ = useMemoCache(5);
19
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-tag-evaluation-order-non-global.expect.md
+1 -1
@@ -34,7 +34,7 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react";
37 +import { c as useMemoCache } from "react/compiler-runtime";
38 import { StaticText1, StaticText2 } from "shared-runtime";
39
40 function MaybeMutable() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-tag-evaluation-order.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 import { StaticText1, StaticText2 } from "shared-runtime";
30
31 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-ternary-local-variable.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 import { RenderPropAsChild, StaticText1, StaticText2 } from "shared-runtime";
25
26 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/labeled-break-within-label-loop.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 function useHook(end) {
32 const $ = useMemoCache(2);
33 let log;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/labeled-break-within-label-switch.expect.md
+1 -1
@@ -30,7 +30,7 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react";
33 +import { c as useMemoCache } from "react/compiler-runtime";
34 import { CONST_STRING0 } from "shared-runtime";
35
36 function useHook(cond) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-array-access-member-expr-captured.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import { CONST_NUMBER0, invoke } from "shared-runtime";
29
30 function Foo() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-array-access-member-expr-param.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 import { invoke } from "shared-runtime";
28
29 function Foo() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-capture-returned-alias.expect.md
+1 -1
@@ -26,7 +26,7 @@ function CaptureNotMutate(props) {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react"; // Here, element should not be memoized independently of aliasedElement, since
29 +import { c as useMemoCache } 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`
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-mutate-shadowed-object.expect.md
+1 -1
@@ -19,7 +19,7 @@ function Component() {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function Component() {
24 const $ = useMemoCache(1);
25 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-mutated-non-reactive-to-reactive.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function f(a) {
26 const $ = useMemoCache(4);
27 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-mutated-ref-non-reactive.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function f(a) {
27 const $ = useMemoCache(2);
28 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-reassign-primitive.expect.md
+1 -1
@@ -28,7 +28,7 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react"; // writing to primitives is not a 'mutate' or 'store' to context references,
31 +import { c as useMemoCache } 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]:
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-reassign-shadowed-primitive.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 function Component() {
30 const $ = useMemoCache(1);
31 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/logical-expression-object.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function component(props) {
29 const $ = useMemoCache(3);
30
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/maybe-mutate-object-in-callback.expect.md
+1 -1
@@ -28,7 +28,7 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react";
31 +import { c as useMemoCache } from "react/compiler-runtime";
32 const { mutate } = require("shared-runtime");
33
34 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mege-consecutive-scopes-dont-merge-with-different-deps.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 const { getNumber, identity } = require("shared-runtime");
25
26 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/memoization-comments.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react"; // @enableMemoizationComments
25 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableMemoizationComments
26 import { addOne, getNumber, identity } from "shared-runtime";
27
28 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/memoize-value-block-value-conditional.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Foo(props) {
23 const $ = useMemoCache(1);
24 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/memoize-value-block-value-logical-no-sequence.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Foo(props) {
23 const $ = useMemoCache(1);
24 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/memoize-value-block-value-logical.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Foo(props) {
23 const $ = useMemoCache(1);
24 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/memoize-value-block-value-sequence.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Foo(props) {
23 const $ = useMemoCache(1);
24 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/merge-consecutive-nested-scopes.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 const { getNumber } = require("shared-runtime");
29
30 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/merge-consecutive-scopes-no-deps.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 const { getNumber } = require("shared-runtime");
25
26 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/merge-consecutive-scopes-objects.expect.md
+2 -1
@@ -35,7 +35,8 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { useState, c as useMemoCache } from "react";
38 +import { c as useMemoCache } from "react/compiler-runtime";
39 +import { useState } from "react";
40 import { Stringify } from "shared-runtime";
41
42 // This is a translation of the original merge-consecutive-scopes which uses plain objects
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/merge-consecutive-scopes.expect.md
+2 -1
@@ -28,7 +28,8 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { useState, c as useMemoCache } from "react";
31 +import { c as useMemoCache } from "react/compiler-runtime";
32 +import { useState } from "react";
33 import { Stringify } from "shared-runtime";
34
35 function Component() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/merge-nested-scopes-with-same-inputs.expect.md
+1 -1
@@ -30,7 +30,7 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react";
33 +import { c as useMemoCache } from "react/compiler-runtime";
34 import { setProperty } from "shared-runtime";
35
36 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/merged-scopes-are-valid-effect-deps.expect.md
+2 -2
@@ -27,9 +27,9 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -// @validateMemoizedEffectDependencies
30 +import { c as useMemoCache } from "react/compiler-runtime"; // @validateMemoizedEffectDependencies
31
32 -import { useEffect, c as useMemoCache } from "react";
32 +import { useEffect } from "react";
33
34 function Component(props) {
35 const $ = useMemoCache(5);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/method-call-computed.expect.md
+1 -1
@@ -21,7 +21,7 @@ function foo(a, b, c) {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function foo(a, b, c) {
26 const $ = useMemoCache(8);
27 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/method-call-fn-call.expect.md
+1 -1
@@ -18,7 +18,7 @@ function foo(a, b, c) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function foo(a, b, c) {
23 const $ = useMemoCache(6);
24 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/method-call.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 import { addOne, shallowCopy } from "shared-runtime";
30
31 function foo(a, b, c) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/multi-arrow-expr-export-default-gating-test.expect.md
+1 -1
@@ -18,7 +18,7 @@ export default Renderer = (props) => (
18
19 ```javascript
20 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
21 -import { c as useMemoCache } from "react"; // @gating
21 +import { c as useMemoCache } from "react/compiler-runtime"; // @gating
22 const ErrorView = isForgetEnabled_Fixtures()
23 ? (error, _retry) => {
24 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/multi-arrow-expr-export-gating-test.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const Renderer = (props) => (
18
19 ```javascript
20 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
21 -import { c as useMemoCache } from "react"; // @gating
21 +import { c as useMemoCache } from "react/compiler-runtime"; // @gating
22 const ErrorView = isForgetEnabled_Fixtures()
23 ? (error, _retry) => {
24 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/multi-arrow-expr-gating-test.expect.md
+1 -1
@@ -20,7 +20,7 @@ export default Renderer;
20
21 ```javascript
22 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
23 -import { c as useMemoCache } from "react"; // @gating
23 +import { c as useMemoCache } from "react/compiler-runtime"; // @gating
24 const ErrorView = isForgetEnabled_Fixtures()
25 ? (error, _retry) => {
26 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/multi-directive.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function Component() {
24 "use foo";
25 "use bar";
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/multiple-calls-to-hoisted-callback-from-other-callback.expect.md
+2 -1
@@ -34,7 +34,8 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { useState, c as useMemoCache } from "react";
37 +import { c as useMemoCache } from "react/compiler-runtime";
38 +import { useState } from "react";
39
40 function Component(props) {
41 const $ = useMemoCache(1);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutable-lifetime-loops.expect.md
+1 -1
@@ -60,7 +60,7 @@ export const FIXTURE_ENTRYPOINT = {
60 ## Code
61
62 ```javascript
63 -import { c as useMemoCache } from "react";
63 +import { c as useMemoCache } from "react/compiler-runtime";
64 function mutate(x, y) {
65 "use no forget";
66 if (x != null) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutable-lifetime-with-aliasing.expect.md
+1 -1
@@ -54,7 +54,7 @@ export const FIXTURE_ENTRYPOINT = {
54 ## Code
55
56 ```javascript
57 -import { c as useMemoCache } from "react";
57 +import { c as useMemoCache } from "react/compiler-runtime";
58 function mutate(x, y) {
59 "use no forget";
60 if (!Array.isArray(x.value)) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutate-outer-scope-within-value-block.expect.md
+1 -1
@@ -42,7 +42,7 @@ export const FIXTURE_ENTRYPOINT = {
42 ## Code
43
44 ```javascript
45 -import { c as useMemoCache } from "react";
45 +import { c as useMemoCache } from "react/compiler-runtime";
46 import { CONST_TRUE, identity, shallowCopy } from "shared-runtime";
47
48 /**
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutation-during-jsx-construction.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import { identity, mutate, mutateAndReturnNewValue } from "shared-runtime";
29
30 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutation-within-capture-and-mutablerange.expect.md
+1 -1
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react";
40 +import { c as useMemoCache } from "react/compiler-runtime";
41 import { mutate } from "shared-runtime";
42
43 /**
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutation-within-jsx-and-break.expect.md
+1 -1
@@ -40,7 +40,7 @@ export const FIXTURE_ENTRYPOINT = {
40 ## Code
41
42 ```javascript
43 -import { c as useMemoCache } from "react";
43 +import { c as useMemoCache } from "react/compiler-runtime";
44 import {
45 Stringify,
46 makeObject_Primitives,
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutation-within-jsx.expect.md
+1 -1
@@ -60,7 +60,7 @@ export const FIXTURE_ENTRYPOINT = {
60 ## Code
61
62 ```javascript
63 -import { c as useMemoCache } from "react";
63 +import { c as useMemoCache } from "react/compiler-runtime";
64 import {
65 Stringify,
66 makeObject_Primitives,
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/nested-function-shadowed-identifiers.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function Component(props) {
29 const $ = useMemoCache(3);
30 const [x, setX] = useState(null);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/nested-function-with-param-as-captured-dep.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function Foo() {
27 const $ = useMemoCache(1);
28 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/nested-optional-member-expr.expect.md
+1 -1
@@ -14,7 +14,7 @@ function Component(props) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react"; // We should codegen nested optional properties correctly
17 +import { c as useMemoCache } 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);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/nested-scopes-begin-same-instr-valueblock.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 import { identity, mutate } from "shared-runtime";
32
33 function Foo(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-does-not-mutate-class.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 import { identity } from "shared-runtime";
28
29 class Foo {}
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-spread.expect.md
+1 -1
@@ -12,7 +12,7 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react";
15 +import { c as useMemoCache } from "react/compiler-runtime";
16 function Component(props) {
17 const $ = useMemoCache(3);
18 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/noAlias-filter-on-array-prop.expect.md
+1 -1
@@ -31,7 +31,7 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react";
34 +import { c as useMemoCache } from "react/compiler-runtime";
35 function Component(props) {
36 const $ = useMemoCache(3);
37 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/nonmutating-capture-in-unsplittable-memo-block.expect.md
+1 -1
@@ -49,7 +49,7 @@ export const FIXTURE_ENTRYPOINT = {
49 ## Code
50
51 ```javascript
52 -import { c as useMemoCache } from "react";
52 +import { c as useMemoCache } from "react/compiler-runtime";
53 import { identity, mutate } from "shared-runtime";
54
55 /**
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/obj-literal-cached-in-if-else.expect.md
+1 -1
@@ -18,7 +18,7 @@ function foo(a, b, c, d) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function foo(a, b, c, d) {
23 const $ = useMemoCache(4);
24 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/obj-literal-mutated-after-if-else.expect.md
+1 -1
@@ -19,7 +19,7 @@ function foo(a, b, c, d) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function foo(a, b, c, d) {
24 const $ = useMemoCache(3);
25 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/obj-mutated-after-if-else-with-alias.expect.md
+1 -1
@@ -21,7 +21,7 @@ function foo(a, b, c, d) {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function foo(a, b, c, d) {
26 const $ = useMemoCache(2);
27 someObj();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/obj-mutated-after-if-else.expect.md
+1 -1
@@ -19,7 +19,7 @@ function foo(a, b, c, d) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function foo(a, b, c, d) {
24 const $ = useMemoCache(2);
25 someObj();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/obj-mutated-after-nested-if-else-with-alias.expect.md
+1 -1
@@ -27,7 +27,7 @@ function foo(a, b, c, d) {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 function foo(a, b, c, d) {
32 const $ = useMemoCache(3);
33 someObj();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-expression-computed-key-constant-number.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 import { identity } from "shared-runtime";
27
28 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-expression-computed-key-constant-string.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 import { identity } from "shared-runtime";
27
28 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-expression-computed-key-non-reactive.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import { identity } from "shared-runtime";
29
30 const SCALE = 2;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-expression-computed-key-object-mutated-later.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 import { identity, mutate } from "shared-runtime";
28
29 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-expression-computed-key.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import { identity } from "shared-runtime";
29
30 const SCALE = 2;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-expression-string-literal-key.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Component(props) {
23 const $ = useMemoCache(2);
24 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-literal-method-derived-in-ternary-consequent.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import { identity, createHookWrapper } from "shared-runtime";
29
30 function useHook(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-literal-method-in-ternary-consequent.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import { createHookWrapper } from "shared-runtime";
29
30 function useHook(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-literal-spread-element.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Component(props) {
23 const $ = useMemoCache(2);
24 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-method-maybe-alias.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 import { createHookWrapper, setProperty } from "shared-runtime";
32 function useHook(props) {
33 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-method-shorthand-3.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 import { createHookWrapper, mutate } from "shared-runtime";
30
31 function useHook(a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-method-shorthand-aliased-mutate-after.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import { createHookWrapper, mutate, mutateAndReturn } from "shared-runtime";
29 function useHook(t0) {
30 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-method-shorthand-derived-value.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 import { createHookWrapper, mutateAndReturn } from "shared-runtime";
28 function useHook(t0) {
29 const $ = useMemoCache(4);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-method-shorthand-hook-dep.expect.md
+2 -1
@@ -23,8 +23,9 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 import { createHookWrapper } from "shared-runtime";
27 -import { useState, c as useMemoCache } from "react";
28 +import { useState } from "react";
29 function useFoo() {
30 const $ = useMemoCache(2);
31 const [state] = useState(false);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-method-shorthand-mutated-after.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import { createHookWrapper, mutate, mutateAndReturn } from "shared-runtime";
29 function useHook(t0) {
30 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-method-shorthand.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function Component() {
26 const $ = useMemoCache(1);
27 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-mutated-in-consequent-alternate-both-return.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 import { makeObject_Primitives } from "shared-runtime";
30
31 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-pattern-params.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function component(t0) {
24 const $ = useMemoCache(7);
25 const { a, b } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-shorthand-method-1.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import { createHookWrapper } from "shared-runtime";
29 function useHook(t0) {
30 const $ = useMemoCache(5);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-shorthand-method-2.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 import { createHookWrapper } from "shared-runtime";
29
30 function useHook(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-shorthand-method-nested.expect.md
+2 -1
@@ -31,7 +31,8 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { useState, c as useMemoCache } from "react";
34 +import { c as useMemoCache } from "react/compiler-runtime";
35 +import { useState } from "react";
36 import { createHookWrapper } from "shared-runtime";
37
38 function useHook(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/option-enable-change-variable-codegen.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react"; // @enableChangeVariableCodegen
21 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableChangeVariableCodegen
22 function Component(props) {
23 const $ = useMemoCache(3);
24 const c_00 = $[0] !== props.a;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-call-chained.expect.md
+1 -1
@@ -11,7 +11,7 @@ function Component(props) {
11 ## Code
12
13 ```javascript
14 -import { c as useMemoCache } from "react";
14 +import { c as useMemoCache } from "react/compiler-runtime";
15 function Component(props) {
16 const $ = useMemoCache(2);
17 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-call-logical.expect.md
+1 -1
@@ -12,7 +12,7 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react";
15 +import { c as useMemoCache } from "react/compiler-runtime";
16 function Component(props) {
17 const $ = useMemoCache(2);
18 const item = useFragment(graphql`...`, props.item);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-call-simple.expect.md
+1 -1
@@ -11,7 +11,7 @@ function Component(props) {
11 ## Code
12
13 ```javascript
14 -import { c as useMemoCache } from "react";
14 +import { c as useMemoCache } from "react/compiler-runtime";
15 function Component(props) {
16 const $ = useMemoCache(2);
17 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-call-with-independently-memoizable-arg.expect.md
+1 -1
@@ -21,7 +21,7 @@ function Component(props) {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function Component(props) {
26 const $ = useMemoCache(2);
27 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-call-with-optional-property-load.expect.md
+1 -1
@@ -11,7 +11,7 @@ function Component(props) {
11 ## Code
12
13 ```javascript
14 -import { c as useMemoCache } from "react";
14 +import { c as useMemoCache } from "react/compiler-runtime";
15 function Component(props) {
16 const $ = useMemoCache(2);
17 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-call.expect.md
+1 -1
@@ -14,7 +14,7 @@ function Component(props) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react";
17 +import { c as useMemoCache } from "react/compiler-runtime";
18 function Component(props) {
19 const $ = useMemoCache(2);
20 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-computed-member-expression.expect.md
+1 -1
@@ -12,7 +12,7 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react";
15 +import { c as useMemoCache } from "react/compiler-runtime";
16 function Component(props) {
17 const $ = useMemoCache(2);
18 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-member-expression-call-as-property.expect.md
+1 -1
@@ -12,7 +12,7 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react";
15 +import { c as useMemoCache } from "react/compiler-runtime";
16 function Component(props) {
17 const $ = useMemoCache(3);
18 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-member-expression-chain.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react"; // Note that `a?.b.c` is semantically different from `(a?.b).c`
24 +import { c as useMemoCache } 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);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-member-expression-with-optional-member-expr-as-property.expect.md
+1 -1
@@ -12,7 +12,7 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react";
15 +import { c as useMemoCache } from "react/compiler-runtime";
16 function Component(props) {
17 const $ = useMemoCache(1);
18 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-member-expression.expect.md
+1 -1
@@ -15,7 +15,7 @@ function Foo(props) {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react";
18 +import { c as useMemoCache } from "react/compiler-runtime";
19 function Foo(props) {
20 const $ = useMemoCache(2);
21 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-method-call.expect.md
+1 -1
@@ -14,7 +14,7 @@ function Component(props) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react";
17 +import { c as useMemoCache } from "react/compiler-runtime";
18 function Component(props) {
19 const $ = useMemoCache(2);
20 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-receiver-method-call.expect.md
+1 -1
@@ -14,7 +14,7 @@ function Component(props) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react";
17 +import { c as useMemoCache } from "react/compiler-runtime";
18 function Component(props) {
19 const $ = useMemoCache(2);
20 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-receiver-optional-method.expect.md
+1 -1
@@ -14,7 +14,7 @@ function Component(props) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react";
17 +import { c as useMemoCache } from "react/compiler-runtime";
18 function Component(props) {
19 const $ = useMemoCache(2);
20 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/allocating-logical-expression-instruction-scope.expect.md
+1 -1
@@ -26,7 +26,7 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react"; // @enableReactiveScopesInHIR:false
29 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
30
31 /**
32 * This is a weird case as data has type `BuiltInMixedReadonly`.
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/bug-hoisted-declaration-with-scope.expect.md
+1 -1
@@ -46,7 +46,7 @@ export const FIXTURE_ENTRYPOINT = {
46 ## Code
47
48 ```javascript
49 -import { c as useMemoCache } from "react"; // @enableReactiveScopesInHIR:false
49 +import { c as useMemoCache } 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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/bug-nonmutating-capture-in-unsplittable-memo-block.expect.md
+1 -1
@@ -60,7 +60,7 @@ export const FIXTURE_ENTRYPOINT = {
60 ## Code
61
62 ```javascript
63 -import { c as useMemoCache } from "react"; // @enableReactiveScopesInHIR:false
63 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
64 import { identity, mutate } from "shared-runtime";
65
66 /**
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/capture-ref-for-later-mutation.expect.md
+2 -2
@@ -32,8 +32,8 @@ export const FIXTURE_ENTRYPOINT = {
32 ## Code
33
34 ```javascript
35 -// @enableReactiveScopesInHIR:false
36 -import { useRef, c as useMemoCache } from "react";
35 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
36 +import { useRef } from "react";
37 import { addOne } from "shared-runtime";
38
39 function useKeyCommand() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/invalid-align-scopes-within-nested-valueblock-in-array.expect.md
+1 -1
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react"; // @enableReactiveScopesInHIR:false
40 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
41
42 import { Stringify, identity, makeArray, mutate } from "shared-runtime";
43
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/mutate-outer-scope-within-value-block.expect.md
+1 -1
@@ -43,7 +43,7 @@ export const FIXTURE_ENTRYPOINT = {
43 ## Code
44
45 ```javascript
46 -import { c as useMemoCache } from "react"; // @enableReactiveScopesInHIR:false
46 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
47 import { CONST_TRUE, identity, shallowCopy } from "shared-runtime";
48
49 /**
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/mutation-within-capture-and-mutablerange.expect.md
+1 -1
@@ -38,7 +38,7 @@ export const FIXTURE_ENTRYPOINT = {
38 ## Code
39
40 ```javascript
41 -import { c as useMemoCache } from "react"; // @enableReactiveScopesInHIR:false
41 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
42 import { mutate } from "shared-runtime";
43
44 /**
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/mutation-within-jsx-and-break.expect.md
+1 -1
@@ -41,7 +41,7 @@ export const FIXTURE_ENTRYPOINT = {
41 ## Code
42
43 ```javascript
44 -import { c as useMemoCache } from "react"; // @enableReactiveScopesInHIR:false
44 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
45 import {
46 Stringify,
47 makeObject_Primitives,
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/mutation-within-jsx.expect.md
+1 -1
@@ -61,7 +61,7 @@ export const FIXTURE_ENTRYPOINT = {
61 ## Code
62
63 ```javascript
64 -import { c as useMemoCache } from "react"; // @enableReactiveScopesInHIR:false
64 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
65 import {
66 Stringify,
67 makeObject_Primitives,
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/original-reactive-scopes-fork/repro-allocating-ternary-test-instruction-scope.expect.md
+1 -1
@@ -29,7 +29,7 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react"; // @enableReactiveScopesInHIR:false
32 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableReactiveScopesInHIR:false
33 import { identity, makeObject_Primitives } from "shared-runtime";
34
35 function useTest(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/overlapping-scopes-shadowing-within-block.expect.md
+1 -1
@@ -26,7 +26,7 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react";
29 +import { c as useMemoCache } from "react/compiler-runtime";
30 function foo(a, b, c) {
31 const $ = useMemoCache(9);
32 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/overlapping-scopes-within-block.expect.md
+1 -1
@@ -26,7 +26,7 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react";
29 +import { c as useMemoCache } from "react/compiler-runtime";
30 function foo(a, b, c) {
31 const $ = useMemoCache(7);
32 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/partial-early-return-within-reactive-scope.expect.md
+1 -1
@@ -28,7 +28,7 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react";
31 +import { c as useMemoCache } from "react/compiler-runtime";
32 function Component(props) {
33 const $ = useMemoCache(4);
34 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/phi-type-inference-array-push.expect.md
+1 -1
@@ -29,7 +29,7 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react";
32 +import { c as useMemoCache } from "react/compiler-runtime";
33 function Component(props) {
34 const $ = useMemoCache(6);
35 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/phi-type-inference-property-store.expect.md
+1 -1
@@ -30,7 +30,7 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react"; // @debug
33 +import { c as useMemoCache } from "react/compiler-runtime"; // @debug
34 function Component(props) {
35 const $ = useMemoCache(5);
36 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-jsxtext-stringliteral-distinction.expect.md
+1 -1
@@ -16,7 +16,7 @@ export const FIXTURE_ENTRYPOINT = {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function Foo() {
21 const $ = useMemoCache(1);
22 let t0;
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,9 +27,9 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -// @validatePreserveExistingMemoizationGuarantees
30 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
31
32 -import { useMemo, c as useMemoCache } from "react";
32 +import { useMemo } from "react";
33
34 // Todo: we currently only generate a `constVal` declaration when
35 // validatePreserveExistingMemoizationGuarantees is enabled, as the
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-alias-property-load-dep.expect.md
+2 -2
@@ -23,8 +23,8 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -// @validatePreserveExistingMemoizationGuarantees
27 -import { useCallback, c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
27 +import { useCallback } from "react";
28 import { sum } from "shared-runtime";
29
30 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-captures-reassigned-context-property.expect.md
+2 -2
@@ -29,8 +29,8 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -// @validatePreserveExistingMemoizationGuarantees
33 -import { useCallback, c as useMemoCache } from "react";
32 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
33 +import { useCallback } from "react";
34 import { Stringify } from "shared-runtime";
35
36 function Foo(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-captures-reassigned-context.expect.md
+2 -2
@@ -27,9 +27,9 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -// @validatePreserveExistingMemoizationGuarantees
30 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
31
32 -import { useCallback, c as useMemoCache } from "react";
32 +import { useCallback } from "react";
33 import { makeArray } from "shared-runtime";
34
35 // This case is fine, as all reassignments happen before the useCallback
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-conditional-access-own-scope.expect.md
+2 -2
@@ -25,8 +25,8 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -// @validatePreserveExistingMemoizationGuarantees
29 -import { useCallback, c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
29 +import { useCallback } from "react";
30
31 function Component(t0) {
32 const $ = useMemoCache(3);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-in-other-reactive-block.expect.md
+2 -2
@@ -30,8 +30,8 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -// @validatePreserveExistingMemoizationGuarantees
34 -import { useCallback, useState, c as useMemoCache } from "react";
33 +import { c as useMemoCache } 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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-infer-conditional-value-block.expect.md
+2 -2
@@ -28,8 +28,8 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -// @validatePreserveExistingMemoizationGuarantees
32 -import { useCallback, c as useMemoCache } from "react";
31 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
32 +import { useCallback } from "react";
33 import { identity, mutate } from "shared-runtime";
34
35 function useHook(propA, propB) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-infer-fewer-deps.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -// @validatePreserveExistingMemoizationGuarantees
24 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
25
26 -import { useCallback, c as useMemoCache } from "react";
26 +import { useCallback } from "react";
27
28 // It's correct to produce memo blocks with fewer deps than source
29 function useFoo(a, b) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-infer-more-specific.expect.md
+2 -2
@@ -25,9 +25,9 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -// @validatePreserveExistingMemoizationGuarantees
28 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
29
30 -import { useCallback, c as useMemoCache } from "react";
30 +import { useCallback } from "react";
31
32 // More specific memoization always results in fewer memo block
33 // executions.
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-infer-read-dep.expect.md
+2 -2
@@ -24,8 +24,8 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -// @validatePreserveExistingMemoizationGuarantees
28 -import { useCallback, c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
28 +import { useCallback } from "react";
29 import { sum } from "shared-runtime";
30
31 function useFoo() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-infer-scope-global.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -// @validatePreserveExistingMemoizationGuarantees
25 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
26
27 -import { useCallback, c as useMemoCache } from "react";
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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-nonescaping-invoked-callback-escaping-return.expect.md
+2 -2
@@ -36,8 +36,8 @@ export const FIXTURE_ENTRYPOINT = {
36 ## Code
37
38 ```javascript
39 -// @validatePreserveExistingMemoizationGuarantees @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
40 -import { useCallback, c as useMemoCache } from "react";
39 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
40 +import { useCallback } from "react";
41
42 function Component(t0) {
43 const $ = useMemoCache(11);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-nonescaping.expect.md
+2 -2
@@ -33,8 +33,8 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -// @validatePreserveExistingMemoizationGuarantees @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
37 -import { useCallback, c as useMemoCache } from "react";
36 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
37 +import { useCallback } from "react";
38
39 function Component(t0) {
40 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-reordering-deplist-controlflow.expect.md
+2 -1
@@ -35,7 +35,8 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { useCallback, c as useMemoCache } from "react";
38 +import { c as useMemoCache } from "react/compiler-runtime";
39 +import { useCallback } from "react";
40 import { Stringify } from "shared-runtime";
41
42 function Foo(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-reordering-depslist-assignment.expect.md
+2 -1
@@ -30,7 +30,8 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { useCallback, c as useMemoCache } from "react";
33 +import { c as useMemoCache } 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)
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-with-no-depslist.expect.md
+2 -2
@@ -24,8 +24,8 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -// @validatePreserveExistingMemoizationGuarantees
28 -import { useCallback, c as useMemoCache } from "react";
27 +import { c as useMemoCache } 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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-alias-property-load-dep.expect.md
+2 -2
@@ -23,8 +23,8 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -// @validatePreserveExistingMemoizationGuarantees
27 -import { useMemo, c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
27 +import { useMemo } from "react";
28 import { sum } from "shared-runtime";
29
30 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-conditional-access-alloc.expect.md
+2 -2
@@ -25,8 +25,8 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -// @validatePreserveExistingMemoizationGuarantees
29 -import { useMemo, c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
29 +import { useMemo } from "react";
30 import { identity } from "shared-runtime";
31
32 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-conditional-access-noAlloc.expect.md
+2 -2
@@ -24,8 +24,8 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -// @validatePreserveExistingMemoizationGuarantees
28 -import { useMemo, c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
28 +import { useMemo } from "react";
29
30 function Component(t0) {
31 const $ = useMemoCache(3);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-conditional-access-own-scope.expect.md
+2 -2
@@ -25,8 +25,8 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -// @validatePreserveExistingMemoizationGuarantees
29 -import { useMemo, c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
29 +import { useMemo } from "react";
30
31 function Component(t0) {
32 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-constant-prop.expect.md
+2 -2
@@ -29,8 +29,8 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -// @validatePreserveExistingMemoizationGuarantees
33 -import { useMemo, c as useMemoCache } from "react";
32 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
33 +import { useMemo } from "react";
34 import { identity } from "shared-runtime";
35
36 function useFoo(cond) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-in-other-reactive-block.expect.md
+2 -2
@@ -30,8 +30,8 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -// @validatePreserveExistingMemoizationGuarantees
34 -import { useMemo, useState, c as useMemoCache } from "react";
33 +import { c as useMemoCache } 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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-infer-fewer-deps.expect.md
+2 -2
@@ -21,9 +21,9 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -// @validatePreserveExistingMemoizationGuarantees
24 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
25
26 -import { useMemo, c as useMemoCache } from "react";
26 +import { useMemo } from "react";
27
28 // It's correct to produce memo blocks with fewer deps than source
29 function useFoo(a, b) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-infer-more-specific.expect.md
+2 -2
@@ -25,9 +25,9 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -// @validatePreserveExistingMemoizationGuarantees
28 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
29
30 -import { useMemo, c as useMemoCache } from "react";
30 +import { useMemo } from "react";
31
32 // More specific memoization always results in fewer memo block
33 // executions.
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-infer-nonallocating.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -// @validatePreserveExistingMemoizationGuarantees
25 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
26
27 -import { useMemo, c as useMemoCache } from "react";
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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-infer-scope-global.expect.md
+2 -2
@@ -22,9 +22,9 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -// @validatePreserveExistingMemoizationGuarantees
25 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
26
27 -import { useMemo, c as useMemoCache } from "react";
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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-inner-decl.expect.md
+2 -2
@@ -23,8 +23,8 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -// @validatePreserveExistingMemoizationGuarantees
27 -import { useMemo, c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
27 +import { useMemo } from "react";
28 import { identity } from "shared-runtime";
29
30 function useFoo(data) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-invoke-prop.expect.md
+2 -2
@@ -27,9 +27,9 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -// @validatePreserveExistingMemoizationGuarantees
30 +import { c as useMemoCache } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees
31
32 -import { useMemo, c as useMemoCache } from "react";
32 +import { useMemo } from "react";
33
34 function useFoo(t0) {
35 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-reordering-depslist-assignment.expect.md
+2 -1
@@ -26,7 +26,8 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { useMemo, c as useMemoCache } from "react";
29 +import { c as useMemoCache } from "react/compiler-runtime";
30 +import { useMemo } from "react";
31
32 function useFoo(arr1, arr2) {
33 const $ = useMemoCache(7);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-reordering-depslist-controlflow.expect.md
+2 -1
@@ -35,7 +35,8 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { useMemo, c as useMemoCache } from "react";
38 +import { c as useMemoCache } from "react/compiler-runtime";
39 +import { useMemo } from "react";
40 import { Stringify } from "shared-runtime";
41
42 function Foo(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-with-no-depslist.expect.md
+2 -2
@@ -24,8 +24,8 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -// @validatePreserveExistingMemoizationGuarantees
28 -import { useMemo, c as useMemoCache } from "react";
27 +import { c as useMemoCache } 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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/primitive-as-dep-nested-scope.expect.md
+1 -1
@@ -20,7 +20,7 @@ function PrimitiveAsDepNested(props) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react"; // props.b + 1 is an non-allocating expression, which means Forget can
23 +import { c as useMemoCache } 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:
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/primitive-as-dep.expect.md
+1 -1
@@ -17,7 +17,7 @@ function PrimitiveAsDep(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react"; // props.b + 1 is an non-allocating expression, which means Forget can
20 +import { c as useMemoCache } 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:
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/prop-capturing-function-1.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function component(a, b) {
26 const $ = useMemoCache(5);
27 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/property-assignment.expect.md
+1 -1
@@ -16,7 +16,7 @@ function Component(props) {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function Component(props) {
21 const $ = useMemoCache(6);
22 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/property-call-evaluation-order.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react"; // Should print A, arg, original
30 +import { c as useMemoCache } from "react/compiler-runtime"; // Should print A, arg, original
31
32 function Component() {
33 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/property-call-spread.expect.md
+1 -1
@@ -12,7 +12,7 @@ function Component(props) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react";
15 +import { c as useMemoCache } from "react/compiler-runtime";
16 function Component(props) {
17 const $ = useMemoCache(3);
18 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/prune-scopes-whose-deps-invalidate-jsx.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 import { useHook } from "shared-runtime";
30
31 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/prune-scopes-whose-deps-may-invalidate-array.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 import { useHook, identity } from "shared-runtime";
32
33 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/react-namespace.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 const FooContext = React.createContext({ current: null });
30
31 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-indirect.expect.md
+1 -1
@@ -34,7 +34,7 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react";
37 +import { c as useMemoCache } from "react/compiler-runtime";
38 function Component(props) {
39 const $ = useMemoCache(2);
40 let x = 0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-test.expect.md
+1 -1
@@ -40,7 +40,7 @@ export const FIXTURE_ENTRYPOINT = {
40 ## Code
41
42 ```javascript
43 -import { c as useMemoCache } from "react";
43 +import { c as useMemoCache } from "react/compiler-runtime";
44 function Component(props) {
45 const $ = useMemoCache(2);
46 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-for-init.expect.md
+1 -1
@@ -39,7 +39,7 @@ export const FIXTURE_ENTRYPOINT = {
39 ## Code
40
41 ```javascript
42 -import { c as useMemoCache } from "react";
42 +import { c as useMemoCache } from "react/compiler-runtime";
43 function Component(props) {
44 const $ = useMemoCache(2);
45 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-for-test.expect.md
+1 -1
@@ -38,7 +38,7 @@ export const FIXTURE_ENTRYPOINT = {
38 ## Code
39
40 ```javascript
41 -import { c as useMemoCache } from "react";
41 +import { c as useMemoCache } from "react/compiler-runtime";
42 function Component(props) {
43 const $ = useMemoCache(2);
44 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-for-update.expect.md
+1 -1
@@ -38,7 +38,7 @@ export const FIXTURE_ENTRYPOINT = {
38 ## Code
39
40 ```javascript
41 -import { c as useMemoCache } from "react";
41 +import { c as useMemoCache } from "react/compiler-runtime";
42 function Component(props) {
43 const $ = useMemoCache(2);
44 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-forin-collection.expect.md
+1 -1
@@ -39,7 +39,7 @@ export const FIXTURE_ENTRYPOINT = {
39 ## Code
40
41 ```javascript
42 -import { c as useMemoCache } from "react";
42 +import { c as useMemoCache } from "react/compiler-runtime";
43 function Component(props) {
44 const $ = useMemoCache(2);
45 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-forof-collection.expect.md
+1 -1
@@ -38,7 +38,7 @@ export const FIXTURE_ENTRYPOINT = {
38 ## Code
39
40 ```javascript
41 -import { c as useMemoCache } from "react";
41 +import { c as useMemoCache } from "react/compiler-runtime";
42 function Component(props) {
43 const $ = useMemoCache(2);
44 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-do-while.expect.md
+1 -1
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react";
40 +import { c as useMemoCache } from "react/compiler-runtime";
41 function Component(props) {
42 const $ = useMemoCache(1);
43
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-for-in.expect.md
+1 -1
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react";
40 +import { c as useMemoCache } from "react/compiler-runtime";
41 function Component(props) {
42 const $ = useMemoCache(1);
43
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-for-init.expect.md
+1 -1
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react";
40 +import { c as useMemoCache } from "react/compiler-runtime";
41 function Component(props) {
42 const $ = useMemoCache(1);
43
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-for-of.expect.md
+1 -1
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react";
40 +import { c as useMemoCache } from "react/compiler-runtime";
41 function Component(props) {
42 const $ = useMemoCache(1);
43
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-for-test.expect.md
+1 -1
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react";
40 +import { c as useMemoCache } from "react/compiler-runtime";
41 function Component(props) {
42 const $ = useMemoCache(1);
43
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-for-update.expect.md
+1 -1
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react";
40 +import { c as useMemoCache } from "react/compiler-runtime";
41 function Component(props) {
42 const $ = useMemoCache(1);
43
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-if.expect.md
+1 -1
@@ -39,7 +39,7 @@ export const FIXTURE_ENTRYPOINT = {
39 ## Code
40
41 ```javascript
42 -import { c as useMemoCache } from "react";
42 +import { c as useMemoCache } from "react/compiler-runtime";
43 function Component(props) {
44 const $ = useMemoCache(1);
45
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-switch.expect.md
+1 -1
@@ -43,7 +43,7 @@ export const FIXTURE_ENTRYPOINT = {
43 ## Code
44
45 ```javascript
46 -import { c as useMemoCache } from "react";
46 +import { c as useMemoCache } from "react/compiler-runtime";
47 function Component(props) {
48 const $ = useMemoCache(1);
49
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-while.expect.md
+1 -1
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react";
40 +import { c as useMemoCache } from "react/compiler-runtime";
41 function Component(props) {
42 const $ = useMemoCache(1);
43
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-if.expect.md
+1 -1
@@ -35,7 +35,7 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react";
38 +import { c as useMemoCache } from "react/compiler-runtime";
39 function Component(props) {
40 const $ = useMemoCache(2);
41 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-on-context-variable.expect.md
+1 -1
@@ -45,7 +45,7 @@ export const FIXTURE_ENTRYPOINT = {
45 ## Code
46
47 ```javascript
48 -import { c as useMemoCache } from "react";
48 +import { c as useMemoCache } from "react/compiler-runtime";
49 import { identity } from "shared-runtime";
50
51 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-phi-setState-type.expect.md
+2 -1
@@ -55,8 +55,9 @@ export const FIXTURE_ENTRYPOINT = {
55 ## Code
56
57 ```javascript
58 +import { c as useMemoCache } from "react/compiler-runtime";
59 import invariant from "invariant";
59 -import { useState, c as useMemoCache } from "react";
60 +import { useState } from "react";
61
62 function Component(props) {
63 const $ = useMemoCache(5);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-reactive-after-fixpoint.expect.md
+1 -1
@@ -49,7 +49,7 @@ export const FIXTURE_ENTRYPOINT = {
49 ## Code
50
51 ```javascript
52 -import { c as useMemoCache } from "react";
52 +import { c as useMemoCache } from "react/compiler-runtime";
53 function Component(props) {
54 const $ = useMemoCache(2);
55 let x = 0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-case-test.expect.md
+1 -1
@@ -43,7 +43,7 @@ export const FIXTURE_ENTRYPOINT = {
43 ## Code
44
45 ```javascript
46 -import { c as useMemoCache } from "react";
46 +import { c as useMemoCache } from "react/compiler-runtime";
47 function Component(props) {
48 const $ = useMemoCache(2);
49 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-condition.expect.md
+1 -1
@@ -41,7 +41,7 @@ export const FIXTURE_ENTRYPOINT = {
41 ## Code
42
43 ```javascript
44 -import { c as useMemoCache } from "react";
44 +import { c as useMemoCache } from "react/compiler-runtime";
45 const GLOBAL = 42;
46
47 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-if.expect.md
+1 -1
@@ -38,7 +38,7 @@ export const FIXTURE_ENTRYPOINT = {
38 ## Code
39
40 ```javascript
41 -import { c as useMemoCache } from "react";
41 +import { c as useMemoCache } from "react/compiler-runtime";
42 function Component(props) {
43 const $ = useMemoCache(2);
44
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-switch.expect.md
+1 -1
@@ -41,7 +41,7 @@ export const FIXTURE_ENTRYPOINT = {
41 ## Code
42
43 ```javascript
44 -import { c as useMemoCache } from "react";
44 +import { c as useMemoCache } from "react/compiler-runtime";
45 function Component(props) {
46 const $ = useMemoCache(2);
47
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-while-test.expect.md
+1 -1
@@ -40,7 +40,7 @@ export const FIXTURE_ENTRYPOINT = {
40 ## Code
41
42 ```javascript
43 -import { c as useMemoCache } from "react";
43 +import { c as useMemoCache } from "react/compiler-runtime";
44 function Component(props) {
45 const $ = useMemoCache(2);
46 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-dependencies-non-optional-properties-inside-optional-chain.expect.md
+1 -1
@@ -11,7 +11,7 @@ function Component(props) {
11 ## Code
12
13 ```javascript
14 -import { c as useMemoCache } from "react";
14 +import { c as useMemoCache } from "react/compiler-runtime";
15 function Component(props) {
16 const $ = useMemoCache(2);
17 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-dependency-fixpoint.expect.md
+1 -1
@@ -28,7 +28,7 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react";
31 +import { c as useMemoCache } from "react/compiler-runtime";
32 function Component(props) {
33 const $ = useMemoCache(2);
34 let x = 0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-dependency-nonreactive-captured-with-reactive.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Component(props) {
23 const $ = useMemoCache(3);
24 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-dependency-object-captured-with-reactive-mutated.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 const { mutate } = require("shared-runtime");
28
29 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-scope-grouping.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function foo() {
28 const $ = useMemoCache(1);
29 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-scopes-if.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 function foo(a, b, c) {
30 const $ = useMemoCache(8);
31 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-scopes.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function f(a, b) {
29 const $ = useMemoCache(5);
30 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactivity-analysis-interleaved-reactivity.expect.md
+1 -1
@@ -33,7 +33,7 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react";
36 +import { c as useMemoCache } from "react/compiler-runtime";
37 function Component(props) {
38 const $ = useMemoCache(7);
39 let a;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactivity-analysis-reactive-via-mutation-of-computed-load.expect.md
+1 -1
@@ -16,7 +16,7 @@ function Component(props) {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function Component(props) {
21 const $ = useMemoCache(8);
22 let items;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactivity-analysis-reactive-via-mutation-of-property-load.expect.md
+1 -1
@@ -16,7 +16,7 @@ function Component(props) {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function Component(props) {
21 const $ = useMemoCache(7);
22 let items;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactivity-via-aliased-mutation-array.expect.md
+1 -1
@@ -30,7 +30,7 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react";
33 +import { c as useMemoCache } from "react/compiler-runtime";
34 function Component(props) {
35 const $ = useMemoCache(4);
36 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactivity-via-aliased-mutation-lambda.expect.md
+1 -1
@@ -33,7 +33,7 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react";
36 +import { c as useMemoCache } from "react/compiler-runtime";
37 function Component(props) {
38 const $ = useMemoCache(4);
39 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactivity-via-aliased-mutation-through-property-load.expect.md
+1 -1
@@ -36,7 +36,7 @@ export const FIXTURE_ENTRYPOINT = {
36 ## Code
37
38 ```javascript
39 -import { c as useMemoCache } from "react";
39 +import { c as useMemoCache } from "react/compiler-runtime";
40 function Component(props) {
41 const $ = useMemoCache(2);
42 const x = {};
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactivity-via-readonly-alias-of-mutable-value.expect.md
+1 -1
@@ -45,7 +45,7 @@ export const FIXTURE_ENTRYPOINT = {
45 ## Code
46
47 ```javascript
48 -import { c as useMemoCache } from "react";
48 +import { c as useMemoCache } from "react/compiler-runtime";
49 function Component(props) {
50 const $ = useMemoCache(2);
51 const x = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/readonly-object-method-calls-mutable-lambda.expect.md
+1 -1
@@ -23,7 +23,7 @@ function Component(props) {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function Component(props) {
28 const $ = useMemoCache(3);
29 const x = makeObject();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/readonly-object-method-calls.expect.md
+1 -1
@@ -21,7 +21,7 @@ function Component(props) {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function Component(props) {
26 const $ = useMemoCache(5);
27 const user = useFragment(
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reanimated-no-memo-arg.expect.md
+1 -1
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react"; // @enableCustomTypeDefinitionForReAnimated
40 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableCustomTypeDefinitionForReAnimated
41 function Component() {
42 const $ = useMemoCache(2);
43 const radius = useSharedValue(50);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassign-in-while-loop-condition.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 import { makeArray } from "shared-runtime";
30
31 // @flow
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassign-object-in-context.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function Component(props) {
26 const $ = useMemoCache(1);
27 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassign-primitive-in-context.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function Component(props) {
26 const $ = useMemoCache(1);
27 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassigned-phi-in-returned-function-expression.expect.md
+1 -1
@@ -19,7 +19,7 @@ function Component(props) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function Component(props) {
24 const $ = useMemoCache(2);
25 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassignment-conditional.expect.md
+1 -1
@@ -21,7 +21,7 @@ function Component(props) {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function Component(props) {
26 const $ = useMemoCache(9);
27 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassignment-separate-scopes.expect.md
+1 -1
@@ -39,7 +39,7 @@ export const FIXTURE_ENTRYPOINT = {
39 ## Code
40
41 ```javascript
42 -import { c as useMemoCache } from "react";
42 +import { c as useMemoCache } from "react/compiler-runtime";
43 function foo(a, b, c) {
44 const $ = useMemoCache(11);
45 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassignment.expect.md
+1 -1
@@ -20,7 +20,7 @@ function Component(props) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function Component(props) {
25 const $ = useMemoCache(8);
26 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-cond-deps-break-in-scope.expect.md
+1 -1
@@ -29,7 +29,7 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react";
32 +import { c as useMemoCache } from "react/compiler-runtime";
33 function useFoo(t0) {
34 const $ = useMemoCache(3);
35 const { obj, objIsNull } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-cond-deps-cfg-nested-testifelse.expect.md
+1 -1
@@ -34,7 +34,7 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react";
37 +import { c as useMemoCache } from "react/compiler-runtime";
38 import { setProperty } from "shared-runtime";
39
40 function useFoo(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-cond-deps-return-in-scope.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 function useFoo(t0) {
32 const $ = useMemoCache(4);
33 const { obj, objIsNull } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cfg-condexpr.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react"; // props.a.b should be added as a unconditional dependency to the reactive
26 +import { c as useMemoCache } 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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cfg-ifelse.expect.md
+1 -1
@@ -28,7 +28,7 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react"; // props.a.b should be added as a unconditional dependency to the reactive
31 +import { c as useMemoCache } 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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cfg-nested-ifelse-missing.expect.md
+1 -1
@@ -29,7 +29,7 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react"; // props.a.b should NOT be added as a unconditional dependency to the reactive
32 +import { c as useMemoCache } 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";
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cfg-nested-ifelse.expect.md
+1 -1
@@ -34,7 +34,7 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react"; // props.a.b should be added as a unconditional dependency to the reactive
37 +import { c as useMemoCache } 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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cfg-switch-exhaustive.expect.md
+1 -1
@@ -33,7 +33,7 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react"; // props.a.b should be added as a unconditional dependency to the reactive
36 +import { c as useMemoCache } 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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cfg-switch-missing-case.expect.md
+1 -1
@@ -33,7 +33,7 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react"; // props.a.b should NOT be added as a unconditional dependency to the reactive
36 +import { c as useMemoCache } 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";
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cfg-switch-missing-default.expect.md
+1 -1
@@ -30,7 +30,7 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react"; // props.a.b should NOT be added as a unconditional dependency to the reactive
33 +import { c as useMemoCache } 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";
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cond-scope.expect.md
+1 -1
@@ -41,7 +41,7 @@ export const FIXTURE_ENTRYPOINT = {
41 ## Code
42
43 ```javascript
44 -import { c as useMemoCache } from "react"; // Some reactive scopes are created within a conditional. If a child scope
44 +import { c as useMemoCache } 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 //
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/conditional-member-expr.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react"; // To preserve the nullthrows behavior and reactive deps of this code,
25 +import { c as useMemoCache } 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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/join-uncond-scopes-cond-deps.expect.md
+1 -1
@@ -41,7 +41,7 @@ export const FIXTURE_ENTRYPOINT = {
41 ## Code
42
43 ```javascript
44 -import { c as useMemoCache } from "react"; // This tests an optimization, NOT a correctness property.
44 +import { c as useMemoCache } 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 //
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/break-in-scope.expect.md
+1 -1
@@ -31,7 +31,7 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react";
34 +import { c as useMemoCache } from "react/compiler-runtime";
35 function useFoo(t0) {
36 const $ = useMemoCache(3);
37 const { obj, objIsNull } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/break-poisons-outer-scope.expect.md
+1 -1
@@ -35,7 +35,7 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react";
38 +import { c as useMemoCache } from "react/compiler-runtime";
39 import { identity } from "shared-runtime";
40
41 function useFoo(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/loop-break-in-scope.expect.md
+1 -1
@@ -31,7 +31,7 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react";
34 +import { c as useMemoCache } from "react/compiler-runtime";
35 function useFoo(t0) {
36 const $ = useMemoCache(3);
37 const { obj, objIsNull } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/reduce-if-nonexhaustive-poisoned-deps.expect.md
+1 -1
@@ -36,7 +36,7 @@ export const FIXTURE_ENTRYPOINT = {
36 ## Code
37
38 ```javascript
39 -import { c as useMemoCache } from "react";
39 +import { c as useMemoCache } from "react/compiler-runtime";
40 import { identity } from "shared-runtime";
41
42 function useFoo(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/reduce-if-nonexhaustive-poisoned-deps1.expect.md
+1 -1
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react";
40 +import { c as useMemoCache } from "react/compiler-runtime";
41 import { identity } from "shared-runtime";
42
43 function useFoo(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/return-in-scope.expect.md
+1 -1
@@ -29,7 +29,7 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react";
32 +import { c as useMemoCache } from "react/compiler-runtime";
33 function useFoo(t0) {
34 const $ = useMemoCache(4);
35 const { obj, objIsNull } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/return-poisons-outer-scope.expect.md
+1 -1
@@ -33,7 +33,7 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react";
36 +import { c as useMemoCache } from "react/compiler-runtime";
37 import { identity } from "shared-runtime";
38
39 function useFoo(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-unpoisoned/else-branch-scope-unpoisoned.expect.md
+1 -1
@@ -36,7 +36,7 @@ export const FIXTURE_ENTRYPOINT = {
36 ## Code
37
38 ```javascript
39 -import { c as useMemoCache } from "react";
39 +import { c as useMemoCache } from "react/compiler-runtime";
40 import { identity } from "shared-runtime";
41
42 function useFoo(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-unpoisoned/jump-target-within-scope-label.expect.md
+1 -1
@@ -33,7 +33,7 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react";
36 +import { c as useMemoCache } from "react/compiler-runtime";
37 function useFoo(t0) {
38 const $ = useMemoCache(3);
39 const { input, cond } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-unpoisoned/jump-target-within-scope-loop-break.expect.md
+1 -1
@@ -35,7 +35,7 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react";
38 +import { c as useMemoCache } from "react/compiler-runtime";
39 function useFoo(t0) {
40 const $ = useMemoCache(3);
41 const { input, max } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-unpoisoned/reduce-if-exhaustive-nonpoisoned-deps.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 import { identity } from "shared-runtime";
32
33 function useFoo(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-unpoisoned/reduce-if-exhaustive-nonpoisoned-deps1.expect.md
+1 -1
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react";
40 +import { c as useMemoCache } from "react/compiler-runtime";
41 import { identity } from "shared-runtime";
42
43 function useFoo(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-unpoisoned/return-before-scope-starts.expect.md
+1 -1
@@ -35,7 +35,7 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react";
38 +import { c as useMemoCache } from "react/compiler-runtime";
39 import { arrayPush } from "shared-runtime";
40
41 function useFoo(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-unpoisoned/throw-before-scope-starts.expect.md
+1 -1
@@ -35,7 +35,7 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react";
38 +import { c as useMemoCache } from "react/compiler-runtime";
39 import { arrayPush } from "shared-runtime";
40
41 function useFoo(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/memberexpr-join-optional-chain.expect.md
+1 -1
@@ -30,7 +30,7 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react"; // To preserve the nullthrows behavior and reactive deps of this code,
33 +import { c as useMemoCache } 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.<...>,
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/memberexpr-join-optional-chain2.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function Component(props) {
24 const $ = useMemoCache(2);
25 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/no-uncond.expect.md
+1 -1
@@ -35,7 +35,7 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react"; // When an object's properties are only read conditionally, we should
38 +import { c as useMemoCache } from "react/compiler-runtime"; // When an object's properties are only read conditionally, we should
39
40 import { identity } from "shared-runtime";
41
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/promote-uncond.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react"; // When a conditional dependency `props.a.b.c` has no unconditional dependency
30 +import { c as useMemoCache } 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";
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/reduce-if-exhaustive-poisoned-deps.expect.md
+1 -1
@@ -28,7 +28,7 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react";
31 +import { c as useMemoCache } from "react/compiler-runtime";
32 import { identity } from "shared-runtime";
33
34 function useFoo(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/subpath-order1.expect.md
+1 -1
@@ -29,7 +29,7 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react"; // When a conditional dependency `props.a` is a subpath of an unconditional
32 +import { c as useMemoCache } 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`
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/subpath-order2.expect.md
+1 -1
@@ -29,7 +29,7 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react"; // When a conditional dependency `props.a` is a subpath of an unconditional
32 +import { c as useMemoCache } 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`
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/superpath-order1.expect.md
+1 -1
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react"; // When an unconditional dependency `props.a` is the subpath of a conditional
40 +import { c as useMemoCache } 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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/superpath-order2.expect.md
+1 -1
@@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react"; // When an unconditional dependency `props.a` is the subpath of a conditional
40 +import { c as useMemoCache } 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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/uncond-nonoverlap-descendant.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react"; // Test that we can track non-overlapping dependencies separately.
25 +import { c as useMemoCache } 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);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/uncond-nonoverlap-direct.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react"; // Test that we can track non-overlapping dependencies separately.
24 +import { c as useMemoCache } 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);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/uncond-overlap-descendant.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react"; // Test that we correctly track a subpath if the subpath itself is accessed as
25 +import { c as useMemoCache } 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);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/uncond-overlap-direct.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react"; // Test that we correctly track a subpath if the subpath itself is accessed as
25 +import { c as useMemoCache } 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);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/uncond-subpath-order1.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react"; // Determine that we only need to track p.a here
25 +import { c as useMemoCache } 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);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/uncond-subpath-order2.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react"; // Determine that we only need to track p.a here
25 +import { c as useMemoCache } 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);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/uncond-subpath-order3.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react"; // Determine that we only need to track p.a here
25 +import { c as useMemoCache } 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);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-current-aliased-no-added-to-dep.expect.md
+1 -1
@@ -18,7 +18,7 @@ function VideoTab() {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react"; // @validateRefAccessDuringRender false
21 +import { c as useMemoCache } from "react/compiler-runtime"; // @validateRefAccessDuringRender false
22 function VideoTab() {
23 const $ = useMemoCache(3);
24 const ref = useRef();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-current-aliased-not-added-to-dep-2.expect.md
+1 -1
@@ -16,7 +16,7 @@ function Foo({ a }) {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react"; // @validateRefAccessDuringRender:false
19 +import { c as useMemoCache } from "react/compiler-runtime"; // @validateRefAccessDuringRender:false
20 function Foo(t0) {
21 const $ = useMemoCache(4);
22 const { a } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-current-field-not-added-to-dep.expect.md
+1 -1
@@ -17,7 +17,7 @@ function VideoTab() {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react"; // @validateRefAccessDuringRender false
20 +import { c as useMemoCache } from "react/compiler-runtime"; // @validateRefAccessDuringRender false
21 function VideoTab() {
22 const $ = useMemoCache(3);
23 const ref = useRef();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-current-field-write-not-added-to-dep.expect.md
+2 -1
@@ -23,7 +23,8 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { useRef, c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 +import { useRef } from "react";
28
29 function Component() {
30 const $ = useMemoCache(4);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-current-not-added-to-dep-2.expect.md
+1 -1
@@ -15,7 +15,7 @@ function Foo({ a }) {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react"; // @validateRefAccessDuringRender:false
18 +import { c as useMemoCache } from "react/compiler-runtime"; // @validateRefAccessDuringRender:false
19 function Foo(t0) {
20 const $ = useMemoCache(4);
21 const { a } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-current-not-added-to-dep.expect.md
+1 -1
@@ -16,7 +16,7 @@ function VideoTab() {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function VideoTab() {
21 const $ = useMemoCache(3);
22 const ref = useRef();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-current-optional-field-no-added-to-dep.expect.md
+1 -1
@@ -16,7 +16,7 @@ function VideoTab() {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function VideoTab() {
21 const $ = useMemoCache(3);
22 const ref = useRef();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-current-write-not-added-to-dep.expect.md
+1 -1
@@ -16,7 +16,7 @@ function VideoTab() {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function VideoTab() {
21 const $ = useMemoCache(3);
22 const ref = useRef();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-in-effect.expect.md
+1 -1
@@ -19,7 +19,7 @@ function Component(props) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function Component(props) {
24 const $ = useMemoCache(4);
25 const ref = useRef(null);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-parameter-mutate-in-effect.expect.md
+2 -1
@@ -22,7 +22,8 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { useEffect, c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 +import { useEffect } from "react";
27
28 function Foo(props, ref) {
29 const $ = useMemoCache(4);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/regexp-literal.expect.md
+1 -1
@@ -18,7 +18,7 @@ function Component(props) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Component(props) {
23 const $ = useMemoCache(4);
24 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rename-source-variables-nested-function.expect.md
+1 -1
@@ -34,7 +34,7 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react"; // @enableChangeVariableCodegen
37 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableChangeVariableCodegen
38 import { identity } from "shared-runtime";
39
40 const $ = "module_$";
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rename-source-variables-nested-object-method.expect.md
+1 -1
@@ -35,7 +35,7 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -import { c as useMemoCache } from "react"; // @enableChangeVariableCodegen
38 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableChangeVariableCodegen
39 import { identity } from "shared-runtime";
40
41 const $ = "module_$";
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rename-source-variables.expect.md
+1 -1
@@ -26,7 +26,7 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react"; // @enableChangeVariableCodegen
29 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableChangeVariableCodegen
30 import { identity } from "shared-runtime";
31
32 const $ = "module_$";
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-allocating-ternary-test-instruction-scope.expect.md
+1 -1
@@ -28,7 +28,7 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react";
31 +import { c as useMemoCache } from "react/compiler-runtime";
32 import { identity, makeObject_Primitives } from "shared-runtime";
33
34 function useTest(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-dce-circular-reference.expect.md
+1 -1
@@ -31,7 +31,7 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react";
34 +import { c as useMemoCache } from "react/compiler-runtime";
35 import { identity } from "shared-runtime";
36
37 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-dont-memoize-array-with-capturing-map-after-hook.expect.md
+2 -1
@@ -34,7 +34,8 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { useEffect, useState, c as useMemoCache } from "react";
37 +import { c as useMemoCache } from "react/compiler-runtime";
38 +import { useEffect, useState } from "react";
39 import { mutate } from "shared-runtime";
40
41 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-dont-memoize-array-with-mutable-map-after-hook.expect.md
+2 -1
@@ -34,7 +34,8 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { useEffect, useState, c as useMemoCache } from "react";
37 +import { c as useMemoCache } from "react/compiler-runtime";
38 +import { useEffect, useState } from "react";
39 import { mutate } from "shared-runtime";
40
41 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-duplicate-import-specifier.expect.md
+2 -1
@@ -20,8 +20,9 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 import type { SetStateAction, Dispatch } from "react";
24 -import { useState, c as useMemoCache } from "react";
25 +import { useState } from "react";
26
27 function Component(_props) {
28 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-duplicate-instruction-from-merge-consecutive-scopes.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 import { Stringify } from "shared-runtime";
30
31 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-duplicate-type-import.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 import type { ReactElement } from "react";
23
24 function Component(_props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-hoisting-variable-collision.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Component(props) {
23 const $ = useMemoCache(5);
24 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-hoisting.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function Component(props) {
29 const $ = useMemoCache(4);
30 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-independently-memoized-property-load-for-method-call.expect.md
+1 -1
@@ -52,7 +52,7 @@ export const FIXTURE_ENTRYPOINT = {
52 ## Code
53
54 ```javascript
55 -import { c as useMemoCache } from "react";
55 +import { c as useMemoCache } from "react/compiler-runtime";
56 function Component(t0) {
57 const $ = useMemoCache(8);
58 const { label, highlightedItem } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-instruction-part-of-already-closed-scope.expect.md
+1 -1
@@ -31,7 +31,7 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react"; // @enableAssumeHooksFollowRulesOfReact
34 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableAssumeHooksFollowRulesOfReact
35 import { Stringify, identity, useHook } from "shared-runtime";
36
37 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-memoize-array-with-immutable-map-after-hook.expect.md
+2 -1
@@ -30,7 +30,8 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { useEffect, useState, c as useMemoCache } from "react";
33 +import { c as useMemoCache } from "react/compiler-runtime";
34 +import { useEffect, useState } from "react";
35
36 function Component(props) {
37 const $ = useMemoCache(11);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-missing-dependency-if-within-while.expect.md
+1 -1
@@ -36,7 +36,7 @@ export const FIXTURE_ENTRYPOINT = {
36 ## Code
37
38 ```javascript
39 -import { c as useMemoCache } from "react";
39 +import { c as useMemoCache } from "react/compiler-runtime";
40 const someGlobal = true;
41 export default function Component(props) {
42 const $ = useMemoCache(4);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-mutable-range-shared-inner-outer-function.expect.md
+1 -1
@@ -31,7 +31,7 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react"; // @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
34 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
35 let cond = true;
36 function Component(props) {
37 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-no-declarations-in-reactive-scope-with-early-return.expect.md
+1 -1
@@ -37,7 +37,7 @@ function Component() {
37 ## Code
38
39 ```javascript
40 -import { c as useMemoCache } from "react"; // @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
40 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
41 function Component() {
42 const $ = useMemoCache(9);
43 const items = useItems();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-no-value-for-temporary-reactive-scope-with-early-return.expect.md
+1 -1
@@ -33,7 +33,7 @@ export const FIXTURE_ENTRYPOINT = {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react";
36 +import { c as useMemoCache } from "react/compiler-runtime";
37 import { identity, makeObject_Primitives } from "shared-runtime";
38 import fbt from "fbt";
39
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-no-value-for-temporary.expect.md
+1 -1
@@ -15,7 +15,7 @@ function Component(listItem, thread) {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react";
18 +import { c as useMemoCache } from "react/compiler-runtime";
19 function Component(listItem, thread) {
20 const $ = useMemoCache(7);
21 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-non-identifier-object-keys.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function Foo() {
28 const $ = useMemoCache(1);
29 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-object-pattern.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function component(t) {
23 const $ = useMemoCache(2);
24 const { a } = t;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-reassign-to-variable-without-mutable-range.expect.md
+1 -1
@@ -19,7 +19,7 @@ function Component(a, b) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react"; // @debug
22 +import { c as useMemoCache } from "react/compiler-runtime"; // @debug
23 function Component(a, b) {
24 const $ = useMemoCache(11);
25 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-renaming-conflicting-decls.expect.md
+2 -1
@@ -41,8 +41,9 @@ export const FIXTURE_ENTRYPOINT = {
41 ## Code
42
43 ```javascript
44 +import { c as useMemoCache } from "react/compiler-runtime";
45 import { Stringify, identity, makeArray, toJSON } from "shared-runtime";
45 -import { useMemo, c as useMemoCache } from "react";
46 +import { useMemo } from "react";
47
48 function Component(props) {
49 const $ = useMemoCache(29);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-scope-missing-mutable-range.expect.md
+1 -1
@@ -18,7 +18,7 @@ function HomeDiscoStoreItemTileRating(props) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function HomeDiscoStoreItemTileRating(props) {
23 const $ = useMemoCache(4);
24 const item = useFragment();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-separate-scopes-for-divs.expect.md
+1 -1
@@ -39,7 +39,7 @@ const styles = {
39 ## Code
40
41 ```javascript
42 -import { c as useMemoCache } from "react";
42 +import { c as useMemoCache } from "react/compiler-runtime";
43 import { identity } from "shared-runtime";
44
45 const DISPLAY = true;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-undefined-expression-of-jsxexpressioncontainer.expect.md
+1 -1
@@ -44,7 +44,7 @@ export const FIXTURE_ENTRYPOINT = {
44 ## Code
45
46 ```javascript
47 -import { c as useMemoCache } from "react";
47 +import { c as useMemoCache } from "react/compiler-runtime";
48 import { StaticText1, Stringify, Text } from "shared-runtime";
49
50 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-unmerged-fbt-call-merge-overlapping-reactive-scopes.expect.md
+1 -1
@@ -31,7 +31,7 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react";
34 +import { c as useMemoCache } from "react/compiler-runtime";
35 import fbt from "fbt";
36 import { Stringify } from "shared-runtime";
37
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-unreachable-code-early-return-in-useMemo.expect.md
+2 -2
@@ -40,8 +40,8 @@ export const FIXTURE_ENTRYPOINT = {
40 ## Code
41
42 ```javascript
43 -// @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
44 -import { useMemo, useState, c as useMemoCache } from "react";
43 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
44 +import { useMemo, useState } from "react";
45 import { ValidateMemoization, identity } from "shared-runtime";
46
47 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro.expect.md
+1 -1
@@ -22,7 +22,7 @@ function Component(props) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function Component(props) {
27 const $ = useMemoCache(6);
28 const item = props.item;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rest-param-with-array-pattern.expect.md
+1 -1
@@ -16,7 +16,7 @@ export const FIXTURE_ENTRYPOINT = {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function Component(foo, ...t0) {
21 const $ = useMemoCache(3);
22 const [bar] = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rest-param-with-identifier.expect.md
+1 -1
@@ -16,7 +16,7 @@ export const FIXTURE_ENTRYPOINT = {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function Component(foo, ...t0) {
21 const $ = useMemoCache(3);
22 const bar = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rest-param-with-object-spread-pattern.expect.md
+1 -1
@@ -16,7 +16,7 @@ export const FIXTURE_ENTRYPOINT = {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function Component(foo, ...t0) {
21 const $ = useMemoCache(3);
22 const { bar } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rewrite-phis-in-lambda-capture-context.expect.md
+1 -1
@@ -22,7 +22,7 @@ function Component() {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function Component() {
27 const $ = useMemoCache(1);
28 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/allow-locals-named-like-hooks.expect.md
+1 -1
@@ -31,7 +31,7 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react";
34 +import { c as useMemoCache } from "react/compiler-runtime";
35 import { makeObject_Primitives } from "shared-runtime";
36
37 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/allow-props-named-like-hooks.expect.md
+1 -1
@@ -30,7 +30,7 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react";
33 +import { c as useMemoCache } from "react/compiler-runtime";
34 import { Stringify } from "shared-runtime";
35
36 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/rules-of-hooks-93dc5d5e538a.expect.md
+1 -1
@@ -17,7 +17,7 @@ function RegressionTest() {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react"; // Valid because the loop doesn't change the order of hooks calls.
20 +import { c as useMemoCache } from "react/compiler-runtime"; // Valid because the loop doesn't change the order of hooks calls.
21 function RegressionTest() {
22 const $ = useMemoCache(1);
23 const res = [];
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/rules-of-hooks-9a47e97b5d13.expect.md
+1 -1
@@ -14,7 +14,7 @@ const FancyButton = React.forwardRef(function (props, ref) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react"; // Valid because hooks can be used in anonymous function arguments to
17 +import { c as useMemoCache } 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);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/rules-of-hooks-e66a744cffbe.expect.md
+1 -1
@@ -14,7 +14,7 @@ const FancyButton = forwardRef(function (props, ref) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react"; // Valid because hooks can be used in anonymous function arguments to
17 +import { c as useMemoCache } 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);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/rules-of-hooks-eacfcaa6ef89.expect.md
+1 -1
@@ -14,7 +14,7 @@ const MemoizedFunction = memo(function (props) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react"; // Valid because hooks can be used in anonymous function arguments to
17 +import { c as useMemoCache } 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);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/todo.bail.rules-of-hooks-28a78701970c.expect.md
+1 -1
@@ -17,7 +17,7 @@ const MemoizedFunction = React.memo((props) => {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react"; // @skip
20 +import { c as useMemoCache } from "react/compiler-runtime"; // @skip
21 // Unsupported input
22
23 // Valid because hooks can be used in anonymous function arguments to
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/todo.bail.rules-of-hooks-6949b255e7eb.expect.md
+1 -1
@@ -78,7 +78,7 @@ const SomeName = () => {
78 ## Code
79
80 ```javascript
81 -import { c as useMemoCache } from "react"; // @skip
81 +import { c as useMemoCache } 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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/todo.bail.rules-of-hooks-e9f9bac89f8f.expect.md
+1 -1
@@ -17,7 +17,7 @@ const FancyButton = React.forwardRef((props, ref) => {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react"; // @skip
20 +import { c as useMemoCache } from "react/compiler-runtime"; // @skip
21 // Unsupported input
22
23 // Valid because hooks can be used in anonymous arrow-function arguments
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/todo.invalid.invalid-rules-of-hooks-e675f0a672d8.expect.md
+1 -1
@@ -20,7 +20,7 @@ function List(props) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react"; // @skip
23 +import { c as useMemoCache } from "react/compiler-runtime"; // @skip
24 // Passed but should have failed
25
26 // Invalid because it's dangerous and might not warn otherwise.
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/same-variable-as-dep-and-redeclare-maybe-frozen.expect.md
+1 -1
@@ -49,7 +49,7 @@ export const FIXTURE_ENTRYPOINT = {
49 ## Code
50
51 ```javascript
52 -import { c as useMemoCache } from "react"; // note: comments are for the ideal scopes, not what is currently
52 +import { c as useMemoCache } 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);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/same-variable-as-dep-and-redeclare.expect.md
+1 -1
@@ -49,7 +49,7 @@ export const FIXTURE_ENTRYPOINT = {
49 ## Code
50
51 ```javascript
52 -import { c as useMemoCache } from "react"; // note: comments are for the ideal scopes, not what is currently
52 +import { c as useMemoCache } 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);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/sequence-expression.expect.md
+1 -1
@@ -17,7 +17,7 @@ function foo() {}
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react";
20 +import { c as useMemoCache } from "react/compiler-runtime";
21 function sequence(props) {
22 const $ = useMemoCache(2);
23 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/sequential-destructuring-assignment-to-scope-declarations.expect.md
+1 -1
@@ -38,7 +38,7 @@ export const FIXTURE_ENTRYPOINT = {
38 ## Code
39
40 ```javascript
41 -import { c as useMemoCache } from "react";
41 +import { c as useMemoCache } from "react/compiler-runtime";
42 import { identity } from "shared-runtime";
43
44 function Component(statusName) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/sequential-destructuring-both-mixed-local-and-scope-declaration.expect.md
+1 -1
@@ -41,7 +41,7 @@ export const FIXTURE_ENTRYPOINT = {
41 ## Code
42
43 ```javascript
44 -import { c as useMemoCache } from "react";
44 +import { c as useMemoCache } from "react/compiler-runtime";
45 import { identity } from "shared-runtime";
46
47 function Component(statusName) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/simple-alias.expect.md
+1 -1
@@ -19,7 +19,7 @@ function foo() {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function mutate() {}
24 function foo() {
25 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/simple-function-1.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function component() {
25 const $ = useMemoCache(1);
26 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/simple-scope.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function foo(a) {
23 const $ = useMemoCache(2);
24 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/simple.expect.md
+1 -1
@@ -14,7 +14,7 @@ export default function foo(x, y) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react";
17 +import { c as useMemoCache } from "react/compiler-runtime";
18 export default function foo(x, y) {
19 const $ = useMemoCache(4);
20 if (x) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-arrayexpression.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function Component(props) {
25 const $ = useMemoCache(1);
26 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-call-jsx-2.expect.md
+1 -1
@@ -21,7 +21,7 @@ function Component(props) {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react"; // @Pass runMutableRangeAnalysis
24 +import { c as useMemoCache } from "react/compiler-runtime"; // @Pass runMutableRangeAnalysis
25 function foo() {}
26
27 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-call-jsx.expect.md
+1 -1
@@ -18,7 +18,7 @@ function Component(props) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function foo() {}
23
24 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-cascading-eliminated-phis.expect.md
+1 -1
@@ -29,7 +29,7 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { c as useMemoCache } from "react";
32 +import { c as useMemoCache } from "react/compiler-runtime";
33 function Component(props) {
34 const $ = useMemoCache(4);
35 let x = 0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-for-of.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function foo(cond) {
29 const $ = useMemoCache(1);
30 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-leave-case.expect.md
+1 -1
@@ -22,7 +22,7 @@ function Component(props) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function Component(props) {
27 const $ = useMemoCache(6);
28 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-newexpression.expect.md
+1 -1
@@ -16,7 +16,7 @@ function Component(props) {
16 ## Code
17
18 ```javascript
19 -import { c as useMemoCache } from "react";
19 +import { c as useMemoCache } from "react/compiler-runtime";
20 function Foo() {}
21
22 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-non-empty-initializer.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function foo(a, b) {
28 const $ = useMemoCache(1);
29 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-objectexpression-phi.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 function foo() {
32 const $ = useMemoCache(1);
33 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-objectexpression.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function Component(props) {
25 const $ = useMemoCache(1);
26 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-alias-alias-mutate-if.expect.md
+1 -1
@@ -21,7 +21,7 @@ function foo(a) {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function foo(a) {
26 const $ = useMemoCache(2);
27 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-alias-if.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 function foo(a) {
30 const $ = useMemoCache(4);
31 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-alias-mutate-if.expect.md
+1 -1
@@ -20,7 +20,7 @@ function foo(a) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function foo(a) {
25 const $ = useMemoCache(2);
26 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-alias-mutate-inside-if.expect.md
+1 -1
@@ -20,7 +20,7 @@ function foo(a) {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function foo(a) {
25 const $ = useMemoCache(3);
26 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-alias-mutate.expect.md
+1 -1
@@ -18,7 +18,7 @@ function foo() {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function foo() {
23 const $ = useMemoCache(1);
24 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-call.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function foo() {
25 const $ = useMemoCache(1);
26 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-mutate-2.expect.md
+1 -1
@@ -15,7 +15,7 @@ function foo() {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react";
18 +import { c as useMemoCache } from "react/compiler-runtime";
19 function foo() {
20 const $ = useMemoCache(1);
21 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-mutate-alias.expect.md
+1 -1
@@ -18,7 +18,7 @@ function foo() {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function foo() {
23 const $ = useMemoCache(1);
24 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-mutate.expect.md
+1 -1
@@ -15,7 +15,7 @@ function foo() {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react";
18 +import { c as useMemoCache } from "react/compiler-runtime";
19 function foo() {
20 const $ = useMemoCache(1);
21 let y;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function foo() {
25 const $ = useMemoCache(2);
26 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-reassign-in-rval.expect.md
+1 -1
@@ -14,7 +14,7 @@ function Component() {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react"; // Forget should call the original x (x = foo()) to compute result
17 +import { c as useMemoCache } from "react/compiler-runtime"; // Forget should call the original x (x = foo()) to compute result
18 function Component() {
19 const $ = useMemoCache(3);
20 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-ternary-destruction-with-mutation.expect.md
+1 -1
@@ -15,7 +15,7 @@ function foo(props) {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react";
18 +import { c as useMemoCache } from "react/compiler-runtime";
19 function foo(props) {
20 const $ = useMemoCache(2);
21 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-ternary-destruction.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function foo(props) {
25 const $ = useMemoCache(4);
26 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-ternary-with-mutation.expect.md
+1 -1
@@ -15,7 +15,7 @@ function foo(props) {
15 ## Code
16
17 ```javascript
18 -import { c as useMemoCache } from "react";
18 +import { c as useMemoCache } from "react/compiler-runtime";
19 function foo(props) {
20 const $ = useMemoCache(2);
21 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-ternary.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function foo(props) {
25 const $ = useMemoCache(4);
26 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-unconditional-ternary-with-mutation.expect.md
+1 -1
@@ -28,7 +28,7 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react";
31 +import { c as useMemoCache } from "react/compiler-runtime";
32 import { arrayPush } from "shared-runtime";
33 function foo(props) {
34 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-unconditional-ternary.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function foo(props) {
27 const $ = useMemoCache(4);
28 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-unconditional-with-mutation.expect.md
+1 -1
@@ -23,7 +23,7 @@ function foo(props) {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function foo(props) {
28 const $ = useMemoCache(2);
29 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-via-destructuring-with-mutation.expect.md
+1 -1
@@ -19,7 +19,7 @@ function foo(props) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function foo(props) {
24 const $ = useMemoCache(2);
25 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-via-destructuring.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function foo(props) {
29 const $ = useMemoCache(4);
30 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-with-mutation.expect.md
+1 -1
@@ -19,7 +19,7 @@ function foo(props) {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function foo(props) {
24 const $ = useMemoCache(2);
25 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function foo(props) {
29 const $ = useMemoCache(4);
30 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/store-via-call.expect.md
+1 -1
@@ -14,7 +14,7 @@ function foo() {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react";
17 +import { c as useMemoCache } from "react/compiler-runtime";
18 function foo() {
19 const $ = useMemoCache(1);
20 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/store-via-new.expect.md
+1 -1
@@ -14,7 +14,7 @@ function Foo() {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react";
17 +import { c as useMemoCache } from "react/compiler-runtime";
18 function Foo() {
19 const $ = useMemoCache(1);
20 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/switch-non-final-default.expect.md
+1 -1
@@ -31,7 +31,7 @@ function Component(props) {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react";
34 +import { c as useMemoCache } from "react/compiler-runtime";
35 function Component(props) {
36 const $ = useMemoCache(9);
37 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/switch-with-only-default.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 import { Stringify } from "shared-runtime";
26
27 function Component(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/switch.expect.md
+1 -1
@@ -26,7 +26,7 @@ function Component(props) {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react";
29 +import { c as useMemoCache } from "react/compiler-runtime";
30 function Component(props) {
31 const $ = useMemoCache(8);
32 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/tagged-template-literal.expect.md
+1 -1
@@ -24,7 +24,7 @@ function component() {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function component() {
29 const $ = useMemoCache(1);
30 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/temporary-accessed-outside-scope.expect.md
+1 -1
@@ -13,7 +13,7 @@ function Component(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react";
16 +import { c as useMemoCache } from "react/compiler-runtime";
17 function Component(props) {
18 const $ = useMemoCache(6);
19 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/temporary-at-start-of-value-block.expect.md
+1 -1
@@ -13,7 +13,7 @@ function component(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react";
16 +import { c as useMemoCache } from "react/compiler-runtime";
17 function component(props) {
18 const $ = useMemoCache(2);
19 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/temporary-property-load-accessed-outside-scope.expect.md
+1 -1
@@ -13,7 +13,7 @@ function Component(props) {
13 ## Code
14
15 ```javascript
16 -import { c as useMemoCache } from "react";
16 +import { c as useMemoCache } from "react/compiler-runtime";
17 function Component(props) {
18 const $ = useMemoCache(6);
19 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/timers.expect.md
+1 -1
@@ -18,7 +18,7 @@ function Component(props) {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Component(props) {
23 const $ = useMemoCache(2);
24 const start = performance.now();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/todo-function-expression-captures-value-later-frozen.expect.md
+1 -1
@@ -22,7 +22,7 @@ function Component(props) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function Component(props) {
27 const $ = useMemoCache(4);
28 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/todo.unnecessary-lambda-memoization.expect.md
+1 -1
@@ -22,7 +22,7 @@ function Component(props) {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function Component(props) {
27 const $ = useMemoCache(5);
28 const data = useFreeze();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/transitive-freeze-array.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react"; // @enablePreserveExistingMemoizationGuarantees
28 +import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
29 const { mutate } = require("shared-runtime");
30
31 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/transitive-freeze-function-expressions.expect.md
+1 -1
@@ -31,7 +31,7 @@ function Component(props) {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react"; // @enableTransitivelyFreezeFunctionExpressions
34 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableTransitivelyFreezeFunctionExpressions
35 function Component(props) {
36 const $ = useMemoCache(10);
37 const { data, loadNext, isLoadingNext } =
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-alias-try-values.expect.md
+1 -1
@@ -28,7 +28,7 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react";
31 +import { c as useMemoCache } from "react/compiler-runtime";
32 const { throwInput } = require("shared-runtime");
33
34 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-in-nested-scope.expect.md
+1 -1
@@ -36,7 +36,7 @@ export const FIXTURE_ENTRYPOINT = {
36 ## Code
37
38 ```javascript
39 -import { c as useMemoCache } from "react";
39 +import { c as useMemoCache } from "react/compiler-runtime";
40 import { mutate, setProperty, throwErrorWithMessageIf } from "shared-runtime";
41
42 function useFoo(t0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-mutate-outer-value.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 const { shallowCopy, throwErrorWithMessage } = require("shared-runtime");
29
30 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-try-value-modified-in-catch-escaping.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 const { throwInput } = require("shared-runtime");
32
33 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-try-value-modified-in-catch.expect.md
+1 -1
@@ -26,7 +26,7 @@ export const FIXTURE_ENTRYPOINT = {
26 ## Code
27
28 ```javascript
29 -import { c as useMemoCache } from "react";
29 +import { c as useMemoCache } from "react/compiler-runtime";
30 const { throwInput } = require("shared-runtime");
31
32 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-with-catch-param.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 const { throwInput } = require("shared-runtime");
32
33 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-with-return.expect.md
+1 -1
@@ -28,7 +28,7 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { c as useMemoCache } from "react";
31 +import { c as useMemoCache } from "react/compiler-runtime";
32 const { shallowCopy, throwInput } = require("shared-runtime");
33
34 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-within-function-expression-returns-caught-value.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 import { throwInput } from "shared-runtime";
30
31 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-within-function-expression.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function Component(props) {
28 const $ = useMemoCache(2);
29 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-within-mutable-range.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 const { throwErrorWithMessage, shallowCopy } = require("shared-runtime");
30
31 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-within-object-method-returns-caught-value.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 import { throwInput } from "shared-runtime";
32
33 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-within-object-method.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 function Component(props) {
30 const $ = useMemoCache(1);
31 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 const { throwErrorWithMessage } = require("shared-runtime");
29
30 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-alias-declaration.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Component(props) {
23 const $ = useMemoCache(2);
24 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-alias.flow.expect.md
+1 -1
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function Component(props) {
23 const $ = useMemoCache(2);
24 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-annotations/todo_type-annotations-props.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react"; // @enableUseTypeAnnotations
23 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableUseTypeAnnotations
24 function useArray(items) {
25 const $ = useMemoCache(3);
26 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-annotations/type-annotation-as-array.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react"; // @enableUseTypeAnnotations
26 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableUseTypeAnnotations
27 function Component(props) {
28 const $ = useMemoCache(4);
29 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-annotations/type-annotation-as-array_.flow.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 import { identity, makeArray } from "shared-runtime";
26
27 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-annotations/type-annotation-var-array.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react"; // @enableUseTypeAnnotations
26 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableUseTypeAnnotations
27 function Component(props) {
28 const $ = useMemoCache(4);
29 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-annotations/type-annotation-var-array_.flow.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 import { identity } from "shared-runtime";
30
31 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-cast-expression.flow.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 type Foo = { bar: string };
27 function Component(props) {
28 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-field-load.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function component() {
24 const $ = useMemoCache(1);
25 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-test-field-load-binary-op.expect.md
+1 -1
@@ -19,7 +19,7 @@ function component() {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function component() {
24 const $ = useMemoCache(2);
25 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-test-field-store.expect.md
+1 -1
@@ -21,7 +21,7 @@ export const FIXTURE_ENTRYPOINT = {
21 ## Code
22
23 ```javascript
24 -import { c as useMemoCache } from "react";
24 +import { c as useMemoCache } from "react/compiler-runtime";
25 function component() {
26 const $ = useMemoCache(1);
27 let x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-test-polymorphic.expect.md
+1 -1
@@ -22,7 +22,7 @@ function component() {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function component() {
27 const $ = useMemoCache(2);
28 const p = makePrimitive();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/type-test-return-type-inference.expect.md
+1 -1
@@ -18,7 +18,7 @@ function component() {
18 ## Code
19
20 ```javascript
21 -import { c as useMemoCache } from "react";
21 +import { c as useMemoCache } from "react/compiler-runtime";
22 function component() {
23 const $ = useMemoCache(1);
24 const x = foo();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/unary-expr.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 function component(a) {
30 const $ = useMemoCache(8);
31 const t = { t: a };
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/uninitialized-declaration-in-reactive-scope.expect.md
+1 -1
@@ -14,7 +14,7 @@ function Component(props) {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react";
17 +import { c as useMemoCache } from "react/compiler-runtime";
18 function Component(props) {
19 const $ = useMemoCache(1);
20 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/unlabeled-break-within-label-loop.expect.md
+1 -1
@@ -27,7 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -import { c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime";
31 function useHook(end) {
32 const $ = useMemoCache(2);
33 let log;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/unlabeled-break-within-label-switch.expect.md
+1 -1
@@ -30,7 +30,7 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 -import { c as useMemoCache } from "react";
33 +import { c as useMemoCache } from "react/compiler-runtime";
34 import { CONST_STRING0 } from "shared-runtime";
35
36 function useHook(cond) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/unmemoized-nonreactive-dependency-is-pruned-as-dependency.expect.md
+1 -1
@@ -25,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 import { mutate, useNoAlias } from "shared-runtime";
30
31 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/unused-object-element-with-rest.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function Foo(props) {
24 const $ = useMemoCache(2);
25 let rest;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/update-expression-constant-propagation.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function Component() {
27 const $ = useMemoCache(1);
28 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/update-expression-in-sequence.expect.md
+1 -1
@@ -24,7 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function Component(props) {
29 const $ = useMemoCache(5);
30 let a = props.x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/update-expression-on-function-parameter-1.expect.md
+1 -1
@@ -23,7 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ## Code
24
25 ```javascript
26 -import { c as useMemoCache } from "react";
26 +import { c as useMemoCache } from "react/compiler-runtime";
27 function Component(t0) {
28 const $ = useMemoCache(10);
29 let { a, b: t1, c: t2 } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/update-expression-on-function-parameter-2.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function Component(a) {
24 const $ = useMemoCache(4);
25 const d = a++;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/update-expression-on-function-parameter-3.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function Component(t0) {
24 const $ = useMemoCache(4);
25 let { c } = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/update-expression-on-function-parameter-4.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function Component(t0) {
24 const $ = useMemoCache(4);
25 let [b] = t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/update-expression.expect.md
+1 -1
@@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 function foo(props) {
25 const $ = useMemoCache(4);
26 let x = props.x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/use-callback-simple.expect.md
+1 -1
@@ -14,7 +14,7 @@ function component() {
14 ## Code
15
16 ```javascript
17 -import { c as useMemoCache } from "react";
17 +import { c as useMemoCache } from "react/compiler-runtime";
18 function component() {
19 const $ = useMemoCache(4);
20 const [count, setCount] = useState(0);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/use-memo-simple.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 function Component(props) {
24 "use memo";
25 const $ = useMemoCache(4);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/use-operator-call-expression.expect.md
+2 -1
@@ -41,8 +41,9 @@ export const FIXTURE_ENTRYPOINT = {
41 ## Code
42
43 ```javascript
44 +import { c as useMemoCache } from "react/compiler-runtime";
45 import { ValidateMemoization } from "shared-runtime";
45 -import { use, useMemo, c as useMemoCache } from "react";
46 +import { use, useMemo } from "react";
47
48 const FooContext = React.createContext(null);
49 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/use-operator-conditional.expect.md
+2 -1
@@ -50,8 +50,9 @@ export const FIXTURE_ENTRYPOINT = {
50 ## Code
51
52 ```javascript
53 +import { c as useMemoCache } from "react/compiler-runtime";
54 import { ValidateMemoization } from "shared-runtime";
54 -import { use, useMemo, c as useMemoCache } from "react";
55 +import { use, useMemo } from "react";
56
57 const FooContext = React.createContext(null);
58 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/use-operator-method-call.expect.md
+2 -1
@@ -42,8 +42,9 @@ export const FIXTURE_ENTRYPOINT = {
42 ## Code
43
44 ```javascript
45 +import { c as useMemoCache } from "react/compiler-runtime";
46 import { ValidateMemoization } from "shared-runtime";
46 -import { useMemo, c as useMemoCache } from "react";
47 +import { useMemo } from "react";
48 import * as React from "react";
49
50 const FooContext = React.createContext(null);
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,8 +39,8 @@ export const FIXTURE_ENTRYPOINT = {
39 ## Code
40
41 ```javascript
42 -// @enablePreserveExistingMemoizationGuarantees:false @enableTransitivelyFreezeFunctionExpressions:false
43 -import { useCallback, c as useMemoCache } from "react";
42 +import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees:false @enableTransitivelyFreezeFunctionExpressions:false
43 +import { useCallback } from "react";
44 import {
45 identity,
46 logValue,
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,8 +39,8 @@ export const FIXTURE_ENTRYPOINT = {
39 ## Code
40
41 ```javascript
42 -// @enablePreserveExistingMemoizationGuarantees
43 -import { useCallback, c as useMemoCache } from "react";
42 +import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
43 +import { useCallback } from "react";
44 import {
45 identity,
46 logValue,
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useCallback-maybe-modify-free-variable-preserve-memoization-guarantee.expect.md
+2 -2
@@ -35,8 +35,8 @@ export const FIXTURE_ENTRYPOINT = {
35 ## Code
36
37 ```javascript
38 -// @enablePreserveExistingMemoizationGuarantees
39 -import { useCallback, c as useMemoCache } from "react";
38 +import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
39 +import { useCallback } from "react";
40 import {
41 identity,
42 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,8 +31,8 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -// @enablePreserveExistingMemoizationGuarantees
35 -import { useCallback, useRef, c as useMemoCache } from "react";
34 +import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
35 +import { useCallback, useRef } from "react";
36
37 function Component(props) {
38 const $ = useMemoCache(6);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useCallback-set-ref-nested-property-dont-preserve-memoization.expect.md
+2 -2
@@ -29,8 +29,8 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -// @enablePreserveExistingMemoizationGuarantees:false
33 -import { useCallback, useRef, c as useMemoCache } from "react";
32 +import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees:false
33 +import { useCallback, useRef } from "react";
34
35 function Component(props) {
36 const $ = useMemoCache(3);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useCallback-set-ref-nested-property-preserve-memoization.expect.md
+2 -2
@@ -27,8 +27,8 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -// @enablePreserveExistingMemoizationGuarantees
31 -import { useCallback, useRef, c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
31 +import { useCallback, useRef } from "react";
32
33 function Component(props) {
34 const $ = useMemoCache(4);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useCallback-set-ref-nested-property.expect.md
+2 -1
@@ -28,7 +28,8 @@ export const FIXTURE_ENTRYPOINT = {
28 ## Code
29
30 ```javascript
31 -import { useCallback, useRef, c as useMemoCache } from "react";
31 +import { c as useMemoCache } 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
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useCallback-set-ref-value-dont-preserve-memoization.expect.md
+2 -2
@@ -27,8 +27,8 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -// @enablePreserveExistingMemoizationGuarantees
31 -import { useCallback, useRef, c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
31 +import { useCallback, useRef } from "react";
32
33 function Component(props) {
34 const $ = useMemoCache(3);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useCallback-set-ref-value-preserve-memoization.expect.md
+2 -2
@@ -27,8 +27,8 @@ export const FIXTURE_ENTRYPOINT = {
27 ## Code
28
29 ```javascript
30 -// @enablePreserveExistingMemoizationGuarantees
31 -import { useCallback, useRef, c as useMemoCache } from "react";
30 +import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
31 +import { useCallback, useRef } from "react";
32
33 function Component(props) {
34 const $ = useMemoCache(3);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useContext-maybe-mutate-context-in-callback.expect.md
+2 -1
@@ -30,8 +30,9 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
33 +import { c as useMemoCache } from "react/compiler-runtime";
34 import * as React from "react";
34 -import { useContext, c as useMemoCache } from "react";
35 +import { useContext } from "react";
36 import { mutate } from "shared-runtime";
37
38 const FooContext = React.createContext({ current: null });
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useContext-read-context-in-callback-if-condition.expect.md
+2 -1
@@ -32,7 +32,8 @@ export const FIXTURE_ENTRYPOINT = {
32 ## Code
33
34 ```javascript
35 -import { createContext, useContext, c as useMemoCache } from "react";
35 +import { c as useMemoCache } from "react/compiler-runtime";
36 +import { createContext, useContext } from "react";
37 import { Stringify } from "shared-runtime";
38
39 const FooContext = createContext({ current: true });
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useContext-read-context-in-callback.expect.md
+2 -1
@@ -25,7 +25,8 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
28 -import { createContext, useContext, c as useMemoCache } from "react";
28 +import { c as useMemoCache } from "react/compiler-runtime";
29 +import { createContext, useContext } from "react";
30
31 const FooContext = createContext({ current: null });
32
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useEffect-arg-memoized.expect.md
+1 -1
@@ -24,7 +24,7 @@ function Component(props) {
24 ## Code
25
26 ```javascript
27 -import { c as useMemoCache } from "react";
27 +import { c as useMemoCache } from "react/compiler-runtime";
28 function Component(props) {
29 const $ = useMemoCache(6);
30 const dispatch = useDispatch();
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useEffect-external-mutate.expect.md
+2 -1
@@ -22,7 +22,8 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { useEffect, c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 +import { useEffect } from "react";
27
28 let x = { a: 42 };
29
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useEffect-global-pruned.expect.md
+2 -1
@@ -31,7 +31,8 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { useEffect, c as useMemoCache } from "react";
34 +import { c as useMemoCache } from "react/compiler-runtime";
35 +import { useEffect } from "react";
36
37 function someGlobal() {}
38 function useFoo() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useEffect-method-call.expect.md
+1 -1
@@ -19,7 +19,7 @@ export const FIXTURE_ENTRYPOINT = {
19 ## Code
20
21 ```javascript
22 -import { c as useMemoCache } from "react";
22 +import { c as useMemoCache } from "react/compiler-runtime";
23 let x = {};
24 function Component() {
25 const $ = useMemoCache(1);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useEffect-namespace-pruned.expect.md
+1 -1
@@ -31,7 +31,7 @@ export const FIXTURE_ENTRYPOINT = {
31 ## Code
32
33 ```javascript
34 -import { c as useMemoCache } from "react";
34 +import { c as useMemoCache } from "react/compiler-runtime";
35 import * as React from "react";
36
37 function someGlobal() {}
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useEffect-nested-lambdas.expect.md
+1 -1
@@ -32,7 +32,7 @@ function Component(props) {
32 ## Code
33
34 ```javascript
35 -import { c as useMemoCache } from "react"; // @enableTransitivelyFreezeFunctionExpressions:false
35 +import { c as useMemoCache } from "react/compiler-runtime"; // @enableTransitivelyFreezeFunctionExpressions:false
36
37 function Component(props) {
38 const $ = useMemoCache(9);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-if-else-multiple-return.expect.md
+1 -1
@@ -17,7 +17,7 @@ function Component(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react";
20 +import { c as useMemoCache } from "react/compiler-runtime";
21 function Component(props) {
22 const $ = useMemoCache(4);
23 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-independently-memoizeable.expect.md
+1 -1
@@ -17,7 +17,7 @@ function Component(props) {
17 ## Code
18
19 ```javascript
20 -import { c as useMemoCache } from "react";
20 +import { c as useMemoCache } from "react/compiler-runtime";
21 function Component(props) {
22 const $ = useMemoCache(10);
23 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-inlining-block-return.expect.md
+1 -1
@@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -import { c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime";
26 function component(a, b) {
27 const $ = useMemoCache(2);
28 let t0;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-mabye-modified-free-variable-preserve-memoization-guarantees.expect.md
+2 -2
@@ -46,8 +46,8 @@ export const FIXTURE_ENTRYPOINT = {
46 ## Code
47
48 ```javascript
49 -// @enablePreserveExistingMemoizationGuarantees
50 -import { useMemo, c as useMemoCache } from "react";
49 +import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
50 +import { useMemo } from "react";
51 import {
52 identity,
53 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,8 +22,8 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -// @enablePreserveExistingMemoizationGuarantees:false
26 -import { useMemo, c as useMemoCache } from "react";
25 +import { c as useMemoCache } 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) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-maybe-modified-later-preserve-memoization-guarantees.expect.md
+2 -2
@@ -22,8 +22,8 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
25 -// @enablePreserveExistingMemoizationGuarantees
26 -import { useMemo, c as useMemoCache } from "react";
25 +import { c as useMemoCache } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
26 +import { useMemo } from "react";
27 import { identity, makeObject_Primitives, mutate } from "shared-runtime";
28
29 function Component(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-multiple-if-else.expect.md
+2 -1
@@ -29,7 +29,8 @@ export const FIXTURE_ENTRYPOINT = {
29 ## Code
30
31 ```javascript
32 -import { useMemo, c as useMemoCache } from "react";
32 +import { c as useMemoCache } from "react/compiler-runtime";
33 +import { useMemo } from "react";
34
35 function Component(props) {
36 const $ = useMemoCache(3);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-named-function.expect.md
+2 -1
@@ -20,7 +20,8 @@ export const FIXTURE_ENTRYPOINT = {
20 ## Code
21
22 ```javascript
23 -import { useMemo, c as useMemoCache } from "react";
23 +import { c as useMemoCache } from "react/compiler-runtime";
24 +import { useMemo } from "react";
25 import { makeArray } from "shared-runtime";
26
27 function Component() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-simple.expect.md
+1 -1
@@ -12,7 +12,7 @@ function component(a) {
12 ## Code
13
14 ```javascript
15 -import { c as useMemoCache } from "react";
15 +import { c as useMemoCache } from "react/compiler-runtime";
16 function component(a) {
17 const $ = useMemoCache(4);
18 let t0;
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
+1 -1
@@ -33,7 +33,7 @@ function Component(props) {
33 ## Code
34
35 ```javascript
36 -import { c as useMemoCache } from "react"; // @validateNoSetStateInRender @enableAssumeHooksFollowRulesOfReact
36 +import { c as useMemoCache } from "react/compiler-runtime"; // @validateNoSetStateInRender @enableAssumeHooksFollowRulesOfReact
37 function Component(props) {
38 const $ = useMemoCache(7);
39 const logEvent = useLogging(props.appId);
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,8 +37,8 @@ export const FIXTURE_ENTRYPOINT = {
37 ## Code
38
39 ```javascript
40 -// @validateNoSetStateInRender
41 -import { useState, c as useMemoCache } from "react";
40 +import { c as useMemoCache } from "react/compiler-runtime"; // @validateNoSetStateInRender
41 +import { useState } from "react";
42
43 function Component(props) {
44 const $ = useMemoCache(2);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/value-block-mutates-outer-value.expect.md
+1 -1
@@ -34,7 +34,7 @@ export const FIXTURE_ENTRYPOINT = {
34 ## Code
35
36 ```javascript
37 -import { c as useMemoCache } from "react";
37 +import { c as useMemoCache } from "react/compiler-runtime";
38 import { makeArray, useHook } from "shared-runtime";
39
40 /**
compiler/packages/snap/src/compiler.ts
+1 -2
@@ -38,8 +38,7 @@ function makePluginOptions(
38 let enableEmitFreeze = null;
39 let enableEmitHookGuards = null;
40 let compilationMode: CompilationMode = "all";
41 - // TODO make this `null` to use the default runtime module, needs an upgrade to React 19
42 - let runtimeModule = "react";
41 + let runtimeModule = null;
42 let panicThreshold: PanicThresholdOptions = "all_errors";
43 let hookPattern: string | null = null;
44 // TODO(@mofeiZ) rewrite snap fixtures to @validatePreserveExistingMemo:false