Skip to content

Commit 36bec56

Browse files
javachemeta-codesync[bot]
authored andcommitted
Remove enableEagerMainQueueModulesOnIOS, make eager main-queue setup always-on (#56933)
Summary: Pull Request resolved: #56933 The `enableEagerMainQueueModulesOnIOS` runtime gate has finished rollout and is no longer needed. Drop the flag from the feature-flag config, regenerate the per-language accessors, and inline the previously-gated body in `RCTInstance._start` so the eager main-queue module setup always runs. Also drops the now-dead override and trims the test that exercised the flag-off branch. After this change, when `RCTInstance` starts up, it always consults `RCTInstanceDelegate.unstableModulesRequiringMainQueueSetup`, initializes the returned modules on the main queue, and blocks the JS thread on that completion before evaluating the bundle. Changelog: [iOS][Changed] - Native modules listed in `unstableModulesRequiringMainQueueSetup` are now always initialized eagerly on the main queue during React Native init; the previous `enableEagerMainQueueModulesOnIOS` opt-in flag has been removed. Reviewed By: sammy-SC Differential Revision: D105954235 fbshipit-source-id: a662d43e606f215647fb86a87a62fe123c003360
1 parent c5afd1a commit 36bec56

22 files changed

Lines changed: 112 additions & 262 deletions

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<fb433838ff712ffa7b045065a35723f2>>
7+
* @generated SignedSource<<3e8cc4e23730f3171824faaf2053bbd9>>
88
*/
99

1010
/**
@@ -144,12 +144,6 @@ public object ReactNativeFeatureFlags {
144144
@JvmStatic
145145
public fun enableDoubleMeasurementFixAndroid(): Boolean = accessor.enableDoubleMeasurementFixAndroid()
146146

147-
/**
148-
* This infra allows native modules to initialize on the main thread, during React Native init.
149-
*/
150-
@JvmStatic
151-
public fun enableEagerMainQueueModulesOnIOS(): Boolean = accessor.enableEagerMainQueueModulesOnIOS()
152-
153147
/**
154148
* Feature flag to configure eager attachment of the root view/initialisation of the JS code.
155149
*/

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<1ac9ff65ae410a6b1afa6c92c2e9a86b>>
7+
* @generated SignedSource<<1b877147588a851daaee1a2b4494312a>>
88
*/
99

1010
/**
@@ -39,7 +39,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
3939
private var enableDestroyShadowTreeRevisionAsyncCache: Boolean? = null
4040
private var enableDifferentiatorMutationVectorPreallocationCache: Boolean? = null
4141
private var enableDoubleMeasurementFixAndroidCache: Boolean? = null
42-
private var enableEagerMainQueueModulesOnIOSCache: Boolean? = null
4342
private var enableEagerRootViewAttachmentCache: Boolean? = null
4443
private var enableExclusivePropsUpdateAndroidCache: Boolean? = null
4544
private var enableFabricCommitBranchingCache: Boolean? = null
@@ -281,15 +280,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
281280
return cached
282281
}
283282

284-
override fun enableEagerMainQueueModulesOnIOS(): Boolean {
285-
var cached = enableEagerMainQueueModulesOnIOSCache
286-
if (cached == null) {
287-
cached = ReactNativeFeatureFlagsCxxInterop.enableEagerMainQueueModulesOnIOS()
288-
enableEagerMainQueueModulesOnIOSCache = cached
289-
}
290-
return cached
291-
}
292-
293283
override fun enableEagerRootViewAttachment(): Boolean {
294284
var cached = enableEagerRootViewAttachmentCache
295285
if (cached == null) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<b63f95bdb6536ae1623bb4a69f2c4940>>
7+
* @generated SignedSource<<a09de0b0d4b342796ff3fcc1b52fc53a>>
88
*/
99

1010
/**
@@ -66,8 +66,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
6666

6767
@DoNotStrip @JvmStatic public external fun enableDoubleMeasurementFixAndroid(): Boolean
6868

69-
@DoNotStrip @JvmStatic public external fun enableEagerMainQueueModulesOnIOS(): Boolean
70-
7169
@DoNotStrip @JvmStatic public external fun enableEagerRootViewAttachment(): Boolean
7270

7371
@DoNotStrip @JvmStatic public external fun enableExclusivePropsUpdateAndroid(): Boolean

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<960de240ad648acc1dca10a80e2bf8a5>>
7+
* @generated SignedSource<<b08dd880f47d31353cd29e4bcc63090d>>
88
*/
99

1010
/**
@@ -61,8 +61,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
6161

6262
override fun enableDoubleMeasurementFixAndroid(): Boolean = false
6363

64-
override fun enableEagerMainQueueModulesOnIOS(): Boolean = false
65-
6664
override fun enableEagerRootViewAttachment(): Boolean = false
6765

6866
override fun enableExclusivePropsUpdateAndroid(): Boolean = false

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<39d4538c638e38cbd1655064edc74761>>
7+
* @generated SignedSource<<c3cb6a890e22fe2ac279c3a9aa65b096>>
88
*/
99

1010
/**
@@ -43,7 +43,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
4343
private var enableDestroyShadowTreeRevisionAsyncCache: Boolean? = null
4444
private var enableDifferentiatorMutationVectorPreallocationCache: Boolean? = null
4545
private var enableDoubleMeasurementFixAndroidCache: Boolean? = null
46-
private var enableEagerMainQueueModulesOnIOSCache: Boolean? = null
4746
private var enableEagerRootViewAttachmentCache: Boolean? = null
4847
private var enableExclusivePropsUpdateAndroidCache: Boolean? = null
4948
private var enableFabricCommitBranchingCache: Boolean? = null
@@ -304,16 +303,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
304303
return cached
305304
}
306305

307-
override fun enableEagerMainQueueModulesOnIOS(): Boolean {
308-
var cached = enableEagerMainQueueModulesOnIOSCache
309-
if (cached == null) {
310-
cached = currentProvider.enableEagerMainQueueModulesOnIOS()
311-
accessedFeatureFlags.add("enableEagerMainQueueModulesOnIOS")
312-
enableEagerMainQueueModulesOnIOSCache = cached
313-
}
314-
return cached
315-
}
316-
317306
override fun enableEagerRootViewAttachment(): Boolean {
318307
var cached = enableEagerRootViewAttachmentCache
319308
if (cached == null) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<4fa46d585a2fe3515557bf06f0e1189f>>
7+
* @generated SignedSource<<1348346948cf4212dd312c48b5bfe917>>
88
*/
99

1010
/**
@@ -61,8 +61,6 @@ public interface ReactNativeFeatureFlagsProvider {
6161

6262
@DoNotStrip public fun enableDoubleMeasurementFixAndroid(): Boolean
6363

64-
@DoNotStrip public fun enableEagerMainQueueModulesOnIOS(): Boolean
65-
6664
@DoNotStrip public fun enableEagerRootViewAttachment(): Boolean
6765

6866
@DoNotStrip public fun enableExclusivePropsUpdateAndroid(): Boolean

packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<e289807a5e54422b373acc929ce31e10>>
7+
* @generated SignedSource<<ed750080bd0e891a1a11887afb7d7c01>>
88
*/
99

1010
/**
@@ -153,12 +153,6 @@ class ReactNativeFeatureFlagsJavaProvider
153153
return method(javaProvider_);
154154
}
155155

156-
bool enableEagerMainQueueModulesOnIOS() override {
157-
static const auto method =
158-
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableEagerMainQueueModulesOnIOS");
159-
return method(javaProvider_);
160-
}
161-
162156
bool enableEagerRootViewAttachment() override {
163157
static const auto method =
164158
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableEagerRootViewAttachment");
@@ -672,11 +666,6 @@ bool JReactNativeFeatureFlagsCxxInterop::enableDoubleMeasurementFixAndroid(
672666
return ReactNativeFeatureFlags::enableDoubleMeasurementFixAndroid();
673667
}
674668

675-
bool JReactNativeFeatureFlagsCxxInterop::enableEagerMainQueueModulesOnIOS(
676-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
677-
return ReactNativeFeatureFlags::enableEagerMainQueueModulesOnIOS();
678-
}
679-
680669
bool JReactNativeFeatureFlagsCxxInterop::enableEagerRootViewAttachment(
681670
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
682671
return ReactNativeFeatureFlags::enableEagerRootViewAttachment();
@@ -1110,9 +1099,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
11101099
makeNativeMethod(
11111100
"enableDoubleMeasurementFixAndroid",
11121101
JReactNativeFeatureFlagsCxxInterop::enableDoubleMeasurementFixAndroid),
1113-
makeNativeMethod(
1114-
"enableEagerMainQueueModulesOnIOS",
1115-
JReactNativeFeatureFlagsCxxInterop::enableEagerMainQueueModulesOnIOS),
11161102
makeNativeMethod(
11171103
"enableEagerRootViewAttachment",
11181104
JReactNativeFeatureFlagsCxxInterop::enableEagerRootViewAttachment),

packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<8e51c38f988854dd63291df26a78326e>>
7+
* @generated SignedSource<<21e508305ffc719768389f668485e57f>>
88
*/
99

1010
/**
@@ -87,9 +87,6 @@ class JReactNativeFeatureFlagsCxxInterop
8787
static bool enableDoubleMeasurementFixAndroid(
8888
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
8989

90-
static bool enableEagerMainQueueModulesOnIOS(
91-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
92-
9390
static bool enableEagerRootViewAttachment(
9491
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
9592

packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<a6fff34229abbd9beaa08bf39b379610>>
7+
* @generated SignedSource<<a65763987ba462f3c46cd84dc8d75713>>
88
*/
99

1010
/**
@@ -102,10 +102,6 @@ bool ReactNativeFeatureFlags::enableDoubleMeasurementFixAndroid() {
102102
return getAccessor().enableDoubleMeasurementFixAndroid();
103103
}
104104

105-
bool ReactNativeFeatureFlags::enableEagerMainQueueModulesOnIOS() {
106-
return getAccessor().enableEagerMainQueueModulesOnIOS();
107-
}
108-
109105
bool ReactNativeFeatureFlags::enableEagerRootViewAttachment() {
110106
return getAccessor().enableEagerRootViewAttachment();
111107
}

packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<6508c960d2b27f479ecb40056d5c7997>>
7+
* @generated SignedSource<<e068e0576073bda38f2f86f80306ee93>>
88
*/
99

1010
/**
@@ -134,11 +134,6 @@ class ReactNativeFeatureFlags {
134134
*/
135135
RN_EXPORT static bool enableDoubleMeasurementFixAndroid();
136136

137-
/**
138-
* This infra allows native modules to initialize on the main thread, during React Native init.
139-
*/
140-
RN_EXPORT static bool enableEagerMainQueueModulesOnIOS();
141-
142137
/**
143138
* Feature flag to configure eager attachment of the root view/initialisation of the JS code.
144139
*/

0 commit comments

Comments
 (0)