Skip to content

Commit 9aee75d

Browse files
javachemeta-codesync[bot]
authored andcommitted
Remove enableEagerMainQueueModulesOnIOS, make eager main-queue setup always-on
Summary: 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. Differential Revision: D105954235
1 parent 2f82f3c commit 9aee75d

22 files changed

Lines changed: 113 additions & 263 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<<8b35aa70eea734a8bfcbb7bd651ba8e2>>
7+
* @generated SignedSource<<23b48657a64e620a108351385cac9f79>>
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<<494ed85c58f80b4feb6fb9b83fe7a27e>>
7+
* @generated SignedSource<<ac5eda3a3d3570fa615c8ed816b1fda5>>
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
@@ -282,15 +281,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
282281
return cached
283282
}
284283

285-
override fun enableEagerMainQueueModulesOnIOS(): Boolean {
286-
var cached = enableEagerMainQueueModulesOnIOSCache
287-
if (cached == null) {
288-
cached = ReactNativeFeatureFlagsCxxInterop.enableEagerMainQueueModulesOnIOS()
289-
enableEagerMainQueueModulesOnIOSCache = cached
290-
}
291-
return cached
292-
}
293-
294284
override fun enableEagerRootViewAttachment(): Boolean {
295285
var cached = enableEagerRootViewAttachmentCache
296286
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<<16ca9a4b47da90ea71300eb37287e28b>>
7+
* @generated SignedSource<<32026408e198a903deb51eeb6157d3c5>>
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<<10e6516b3c9cf53ae2e48c8b8cd51033>>
7+
* @generated SignedSource<<df4e0cc5b2eb2add539071a06eb07d14>>
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<<441fe8be28d4521e1fe9fe7b87b74cf2>>
7+
* @generated SignedSource<<f812eec8119cbd3989dae4f6f43c8ba2>>
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
@@ -305,16 +304,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
305304
return cached
306305
}
307306

308-
override fun enableEagerMainQueueModulesOnIOS(): Boolean {
309-
var cached = enableEagerMainQueueModulesOnIOSCache
310-
if (cached == null) {
311-
cached = currentProvider.enableEagerMainQueueModulesOnIOS()
312-
accessedFeatureFlags.add("enableEagerMainQueueModulesOnIOS")
313-
enableEagerMainQueueModulesOnIOSCache = cached
314-
}
315-
return cached
316-
}
317-
318307
override fun enableEagerRootViewAttachment(): Boolean {
319308
var cached = enableEagerRootViewAttachmentCache
320309
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<<972dbaef144818484bafff334cf97ef2>>
7+
* @generated SignedSource<<f0e6af0192d195fb3fc4deaa1f269372>>
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<<bb79417efb0f63b2717ea8873b72da88>>
7+
* @generated SignedSource<<37167dea60330101b87d35ee9cbd8531>>
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");
@@ -678,11 +672,6 @@ bool JReactNativeFeatureFlagsCxxInterop::enableDoubleMeasurementFixAndroid(
678672
return ReactNativeFeatureFlags::enableDoubleMeasurementFixAndroid();
679673
}
680674

681-
bool JReactNativeFeatureFlagsCxxInterop::enableEagerMainQueueModulesOnIOS(
682-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
683-
return ReactNativeFeatureFlags::enableEagerMainQueueModulesOnIOS();
684-
}
685-
686675
bool JReactNativeFeatureFlagsCxxInterop::enableEagerRootViewAttachment(
687676
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
688677
return ReactNativeFeatureFlags::enableEagerRootViewAttachment();
@@ -1121,9 +1110,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
11211110
makeNativeMethod(
11221111
"enableDoubleMeasurementFixAndroid",
11231112
JReactNativeFeatureFlagsCxxInterop::enableDoubleMeasurementFixAndroid),
1124-
makeNativeMethod(
1125-
"enableEagerMainQueueModulesOnIOS",
1126-
JReactNativeFeatureFlagsCxxInterop::enableEagerMainQueueModulesOnIOS),
11271113
makeNativeMethod(
11281114
"enableEagerRootViewAttachment",
11291115
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<<3007628255a078dafc01eb16b3d55fbe>>
7+
* @generated SignedSource<<cdd840b4cd4fdf22a4db023f464b981f>>
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<<5c308b51617953c21d3ae60dc8c530bb>>
7+
* @generated SignedSource<<30c0afbb7c40ba8953e5ffb692224a34>>
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<<ac9244d8e244e6ee81a39b6c6d3fbf5e>>
7+
* @generated SignedSource<<b41796213163e3bae4f7e7ad75204d13>>
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)