From de1d605253d359ae990787e0deb66ec208739e79 Mon Sep 17 00:00:00 2001 From: Moti Zilberman Date: Wed, 8 May 2024 06:46:15 -0700 Subject: [PATCH] Add Flow to @react-native/polyfills entry point (#44477) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44477 Changelog: [Internal] TSIA Reviewed By: huntie Differential Revision: D57091620 fbshipit-source-id: 54fd105069ba0a34b9ab5bd12295e4e9641492a3 --- packages/metro-config/src/index.flow.js | 1 - packages/polyfills/index.js | 3 ++- packages/react-native/rn-get-polyfills.js | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/metro-config/src/index.flow.js b/packages/metro-config/src/index.flow.js index ee75437090d..2b4c708b4ce 100644 --- a/packages/metro-config/src/index.flow.js +++ b/packages/metro-config/src/index.flow.js @@ -58,7 +58,6 @@ export function getDefaultConfig(projectRoot: string): ConfigT { getModulesRunBeforeMainModule: () => [ require.resolve('react-native/Libraries/Core/InitializeCore'), ], - // $FlowFixMe[untyped-import] getPolyfills: () => require('@react-native/js-polyfills')(), isThirdPartyModule({path: modulePath}: $ReadOnly<{path: string, ...}>) { return ( diff --git a/packages/polyfills/index.js b/packages/polyfills/index.js index 90aa1dc0834..ce52e3cab99 100644 --- a/packages/polyfills/index.js +++ b/packages/polyfills/index.js @@ -4,12 +4,13 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * + * @flow strict-local * @format */ 'use strict'; -module.exports = () => [ +module.exports = () /*: Array */ => [ require.resolve('./console.js'), require.resolve('./error-guard.js'), ]; diff --git a/packages/react-native/rn-get-polyfills.js b/packages/react-native/rn-get-polyfills.js index c051fd42134..bf0d0428de3 100644 --- a/packages/react-native/rn-get-polyfills.js +++ b/packages/react-native/rn-get-polyfills.js @@ -4,6 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * + * @flow strict-local * @format */