diff --git a/compiler/apps/playground/babel.config.js b/compiler/apps/playground/babel.config.js
index 0edf2e9b72d70..954638caaff9c 100644
--- a/compiler/apps/playground/babel.config.js
+++ b/compiler/apps/playground/babel.config.js
@@ -9,13 +9,6 @@ module.exports = function (api) {
api.cache(true);
return {
presets: ['next/babel'],
- plugins: [
- [
- 'babel-plugin-react-compiler',
- {
- runtimeModule: 'react-compiler-runtime',
- },
- ],
- ],
+ plugins: [['babel-plugin-react-compiler']],
};
};
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 e966497256511..5ac6d1aa15cd5 100644
--- a/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts
+++ b/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts
@@ -86,17 +86,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
@@ -202,7 +191,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/Entrypoint/Program.ts b/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts
index c38efa50a31ad..2155170c2791e 100644
--- a/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts
+++ b/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts
@@ -298,7 +298,6 @@ export function compileProgram(
return;
}
const useMemoCacheIdentifier = program.scope.generateUidIdentifier('c');
- const moduleName = pass.opts.runtimeModule ?? 'react-compiler-runtime';
/*
* Record lint errors and critical errors as depending on Forget's config,
@@ -605,7 +604,7 @@ export function compileProgram(
if (needsMemoCacheFunctionImport) {
updateMemoCacheFunctionImport(
program,
- moduleName,
+ 'react-compiler-runtime',
useMemoCacheIdentifier.name,
);
}
@@ -638,8 +637,7 @@ function shouldSkipCompilation(
}
}
- const moduleName = pass.opts.runtimeModule ?? 'react-compiler-runtime';
- if (hasMemoCacheFunctionImport(program, moduleName)) {
+ if (hasMemoCacheFunctionImport(program, 'react-compiler-runtime')) {
return true;
}
return 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 071cd1ce9fd8a..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 bbb6aeded750c..5f71f552cbc50 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
@@ -103,10 +102,7 @@ function makePluginOptions(
importSpecifierName: '$dispatcherGuard',
};
}
- const runtimeModuleMatch = /@runtimeModule="([^"]+)"/.exec(firstLine);
- if (runtimeModuleMatch) {
- runtimeModule = runtimeModuleMatch[1];
- }
+
if (firstLine.includes('@panicThreshold(none)')) {
panicThreshold = 'none';
}
@@ -243,7 +239,6 @@ function makePluginOptions(
gating,
panicThreshold,
noEmit: false,
- runtimeModule,
eslintSuppressionRules,
flowSuppressions,
ignoreUseNoForget,