Re-apply: [RN] Make runtime initialization from React renderers a no-op

Summary: Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D31760907

fbshipit-source-id: ba145a30ead52abeb8affca84c3dec21dfefe30c
This commit is contained in:
Rubén Norte
2021-10-20 04:06:20 -07:00
committed by Facebook GitHub Bot
parent 3dc5dc11f6
commit 1486b31b2b
@@ -8,4 +8,13 @@
* @flow strict-local
*/
import '../Core/InitializeCore';
// TODO: Remove this module when the import is removed from the React renderers.
// This module is used by React to initialize the React Native runtime,
// but it is now a no-op.
// This is redundant because all React Native apps are already executing
// `InitializeCore` before the entrypoint of the JS bundle
// (see https://github.com/react-native-community/cli/blob/e1da64317a1178c2b262d82c2f14210cdfa3ebe1/packages/cli-plugin-metro/src/tools/loadMetroConfig.ts#L93)
// and importing it unconditionally from React only prevents users from
// customizing what they want to include in their apps (re: app size).