From 86a28dd02734cf43984d6df4b02b2f026bd41ee9 Mon Sep 17 00:00:00 2001 From: Sebastian Sebbie Silbermann Date: Sun, 21 Sep 2025 13:22:14 +0200 Subject: [PATCH] [compiler] Don't leak global `__DEV__` types --- 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 a8b934160a023..c5d8c4cb6e86e 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 afca5f9beb13c..f2f1eb55351c0 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