Skip to content

Commit

Permalink
Assert enableBridgelessArchitecture is true when starting Bridgeless
Browse files Browse the repository at this point in the history
Summary:
Staring Bridgeless without previously setting ReactNativeFeatureFlags.enableBridgelessArchitecture() is UB, we should assert enableBridgelessArchitecture is true when starting Bridgeless

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D64641081
  • Loading branch information
mdvacca authored and facebook-github-bot committed Oct 21, 2024
1 parent 1aaedc7 commit 9d077a9
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,17 @@ 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.");

Assertions.assertCondition(
ReactNativeFeatureFlags.enableFabricRenderer(),
"enableFabricRenderer 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 9d077a9

Please sign in to comment.