mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
1fc1873c21
Summary: To prepare for the new architecture, introduce the following enforcement: * Defining `RCT_NEW_ARCHITECTURE` in the build flag automatically enables violation reporting * At runtime, call RCTEnableNewArchitectureViolationReporting() to enable/disable reporting - it takes effect with the future violations * When violation reporting is enabled: * RCTWarnNotAllowedForNewArchitecture(): log warning about a violation, but doesn't assert * RCTEnforceNotAllowedForNewArchitecture(): assert when a violation happen Also in this commit: * Add warning when RCTRegisterModule() is called as a side effect of RCT_EXPORT_MODULE(). Many modules still need this, so we can't enforce it yet. * Add enforcement when the bridge is initialize, because the new architecture cannot have the bridge. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D27847359 fbshipit-source-id: a8c4a8151cec3915ec707ce6b78f860af4bb0708