Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rcr] Remove runtimeModule compiler option #31145

Merged
merged 23 commits into from
Oct 7, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -214,7 +203,6 @@ export const defaultOptions: PluginOptions = {
logger: null,
gating: null,
noEmit: false,
runtimeModule: null,
eslintSuppressionRules: null,
flowSuppressions: true,
ignoreUseNoForget: false,
Expand Down

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions compiler/packages/snap/src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -251,7 +246,6 @@ function makePluginOptions(
gating,
panicThreshold,
noEmit: false,
runtimeModule,
eslintSuppressionRules,
flowSuppressions,
ignoreUseNoForget,
Expand Down