diff --git a/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts b/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts index b092800a2e12d..10bcebe44e976 100644 --- a/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts +++ b/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts @@ -87,17 +87,6 @@ export type PluginOptions = { */ compilationMode: CompilationMode; - /* - * If enabled, Forget will import `useMemoCache` from the given module - * instead of `react/compiler-runtime`. - * - * ``` - * // If set to "react-compiler-runtime" - * import {c as useMemoCache} from 'react-compiler-runtime'; - * ``` - */ - runtimeModule?: string | null | undefined; - /** * By default React Compiler will skip compilation of code that suppresses the default * React ESLint rules, since this is a strong indication that the code may be breaking React rules @@ -214,7 +203,6 @@ export const defaultOptions: PluginOptions = { logger: null, gating: null, noEmit: false, - runtimeModule: null, eslintSuppressionRules: null, flowSuppressions: true, ignoreUseNoForget: false, diff --git a/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/userspace-use-memo-cache.expect.md b/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/userspace-use-memo-cache.expect.md deleted file mode 100644 index 972d1069072bb..0000000000000 --- a/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/userspace-use-memo-cache.expect.md +++ /dev/null @@ -1,80 +0,0 @@ - -## Input - -```javascript -// @runtimeModule="react-compiler-runtime" -import {useState} from 'react'; - -function Component(props) { - const [x, setX] = useState(1); - let y; - if (props.cond) { - y = x * 2; - } - return ( - - ); -} - -export const FIXTURE_ENTRYPOINT = { - fn: Component, - params: [true], - isComponent: true, -}; - -``` - -## Code - -```javascript -import { c as _c } from "react/compiler-runtime"; // @runtimeModule="react-compiler-runtime" -import { useState } from "react"; - -function Component(props) { - const $ = _c(5); - const [x, setX] = useState(1); - let y; - if ($[0] !== props.cond || $[1] !== x) { - if (props.cond) { - y = x * 2; - } - $[0] = props.cond; - $[1] = x; - $[2] = y; - } else { - y = $[2]; - } - - const t0 = y; - let t1; - if ($[3] !== t0) { - t1 = ( - - ); - $[3] = t0; - $[4] = t1; - } else { - t1 = $[4]; - } - return t1; -} - -export const FIXTURE_ENTRYPOINT = { - fn: Component, - params: [true], - isComponent: true, -}; - -``` - \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/userspace-use-memo-cache.js b/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/userspace-use-memo-cache.js deleted file mode 100644 index 1e6d5f435dd32..0000000000000 --- a/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/userspace-use-memo-cache.js +++ /dev/null @@ -1,24 +0,0 @@ -// @runtimeModule="react-compiler-runtime" -import {useState} from 'react'; - -function Component(props) { - const [x, setX] = useState(1); - let y; - if (props.cond) { - y = x * 2; - } - return ( - - ); -} - -export const FIXTURE_ENTRYPOINT = { - fn: Component, - params: [true], - isComponent: true, -}; diff --git a/compiler/packages/snap/src/compiler.ts b/compiler/packages/snap/src/compiler.ts index 72212ea0e94d7..cd907575fb797 100644 --- a/compiler/packages/snap/src/compiler.ts +++ b/compiler/packages/snap/src/compiler.ts @@ -48,7 +48,6 @@ function makePluginOptions( let enableEmitFreeze = null; let enableEmitHookGuards = null; let compilationMode: CompilationMode = 'all'; - let runtimeModule = null; let panicThreshold: PanicThresholdOptions = 'all_errors'; let hookPattern: string | null = null; // TODO(@mofeiZ) rewrite snap fixtures to @validatePreserveExistingMemo:false @@ -104,10 +103,6 @@ function makePluginOptions( importSpecifierName: '$dispatcherGuard', }; } - const runtimeModuleMatch = /@runtimeModule="([^"]+)"/.exec(firstLine); - if (runtimeModuleMatch) { - runtimeModule = runtimeModuleMatch[1]; - } const targetMatch = /@target="([^"]+)"/.exec(firstLine); if (targetMatch) { @@ -251,7 +246,6 @@ function makePluginOptions( gating, panicThreshold, noEmit: false, - runtimeModule, eslintSuppressionRules, flowSuppressions, ignoreUseNoForget,