diff --git a/compiler/apps/playground/next-env.d.ts b/compiler/apps/playground/next-env.d.ts index 811cbc51ad..4f11a03dc6 100644 --- a/compiler/apps/playground/next-env.d.ts +++ b/compiler/apps/playground/next-env.d.ts @@ -1,10 +1,3 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - /// /// diff --git a/compiler/packages/babel-plugin-react-compiler/scripts/build-react-hooks-fixures.js b/compiler/packages/babel-plugin-react-compiler/scripts/build-react-hooks-fixures.js index 6e2a367bec..84861aca51 100644 --- a/compiler/packages/babel-plugin-react-compiler/scripts/build-react-hooks-fixures.js +++ b/compiler/packages/babel-plugin-react-compiler/scripts/build-react-hooks-fixures.js @@ -9,8 +9,8 @@ const { tests } = require("./eslint-plugin-react-hooks-test-cases"); const { - runReactForgetBabelPlugin, -} = require("../dist/Babel/RunReactForgetBabelPlugin"); + runBabelPluginReactCompiler, +} = require("../dist/Babel/RunReactCompilerBabelPlugin"); const fs = require("fs"); const path = require("path"); const prettier = require("prettier"); @@ -45,14 +45,19 @@ for (const fixture of fixtures) { let passes = true; try { // Does the fixture pass with hooks validation disabled? if not skip it - runReactForgetBabelPlugin(fixture.code, "rules-of-hooks.js", "typescript", { - environment: { - validateHooksUsage: false, - }, - }); + runBabelPluginReactCompiler( + fixture.code, + "rules-of-hooks.js", + "typescript", + { + environment: { + validateHooksUsage: false, + }, + } + ); // Does the fixture pass with hooks validation enabled? try { - runReactForgetBabelPlugin( + runBabelPluginReactCompiler( fixture.code, "rules-of-hooks.js", "typescript", diff --git a/compiler/packages/babel-plugin-react-compiler/src/Babel/RunReactForgetBabelPlugin.ts b/compiler/packages/babel-plugin-react-compiler/src/Babel/RunReactCompilerBabelPlugin.ts similarity index 96% rename from compiler/packages/babel-plugin-react-compiler/src/Babel/RunReactForgetBabelPlugin.ts rename to compiler/packages/babel-plugin-react-compiler/src/Babel/RunReactCompilerBabelPlugin.ts index 0541c9ceba..3523742dd4 100644 --- a/compiler/packages/babel-plugin-react-compiler/src/Babel/RunReactForgetBabelPlugin.ts +++ b/compiler/packages/babel-plugin-react-compiler/src/Babel/RunReactCompilerBabelPlugin.ts @@ -13,7 +13,7 @@ import type { PluginOptions } from "../Entrypoint"; import ReactForgetBabelPlugin from "./BabelPlugin"; export const DEFAULT_PLUGINS = ["babel-plugin-fbt", "babel-plugin-fbt-runtime"]; -export function runReactForgetBabelPlugin( +export function runBabelPluginReactCompiler( text: string, file: string, language: "flow" | "typescript", diff --git a/compiler/packages/babel-plugin-react-compiler/src/__tests__/Logger-test.ts b/compiler/packages/babel-plugin-react-compiler/src/__tests__/Logger-test.ts index 36d6198682..c3c4c89663 100644 --- a/compiler/packages/babel-plugin-react-compiler/src/__tests__/Logger-test.ts +++ b/compiler/packages/babel-plugin-react-compiler/src/__tests__/Logger-test.ts @@ -7,7 +7,7 @@ import * as t from "@babel/types"; import invariant from "invariant"; -import { runReactForgetBabelPlugin } from "../Babel/RunReactForgetBabelPlugin"; +import { runBabelPluginReactCompiler } from "../Babel/RunReactCompilerBabelPlugin"; import type { Logger, LoggerEvent } from "../Entrypoint"; it("logs succesful compilation", () => { @@ -18,7 +18,7 @@ it("logs succesful compilation", () => { }, }; - const _ = runReactForgetBabelPlugin( + const _ = runBabelPluginReactCompiler( "function Component(props) { return
{props}
}", "test.js", "flow", @@ -43,7 +43,7 @@ it("logs failed compilation", () => { }; expect(() => { - runReactForgetBabelPlugin( + runBabelPluginReactCompiler( "function Component(props) { props.foo = 1; return
{props}
}", "test.js", "flow", diff --git a/compiler/packages/babel-plugin-react-compiler/src/index.ts b/compiler/packages/babel-plugin-react-compiler/src/index.ts index e0d77fc5bf..5782c7da61 100644 --- a/compiler/packages/babel-plugin-react-compiler/src/index.ts +++ b/compiler/packages/babel-plugin-react-compiler/src/index.ts @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -export { runReactForgetBabelPlugin } from "./Babel/RunReactForgetBabelPlugin"; +export { runBabelPluginReactCompiler } from "./Babel/RunReactCompilerBabelPlugin"; export { CompilerError, CompilerErrorDetail, diff --git a/compiler/packages/healthcheck/src/checks/reactCompiler.ts b/compiler/packages/healthcheck/src/checks/reactCompiler.ts index a9ef91791e..0db4ce0b59 100644 --- a/compiler/packages/healthcheck/src/checks/reactCompiler.ts +++ b/compiler/packages/healthcheck/src/checks/reactCompiler.ts @@ -7,7 +7,7 @@ import { ErrorSeverity, - runReactForgetBabelPlugin, + runBabelPluginReactCompiler, type CompilerErrorDetailOptions, type PluginOptions, } from "babel-plugin-react-compiler/src"; @@ -65,7 +65,7 @@ function isActionableDiagnostic(detail: CompilerErrorDetailOptions) { function compile(sourceCode: string, filename: string) { try { - runReactForgetBabelPlugin( + runBabelPluginReactCompiler( sourceCode, filename, "typescript",