Skip to content

Commit

Permalink
[rcr] Remove runtimeModule compiler option
Browse files Browse the repository at this point in the history
Now that the compiler always injects `react-compiler-runtime`, this
option is unnecessary.

ghstack-source-id: 6ad6822793525e72635de3aec5caeb232d308ff3
ghstack-comment-id: 2397700297
Pull Request resolved: #31145
  • Loading branch information
poteto committed Oct 7, 2024
1 parent c3d498a commit 1d969c8
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 122 deletions.
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

0 comments on commit 1d969c8

Please sign in to comment.