From f940be1caa51f4d4e0d482ea3ffdd6983244fde7 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Mon, 17 Feb 2025 05:44:22 -0800 Subject: [PATCH] Remove index.js.flow shim from Node packages (#49461) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49461 Flow now supports Package Exports 🎉. This means we can delete the compatiblity pattern in each of our build-enabled Node.js packages. This simplifies the internal package structure needed to support Flow while developing from source in the monorepo — no prod impact. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D69741143 fbshipit-source-id: 070715cb6beb00eb393186dbf95856ceb87fabef --- packages/community-cli-plugin/index.js.flow | 12 ------------ packages/dev-middleware/index.js.flow | 12 ------------ .../react-native-compatibility-check/index.js.flow | 12 ------------ scripts/build/README.md | 2 -- 4 files changed, 38 deletions(-) delete mode 100644 packages/community-cli-plugin/index.js.flow delete mode 100644 packages/dev-middleware/index.js.flow delete mode 100644 packages/react-native-compatibility-check/index.js.flow diff --git a/packages/community-cli-plugin/index.js.flow b/packages/community-cli-plugin/index.js.flow deleted file mode 100644 index 17ae7ce0503..00000000000 --- a/packages/community-cli-plugin/index.js.flow +++ /dev/null @@ -1,12 +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 - * @format - * @oncall react_native - */ - -export * from './src'; diff --git a/packages/dev-middleware/index.js.flow b/packages/dev-middleware/index.js.flow deleted file mode 100644 index 17ae7ce0503..00000000000 --- a/packages/dev-middleware/index.js.flow +++ /dev/null @@ -1,12 +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 - * @format - * @oncall react_native - */ - -export * from './src'; diff --git a/packages/react-native-compatibility-check/index.js.flow b/packages/react-native-compatibility-check/index.js.flow deleted file mode 100644 index 17ae7ce0503..00000000000 --- a/packages/react-native-compatibility-check/index.js.flow +++ /dev/null @@ -1,12 +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 - * @format - * @oncall react_native - */ - -export * from './src'; diff --git a/scripts/build/README.md b/scripts/build/README.md index fffc6cb9210..03938167d61 100644 --- a/scripts/build/README.md +++ b/scripts/build/README.md @@ -72,13 +72,11 @@ packages/ index.js # Entry point wrapper file (calls babel-register.js) (compiled away) index.flow.js # Entry point implementation in Flow [other files] - index.js.flow # Shim for the Flow typechecker package.json # Includes "exports" field, ideally only src/index.js ``` Notes: -- The additional root `index.js.flow` shim is needed due to Flow itself not supporting Package Exports. - To minimize complexity, prefer only a single entry of `{".": "src/index.js"}` in `"exports"` for new packages. ## Build behavior