@samitouri / QOS-React / commits / 95e3cdcfa1

Rename {r,R}unReactForgetBabelPlugin

ghstack-source-id: e7f00aab61dd749dc6ba11ce7e4d14603bfeeab9 Pull Request resolved: https://github.com/facebook/react-forget/pull/2928

Joe Savona committed May 2, 2024 at 17:14 UTC 95e3cdcfa19941d8b28ef8ac955f94338689dea3
6 files changed +20 -22
compiler/apps/playground/next-env.d.ts
-7
@@ -1,10 +1,3 @@
1 -/**
2 - * Copyright (c) Meta Platforms, Inc. and affiliates.
3 - *
4 - * This source code is licensed under the MIT license found in the
5 - * LICENSE file in the root directory of this source tree.
6 - */
7 -
1 /// <reference types="next" />
2 /// <reference types="next/image-types/global" />
3
compiler/packages/babel-plugin-react-compiler/scripts/build-react-hooks-fixures.js
+13 -8
@@ -9,8 +9,8 @@
9
10 const { tests } = require("./eslint-plugin-react-hooks-test-cases");
11 const {
12 - runReactForgetBabelPlugin,
13 -} = require("../dist/Babel/RunReactForgetBabelPlugin");
12 + runBabelPluginReactCompiler,
13 +} = require("../dist/Babel/RunReactCompilerBabelPlugin");
14 const fs = require("fs");
15 const path = require("path");
16 const prettier = require("prettier");
@@ -45,14 +45,19 @@ for (const fixture of fixtures) {
45 let passes = true;
46 try {
47 // Does the fixture pass with hooks validation disabled? if not skip it
48 - runReactForgetBabelPlugin(fixture.code, "rules-of-hooks.js", "typescript", {
49 - environment: {
50 - validateHooksUsage: false,
51 - },
52 - });
48 + runBabelPluginReactCompiler(
49 + fixture.code,
50 + "rules-of-hooks.js",
51 + "typescript",
52 + {
53 + environment: {
54 + validateHooksUsage: false,
55 + },
56 + }
57 + );
58 // Does the fixture pass with hooks validation enabled?
59 try {
55 - runReactForgetBabelPlugin(
60 + runBabelPluginReactCompiler(
61 fixture.code,
62 "rules-of-hooks.js",
63 "typescript",
compiler/packages/babel-plugin-react-compiler/src/Babel/RunReactCompilerBabelPlugin.ts renamed
+1 -1
@@ -13,7 +13,7 @@ import type { PluginOptions } from "../Entrypoint";
13 import ReactForgetBabelPlugin from "./BabelPlugin";
14
15 export const DEFAULT_PLUGINS = ["babel-plugin-fbt", "babel-plugin-fbt-runtime"];
16 -export function runReactForgetBabelPlugin(
16 +export function runBabelPluginReactCompiler(
17 text: string,
18 file: string,
19 language: "flow" | "typescript",
compiler/packages/babel-plugin-react-compiler/src/__tests__/Logger-test.ts
+3 -3
@@ -7,7 +7,7 @@
7
8 import * as t from "@babel/types";
9 import invariant from "invariant";
10 -import { runReactForgetBabelPlugin } from "../Babel/RunReactForgetBabelPlugin";
10 +import { runBabelPluginReactCompiler } from "../Babel/RunReactCompilerBabelPlugin";
11 import type { Logger, LoggerEvent } from "../Entrypoint";
12
13 it("logs succesful compilation", () => {
@@ -18,7 +18,7 @@ it("logs succesful compilation", () => {
18 },
19 };
20
21 - const _ = runReactForgetBabelPlugin(
21 + const _ = runBabelPluginReactCompiler(
22 "function Component(props) { return <div>{props}</div> }",
23 "test.js",
24 "flow",
@@ -43,7 +43,7 @@ it("logs failed compilation", () => {
43 };
44
45 expect(() => {
46 - runReactForgetBabelPlugin(
46 + runBabelPluginReactCompiler(
47 "function Component(props) { props.foo = 1; return <div>{props}</div> }",
48 "test.js",
49 "flow",
compiler/packages/babel-plugin-react-compiler/src/index.ts
+1 -1
@@ -5,7 +5,7 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -export { runReactForgetBabelPlugin } from "./Babel/RunReactForgetBabelPlugin";
8 +export { runBabelPluginReactCompiler } from "./Babel/RunReactCompilerBabelPlugin";
9 export {
10 CompilerError,
11 CompilerErrorDetail,
compiler/packages/healthcheck/src/checks/reactCompiler.ts
+2 -2
@@ -7,7 +7,7 @@
7
8 import {
9 ErrorSeverity,
10 - runReactForgetBabelPlugin,
10 + runBabelPluginReactCompiler,
11 type CompilerErrorDetailOptions,
12 type PluginOptions,
13 } from "babel-plugin-react-compiler/src";
@@ -65,7 +65,7 @@ function isActionableDiagnostic(detail: CompilerErrorDetailOptions) {
65
66 function compile(sourceCode: string, filename: string) {
67 try {
68 - runReactForgetBabelPlugin(
68 + runBabelPluginReactCompiler(
69 sourceCode,
70 filename,
71 "typescript",