From a1fa7017f45cf1495588f363340f207a207326c6 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Thu, 18 Jun 2026 07:58:10 -0700 Subject: [PATCH] Delete interface.js (Flow), relocate __DEV__ global (#57275) Summary: `interface.js` was a legacy, Flow-only entry point whose sole content was a bare `declare var __DEV__: boolean;` global, registered as a Flow `[libs]` file. Relocate into `flow/globals.js`, allowing us to drop this from the package `"files"` (and `"exports"`) list. Changelog: [Internal] Differential Revision: D109018822 --- .flowconfig | 1 - packages/react-native/flow/global.js | 6 ++++++ packages/react-native/interface.js | 21 --------------------- packages/react-native/package.json | 1 - 4 files changed, 6 insertions(+), 23 deletions(-) delete mode 100644 packages/react-native/interface.js diff --git a/.flowconfig b/.flowconfig index 3a23617f8124..58ca3c06ee61 100644 --- a/.flowconfig +++ b/.flowconfig @@ -39,7 +39,6 @@ [libs] flow-typed/ -packages/react-native/interface.js packages/react-native/flow/ [options] diff --git a/packages/react-native/flow/global.js b/packages/react-native/flow/global.js index dc6de666ec02..3082f3fc48c1 100644 --- a/packages/react-native/flow/global.js +++ b/packages/react-native/flow/global.js @@ -86,3 +86,9 @@ declare var global: { // Undeclared properties are implicitly `any`. [string | symbol]: any, }; + +// Declared as a bare global so unqualified `__DEV__` references type-check as +// `boolean`. The suppression is a no-op in this checkout but avoids a duplicate +// declaration where `__DEV__` is also declared by another Flow libdef. +// $FlowFixMe[libdef-override] +declare var __DEV__: boolean; diff --git a/packages/react-native/interface.js b/packages/react-native/interface.js deleted file mode 100644 index b17169a6b153..000000000000 --- a/packages/react-native/interface.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * 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. - * - * @flow strict - * @format - */ - -'use strict'; - -// NOTE: Hmm... I don't think declaring variables within this module actually -// accomplishes anything besides documenting that these globals are expected to -// exist. So I think the correct "fix" to this lint warning is to delete this -// entire file. But in lieu of doing that... no harm for now in keeping this -// file around, even if it is only for documentation purposes. ¯\_(ツ)_/¯ - -/* eslint-disable no-unused-vars */ - -declare var __DEV__: boolean; diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 6ea146756613..01ad9377f2c3 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -80,7 +80,6 @@ "gradle/libs.versions.toml", "index.js", "index.js.flow", - "interface.js", "jest-preset.js", "Libraries", "LICENSE",