From 07e4974bad015a44c2da488c80a494318007e58d Mon Sep 17 00:00:00 2001 From: "Sebastian \"Sebbie\" Silbermann" Date: Mon, 22 Sep 2025 16:51:57 +0200 Subject: [PATCH] [compiler] Don't leak global `__DEV__` type (#34551) --- compiler/packages/babel-plugin-react-compiler/src/index.ts | 1 + compiler/packages/babel-plugin-react-compiler/tsconfig.json | 1 + 2 files changed, 2 insertions(+) diff --git a/compiler/packages/babel-plugin-react-compiler/src/index.ts b/compiler/packages/babel-plugin-react-compiler/src/index.ts index a8b934160a..c5d8c4cb6e 100644 --- a/compiler/packages/babel-plugin-react-compiler/src/index.ts +++ b/compiler/packages/babel-plugin-react-compiler/src/index.ts @@ -51,6 +51,7 @@ export { } from './ReactiveScopes'; export {parseConfigPragmaForTests} from './Utils/TestUtils'; declare global { + // @internal let __DEV__: boolean | null | undefined; } diff --git a/compiler/packages/babel-plugin-react-compiler/tsconfig.json b/compiler/packages/babel-plugin-react-compiler/tsconfig.json index afca5f9beb..f2f1eb5535 100644 --- a/compiler/packages/babel-plugin-react-compiler/tsconfig.json +++ b/compiler/packages/babel-plugin-react-compiler/tsconfig.json @@ -10,6 +10,7 @@ "importsNotUsedAsValues": "remove", "noUncheckedIndexedAccess": false, "noUnusedParameters": false, + "stripInternal": true, "useUnknownInCatchVariables": true, "target": "ES2015", // ideally turn off only during dev, or on a per-file basis