Remove index.js.flow shim from Node packages (#49461)

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
This commit is contained in:
Alex Hunt
2025-02-17 05:44:22 -08:00
committed by Facebook GitHub Bot
parent d41f56176c
commit f940be1caa
4 changed files with 0 additions and 38 deletions
@@ -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';
-12
View File
@@ -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';
@@ -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';
-2
View File
@@ -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