Skip to content

Commit

Permalink
Assert FeatureFlags in Bridgeless initialization only on Debug mode (f…
Browse files Browse the repository at this point in the history
…acebook#47263)

Summary:
Pull Request resolved: facebook#47263

Assert FeatureFlags in Bridgeless initialization only on Debug mode

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D65078365

fbshipit-source-id: 79a40ba84e140b9784660ac9d1c14fd0f7426653
  • Loading branch information
mdvacca authored and facebook-github-bot committed Oct 28, 2024
1 parent 92d743a commit 0705eb8
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -923,17 +923,19 @@ private Task<Void> getOrCreateStartTask() {
final String method = "getOrCreateStartTask()";
if (mStartTask == null) {
log(method, "Schedule");
Assertions.assertCondition(
ReactNativeFeatureFlags.enableBridgelessArchitecture(),
"enableBridgelessArchitecture FeatureFlag must be set to start ReactNative.");
if (ReactBuildConfig.DEBUG) {
Assertions.assertCondition(
ReactNativeFeatureFlags.enableBridgelessArchitecture(),
"enableBridgelessArchitecture FeatureFlag must be set to start ReactNative.");

Assertions.assertCondition(
ReactNativeFeatureFlags.enableFabricRenderer(),
"enableFabricRenderer FeatureFlag must be set to start ReactNative.");
Assertions.assertCondition(
ReactNativeFeatureFlags.enableFabricRenderer(),
"enableFabricRenderer FeatureFlag must be set to start ReactNative.");

Assertions.assertCondition(
ReactNativeFeatureFlags.useTurboModules(),
"useTurboModules FeatureFlag must be set to start ReactNative.");
Assertions.assertCondition(
ReactNativeFeatureFlags.useTurboModules(),
"useTurboModules FeatureFlag must be set to start ReactNative.");
}
mStartTask =
waitThenCallGetOrCreateReactInstanceTask()
.continueWithTask(
Expand Down

0 comments on commit 0705eb8

Please sign in to comment.