Rename ReactForgetBabelPlugin locals

ghstack-source-id: 9cd5fe41ae322632dfeb3d5c7468268678006d94
Pull Request resolved: https://github.com/facebook/react-forget/pull/2929
This commit is contained in:
Joe Savona
2024-05-02 17:14:25 -07:00
parent 95e3cdcfa1
commit 1c8f8bfb89
6 changed files with 10 additions and 10 deletions
@@ -17,7 +17,7 @@ import {
* @param {*} _babel
* @returns
*/
export default function ReactForgetBabelPlugin(
export default function BabelPluginReactCompiler(
_babel: typeof BabelCore
): BabelCore.PluginObj {
return {
@@ -10,7 +10,7 @@ import { transformFromAstSync } from "@babel/core";
import * as BabelParser from "@babel/parser";
import invariant from "invariant";
import type { PluginOptions } from "../Entrypoint";
import ReactForgetBabelPlugin from "./BabelPlugin";
import BabelPluginReactCompiler from "./BabelPlugin";
export const DEFAULT_PLUGINS = ["babel-plugin-fbt", "babel-plugin-fbt-runtime"];
export function runBabelPluginReactCompiler(
@@ -31,7 +31,7 @@ export function runBabelPluginReactCompiler(
highlightCode: false,
retainLines: true,
plugins: [
[ReactForgetBabelPlugin, options],
[BabelPluginReactCompiler, options],
"babel-plugin-fbt",
"babel-plugin-fbt-runtime",
],
@@ -15,7 +15,7 @@ const PanicThresholdOptionsSchema = z.enum([
/*
* Any errors will panic the compiler by throwing an exception, which will
* bubble up to the nearest exception handler above the Forget transform.
* If Forget is invoked through `ReactForgetBabelPlugin`, this will at the least
* If Forget is invoked through `BabelPluginReactCompiler`, this will at the least
* skip Forget compilation for the rest of current file.
*/
"all_errors",
@@ -37,5 +37,5 @@ declare global {
let __DEV__: boolean | null | undefined;
}
import ReactForgetBabelPlugin from "./Babel/BabelPlugin";
export default ReactForgetBabelPlugin;
import BabelPluginReactCompiler from "./Babel/BabelPlugin";
export default BabelPluginReactCompiler;
@@ -9,7 +9,7 @@ import { transformFromAstSync } from "@babel/core";
// @ts-expect-error
import PluginProposalPrivateMethods from "@babel/plugin-proposal-private-methods";
import type { SourceLocation as BabelSourceLocation } from "@babel/types";
import ReactForgetBabelPlugin, {
import BabelPluginReactCompiler, {
CompilerSuggestionOperation,
ErrorSeverity,
parsePluginOptions,
@@ -150,7 +150,7 @@ const rule: Rule.RuleModule = {
retainLines: true,
plugins: [
[PluginProposalPrivateMethods, { loose: true }],
[ReactForgetBabelPlugin, options],
[BabelPluginReactCompiler, options],
],
sourceType: "module",
});
+2 -2
View File
@@ -57,7 +57,7 @@ function compile(
try {
// NOTE: we intentionally require lazily here so that we can clear the require cache
// and load fresh versions of the compiler when `compilerVersion` changes.
const { default: ReactForgetBabelPlugin } = require(COMPILER_PATH) as {
const { default: BabelPluginReactCompiler } = require(COMPILER_PATH) as {
default: PluginObj;
};
const { toggleLogging } = require(LOGGER_PATH);
@@ -72,7 +72,7 @@ function compile(
input,
fixturePath,
parseConfigPragma,
ReactForgetBabelPlugin,
BabelPluginReactCompiler,
includeEvaluator
);