Do eager native module init on mqt_native thread (#45324)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45324

Improve concurrency during startup of bridgeless by concurrently initializing eager native modules and triggering bundle load.

Changelog: [Android][Changed] Modules marked with needsEagerInit = true will now be created on the mqt_native thread.

Reviewed By: mdvacca

Differential Revision: D59465977

fbshipit-source-id: 55cc0f0359bafcf32dc538f4346c6a5d5546f658
This commit is contained in:
Pieter De Baets
2024-07-11 07:47:10 -07:00
committed by Facebook GitHub Bot
parent 2ea9c360dc
commit c4a6bbc8fd
21 changed files with 151 additions and 39 deletions
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<61e7f1b2647d1e9c9583079b5e7fb166>>
* @generated SignedSource<<efcfd22319cacb3060f6e86601faa912>>
*/
/**
@@ -142,6 +142,12 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun fuseboxEnabledRelease(): Boolean = accessor.fuseboxEnabledRelease()
/**
* Construct modules that requires eager init on the dedicate native modules thread
*/
@JvmStatic
public fun initEagerTurboModulesOnNativeModulesQueueAndroid(): Boolean = accessor.initEagerTurboModulesOnNativeModulesQueueAndroid()
/**
* Only enqueue Choreographer calls if there is an ongoing animation, instead of enqueueing every frame.
*/
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<d43732e02660cb00e0f0acfc2b8ca29f>>
* @generated SignedSource<<d656596790eb80bd7533f514e14180c8>>
*/
/**
@@ -39,6 +39,7 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
private var forceBatchingMountItemsOnAndroidCache: Boolean? = null
private var fuseboxEnabledDebugCache: Boolean? = null
private var fuseboxEnabledReleaseCache: Boolean? = null
private var initEagerTurboModulesOnNativeModulesQueueAndroidCache: Boolean? = null
private var lazyAnimationCallbacksCache: Boolean? = null
private var setAndroidLayoutDirectionCache: Boolean? = null
private var useImmediateExecutorInAndroidBridgelessCache: Boolean? = null
@@ -220,6 +221,15 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
return cached
}
override fun initEagerTurboModulesOnNativeModulesQueueAndroid(): Boolean {
var cached = initEagerTurboModulesOnNativeModulesQueueAndroidCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.initEagerTurboModulesOnNativeModulesQueueAndroid()
initEagerTurboModulesOnNativeModulesQueueAndroidCache = cached
}
return cached
}
override fun lazyAnimationCallbacks(): Boolean {
var cached = lazyAnimationCallbacksCache
if (cached == null) {
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<97e3090e29645738028f11945d4b759e>>
* @generated SignedSource<<956a18f139bec734e985a48bf3265775>>
*/
/**
@@ -66,6 +66,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
@DoNotStrip @JvmStatic public external fun fuseboxEnabledRelease(): Boolean
@DoNotStrip @JvmStatic public external fun initEagerTurboModulesOnNativeModulesQueueAndroid(): Boolean
@DoNotStrip @JvmStatic public external fun lazyAnimationCallbacks(): Boolean
@DoNotStrip @JvmStatic public external fun setAndroidLayoutDirection(): Boolean
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<556729c01ca69ca38b51b96e6b559667>>
* @generated SignedSource<<54256999bd721723c1e7a95669311490>>
*/
/**
@@ -61,6 +61,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
override fun fuseboxEnabledRelease(): Boolean = false
override fun initEagerTurboModulesOnNativeModulesQueueAndroid(): Boolean = false
override fun lazyAnimationCallbacks(): Boolean = false
override fun setAndroidLayoutDirection(): Boolean = true
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<0a5ce89c1476d6693eaf18adc020ebf4>>
* @generated SignedSource<<97de4303f4682dff2e159390db982010>>
*/
/**
@@ -43,6 +43,7 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
private var forceBatchingMountItemsOnAndroidCache: Boolean? = null
private var fuseboxEnabledDebugCache: Boolean? = null
private var fuseboxEnabledReleaseCache: Boolean? = null
private var initEagerTurboModulesOnNativeModulesQueueAndroidCache: Boolean? = null
private var lazyAnimationCallbacksCache: Boolean? = null
private var setAndroidLayoutDirectionCache: Boolean? = null
private var useImmediateExecutorInAndroidBridgelessCache: Boolean? = null
@@ -243,6 +244,16 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
return cached
}
override fun initEagerTurboModulesOnNativeModulesQueueAndroid(): Boolean {
var cached = initEagerTurboModulesOnNativeModulesQueueAndroidCache
if (cached == null) {
cached = currentProvider.initEagerTurboModulesOnNativeModulesQueueAndroid()
accessedFeatureFlags.add("initEagerTurboModulesOnNativeModulesQueueAndroid")
initEagerTurboModulesOnNativeModulesQueueAndroidCache = cached
}
return cached
}
override fun lazyAnimationCallbacks(): Boolean {
var cached = lazyAnimationCallbacksCache
if (cached == null) {
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<16ba68de9b22ddc66208f9ef60f017d9>>
* @generated SignedSource<<60d71718bb4be3be613ffa20ea953324>>
*/
/**
@@ -61,6 +61,8 @@ public interface ReactNativeFeatureFlagsProvider {
@DoNotStrip public fun fuseboxEnabledRelease(): Boolean
@DoNotStrip public fun initEagerTurboModulesOnNativeModulesQueueAndroid(): Boolean
@DoNotStrip public fun lazyAnimationCallbacks(): Boolean
@DoNotStrip public fun setAndroidLayoutDirection(): Boolean
@@ -1090,14 +1090,15 @@ public class ReactHostImpl implements ReactHost {
getOrCreateReactHostInspectorTarget());
mReactInstance = instance;
// eagerly initailize turbo modules
instance.initializeEagerTurboModules();
MemoryPressureListener memoryPressureListener =
createMemoryPressureListener(instance);
mMemoryPressureListener = memoryPressureListener;
mMemoryPressureRouter.addMemoryPressureListener(memoryPressureListener);
// Eagerly initialize turbo modules in parallel with JS bundle execution
// as TurboModuleManager will handle any concurrent access
instance.initializeEagerTurboModules();
log(method, "Loading JS Bundle");
instance.loadJSBundle(bundleLoader);
@@ -289,12 +289,21 @@ final class ReactInstance {
}
void initializeEagerTurboModules() {
Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "initializeEagerTurboModules");
// Eagerly initialize TurboModules
for (String moduleName : mTurboModuleManager.getEagerInitModuleNames()) {
mTurboModuleManager.getModule(moduleName);
Runnable task =
() -> {
Systrace.beginSection(
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "initializeEagerTurboModules");
// Eagerly initialize TurboModules
for (String moduleName : mTurboModuleManager.getEagerInitModuleNames()) {
mTurboModuleManager.getModule(moduleName);
}
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
};
if (ReactNativeFeatureFlags.initEagerTurboModulesOnNativeModulesQueueAndroid()) {
mQueueConfiguration.getNativeModulesQueueThread().runOnQueue(task);
} else {
task.run();
}
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
}
private static synchronized void loadLibraryIfNeeded() {
@@ -309,10 +318,10 @@ final class ReactInstance {
}
private class ReactJsExceptionHandlerImpl implements ReactJsExceptionHandler {
private final MessageQueueThread mNativemodulesmessagequeuethread;
private final MessageQueueThread mMessageQueueThread;
ReactJsExceptionHandlerImpl(MessageQueueThread nativeModulesMessageQueueThread) {
this.mNativemodulesmessagequeuethread = nativeModulesMessageQueueThread;
mMessageQueueThread = nativeModulesMessageQueueThread;
}
@Override
@@ -320,7 +329,7 @@ final class ReactInstance {
JavaOnlyMap data = StackTraceHelper.convertParsedError(error);
// Simulate async native module method call
mNativemodulesmessagequeuethread.runOnQueue(
mMessageQueueThread.runOnQueue(
() -> {
NativeExceptionsManagerSpec exceptionsManager =
(NativeExceptionsManagerSpec)
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<c825fdcef76d7389136652caaf8c3390>>
* @generated SignedSource<<0a287c69e07600efe13acfcf8bd29f0d>>
*/
/**
@@ -153,6 +153,12 @@ class ReactNativeFeatureFlagsProviderHolder
return method(javaProvider_);
}
bool initEagerTurboModulesOnNativeModulesQueueAndroid() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("initEagerTurboModulesOnNativeModulesQueueAndroid");
return method(javaProvider_);
}
bool lazyAnimationCallbacks() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("lazyAnimationCallbacks");
@@ -306,6 +312,11 @@ bool JReactNativeFeatureFlagsCxxInterop::fuseboxEnabledRelease(
return ReactNativeFeatureFlags::fuseboxEnabledRelease();
}
bool JReactNativeFeatureFlagsCxxInterop::initEagerTurboModulesOnNativeModulesQueueAndroid(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::initEagerTurboModulesOnNativeModulesQueueAndroid();
}
bool JReactNativeFeatureFlagsCxxInterop::lazyAnimationCallbacks(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::lazyAnimationCallbacks();
@@ -425,6 +436,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"fuseboxEnabledRelease",
JReactNativeFeatureFlagsCxxInterop::fuseboxEnabledRelease),
makeNativeMethod(
"initEagerTurboModulesOnNativeModulesQueueAndroid",
JReactNativeFeatureFlagsCxxInterop::initEagerTurboModulesOnNativeModulesQueueAndroid),
makeNativeMethod(
"lazyAnimationCallbacks",
JReactNativeFeatureFlagsCxxInterop::lazyAnimationCallbacks),
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<57ee61471fc9a9d3fbcf437ec7787b98>>
* @generated SignedSource<<8bc3813da5b0d8ad6a46064b30f48ea8>>
*/
/**
@@ -87,6 +87,9 @@ class JReactNativeFeatureFlagsCxxInterop
static bool fuseboxEnabledRelease(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool initEagerTurboModulesOnNativeModulesQueueAndroid(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool lazyAnimationCallbacks(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<1f6e54fe4620719b93b97f0be257bde6>>
* @generated SignedSource<<1bea72c406359550598787ea5da29b17>>
*/
/**
@@ -97,6 +97,10 @@ bool ReactNativeFeatureFlags::fuseboxEnabledRelease() {
return getAccessor().fuseboxEnabledRelease();
}
bool ReactNativeFeatureFlags::initEagerTurboModulesOnNativeModulesQueueAndroid() {
return getAccessor().initEagerTurboModulesOnNativeModulesQueueAndroid();
}
bool ReactNativeFeatureFlags::lazyAnimationCallbacks() {
return getAccessor().lazyAnimationCallbacks();
}
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<52ba90db8208aec0eca2de2c9155246a>>
* @generated SignedSource<<627fb0dc656780d46131fad9bf87efa8>>
*/
/**
@@ -132,6 +132,11 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool fuseboxEnabledRelease();
/**
* Construct modules that requires eager init on the dedicate native modules thread
*/
RN_EXPORT static bool initEagerTurboModulesOnNativeModulesQueueAndroid();
/**
* Only enqueue Choreographer calls if there is an ongoing animation, instead of enqueueing every frame.
*/
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<0bbd53feabe770d25788128960e3ddcf>>
* @generated SignedSource<<23169873ef7f5c07f5c07f59a7440d47>>
*/
/**
@@ -371,6 +371,24 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxEnabledRelease() {
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::initEagerTurboModulesOnNativeModulesQueueAndroid() {
auto flagValue = initEagerTurboModulesOnNativeModulesQueueAndroid_.load();
if (!flagValue.has_value()) {
// This block is not exclusive but it is not necessary.
// If multiple threads try to initialize the feature flag, we would only
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(19, "initEagerTurboModulesOnNativeModulesQueueAndroid");
flagValue = currentProvider_->initEagerTurboModulesOnNativeModulesQueueAndroid();
initEagerTurboModulesOnNativeModulesQueueAndroid_ = flagValue;
}
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::lazyAnimationCallbacks() {
auto flagValue = lazyAnimationCallbacks_.load();
@@ -380,7 +398,7 @@ bool ReactNativeFeatureFlagsAccessor::lazyAnimationCallbacks() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(19, "lazyAnimationCallbacks");
markFlagAsAccessed(20, "lazyAnimationCallbacks");
flagValue = currentProvider_->lazyAnimationCallbacks();
lazyAnimationCallbacks_ = flagValue;
@@ -398,7 +416,7 @@ bool ReactNativeFeatureFlagsAccessor::setAndroidLayoutDirection() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(20, "setAndroidLayoutDirection");
markFlagAsAccessed(21, "setAndroidLayoutDirection");
flagValue = currentProvider_->setAndroidLayoutDirection();
setAndroidLayoutDirection_ = flagValue;
@@ -416,7 +434,7 @@ bool ReactNativeFeatureFlagsAccessor::useImmediateExecutorInAndroidBridgeless()
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(21, "useImmediateExecutorInAndroidBridgeless");
markFlagAsAccessed(22, "useImmediateExecutorInAndroidBridgeless");
flagValue = currentProvider_->useImmediateExecutorInAndroidBridgeless();
useImmediateExecutorInAndroidBridgeless_ = flagValue;
@@ -434,7 +452,7 @@ bool ReactNativeFeatureFlagsAccessor::useModernRuntimeScheduler() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(22, "useModernRuntimeScheduler");
markFlagAsAccessed(23, "useModernRuntimeScheduler");
flagValue = currentProvider_->useModernRuntimeScheduler();
useModernRuntimeScheduler_ = flagValue;
@@ -452,7 +470,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(23, "useNativeViewConfigsInBridgelessMode");
markFlagAsAccessed(24, "useNativeViewConfigsInBridgelessMode");
flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
useNativeViewConfigsInBridgelessMode_ = flagValue;
@@ -470,7 +488,7 @@ bool ReactNativeFeatureFlagsAccessor::useNewReactImageViewBackgroundDrawing() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(24, "useNewReactImageViewBackgroundDrawing");
markFlagAsAccessed(25, "useNewReactImageViewBackgroundDrawing");
flagValue = currentProvider_->useNewReactImageViewBackgroundDrawing();
useNewReactImageViewBackgroundDrawing_ = flagValue;
@@ -488,7 +506,7 @@ bool ReactNativeFeatureFlagsAccessor::useRuntimeShadowNodeReferenceUpdate() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(25, "useRuntimeShadowNodeReferenceUpdate");
markFlagAsAccessed(26, "useRuntimeShadowNodeReferenceUpdate");
flagValue = currentProvider_->useRuntimeShadowNodeReferenceUpdate();
useRuntimeShadowNodeReferenceUpdate_ = flagValue;
@@ -506,7 +524,7 @@ bool ReactNativeFeatureFlagsAccessor::useRuntimeShadowNodeReferenceUpdateOnLayou
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(26, "useRuntimeShadowNodeReferenceUpdateOnLayout");
markFlagAsAccessed(27, "useRuntimeShadowNodeReferenceUpdateOnLayout");
flagValue = currentProvider_->useRuntimeShadowNodeReferenceUpdateOnLayout();
useRuntimeShadowNodeReferenceUpdateOnLayout_ = flagValue;
@@ -524,7 +542,7 @@ bool ReactNativeFeatureFlagsAccessor::useStateAlignmentMechanism() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(27, "useStateAlignmentMechanism");
markFlagAsAccessed(28, "useStateAlignmentMechanism");
flagValue = currentProvider_->useStateAlignmentMechanism();
useStateAlignmentMechanism_ = flagValue;
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<21ccc4daa6d8c02f29e4bbd4c9a75e49>>
* @generated SignedSource<<c52c8d53c3d17a1d0f35322aa591bebf>>
*/
/**
@@ -50,6 +50,7 @@ class ReactNativeFeatureFlagsAccessor {
bool forceBatchingMountItemsOnAndroid();
bool fuseboxEnabledDebug();
bool fuseboxEnabledRelease();
bool initEagerTurboModulesOnNativeModulesQueueAndroid();
bool lazyAnimationCallbacks();
bool setAndroidLayoutDirection();
bool useImmediateExecutorInAndroidBridgeless();
@@ -69,7 +70,7 @@ class ReactNativeFeatureFlagsAccessor {
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
bool wasOverridden_;
std::array<std::atomic<const char*>, 28> accessedFeatureFlags_;
std::array<std::atomic<const char*>, 29> accessedFeatureFlags_;
std::atomic<std::optional<bool>> commonTestFlag_;
std::atomic<std::optional<bool>> allowCollapsableChildren_;
@@ -90,6 +91,7 @@ class ReactNativeFeatureFlagsAccessor {
std::atomic<std::optional<bool>> forceBatchingMountItemsOnAndroid_;
std::atomic<std::optional<bool>> fuseboxEnabledDebug_;
std::atomic<std::optional<bool>> fuseboxEnabledRelease_;
std::atomic<std::optional<bool>> initEagerTurboModulesOnNativeModulesQueueAndroid_;
std::atomic<std::optional<bool>> lazyAnimationCallbacks_;
std::atomic<std::optional<bool>> setAndroidLayoutDirection_;
std::atomic<std::optional<bool>> useImmediateExecutorInAndroidBridgeless_;
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<1f576108717e5bd1b5ca8de0aaae5b0e>>
* @generated SignedSource<<031622096a93ca9da5e278dab84324b9>>
*/
/**
@@ -103,6 +103,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
return false;
}
bool initEagerTurboModulesOnNativeModulesQueueAndroid() override {
return false;
}
bool lazyAnimationCallbacks() override {
return false;
}
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<760ad06ff565102e3ba42d671f45a470>>
* @generated SignedSource<<55e4299def48d95ea40cd988e70fd608>>
*/
/**
@@ -44,6 +44,7 @@ class ReactNativeFeatureFlagsProvider {
virtual bool forceBatchingMountItemsOnAndroid() = 0;
virtual bool fuseboxEnabledDebug() = 0;
virtual bool fuseboxEnabledRelease() = 0;
virtual bool initEagerTurboModulesOnNativeModulesQueueAndroid() = 0;
virtual bool lazyAnimationCallbacks() = 0;
virtual bool setAndroidLayoutDirection() = 0;
virtual bool useImmediateExecutorInAndroidBridgeless() = 0;
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<1c3b8179bf67dd9d44c8d2e29bf752b6>>
* @generated SignedSource<<345d27de837a248fbfd5e299754097f0>>
*/
/**
@@ -132,6 +132,11 @@ bool NativeReactNativeFeatureFlags::fuseboxEnabledRelease(
return ReactNativeFeatureFlags::fuseboxEnabledRelease();
}
bool NativeReactNativeFeatureFlags::initEagerTurboModulesOnNativeModulesQueueAndroid(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::initEagerTurboModulesOnNativeModulesQueueAndroid();
}
bool NativeReactNativeFeatureFlags::lazyAnimationCallbacks(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::lazyAnimationCallbacks();
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<fe86485dda04a792c697e9b1982376b3>>
* @generated SignedSource<<4121c9b419a41e84ec2c1066cb2707e2>>
*/
/**
@@ -73,6 +73,8 @@ class NativeReactNativeFeatureFlags
bool fuseboxEnabledRelease(jsi::Runtime& runtime);
bool initEagerTurboModulesOnNativeModulesQueueAndroid(jsi::Runtime& runtime);
bool lazyAnimationCallbacks(jsi::Runtime& runtime);
bool setAndroidLayoutDirection(jsi::Runtime& runtime);
@@ -128,6 +128,11 @@ const definitions: FeatureFlagDefinitions = {
description:
'Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled in release builds. This flag is global and should not be changed across React Host lifetimes.',
},
initEagerTurboModulesOnNativeModulesQueueAndroid: {
defaultValue: false,
description:
'Construct modules that requires eager init on the dedicate native modules thread',
},
lazyAnimationCallbacks: {
defaultValue: false,
description:
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<3fce773b88616a376b8ab6dbd5649813>>
* @generated SignedSource<<3ee4e03eae552b81423262351ee2a494>>
* @flow strict-local
*/
@@ -60,6 +60,7 @@ export type ReactNativeFeatureFlags = {
forceBatchingMountItemsOnAndroid: Getter<boolean>,
fuseboxEnabledDebug: Getter<boolean>,
fuseboxEnabledRelease: Getter<boolean>,
initEagerTurboModulesOnNativeModulesQueueAndroid: Getter<boolean>,
lazyAnimationCallbacks: Getter<boolean>,
setAndroidLayoutDirection: Getter<boolean>,
useImmediateExecutorInAndroidBridgeless: Getter<boolean>,
@@ -192,6 +193,10 @@ export const fuseboxEnabledDebug: Getter<boolean> = createNativeFlagGetter('fuse
* Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled in release builds. This flag is global and should not be changed across React Host lifetimes.
*/
export const fuseboxEnabledRelease: Getter<boolean> = createNativeFlagGetter('fuseboxEnabledRelease', false);
/**
* Construct modules that requires eager init on the dedicate native modules thread
*/
export const initEagerTurboModulesOnNativeModulesQueueAndroid: Getter<boolean> = createNativeFlagGetter('initEagerTurboModulesOnNativeModulesQueueAndroid', false);
/**
* Only enqueue Choreographer calls if there is an ongoing animation, instead of enqueueing every frame.
*/
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<4f001bdc6d2161ead95635785f387abe>>
* @generated SignedSource<<44f6fe8269f1b8d2039668e67bca9839>>
* @flow strict-local
*/
@@ -42,6 +42,7 @@ export interface Spec extends TurboModule {
+forceBatchingMountItemsOnAndroid?: () => boolean;
+fuseboxEnabledDebug?: () => boolean;
+fuseboxEnabledRelease?: () => boolean;
+initEagerTurboModulesOnNativeModulesQueueAndroid?: () => boolean;
+lazyAnimationCallbacks?: () => boolean;
+setAndroidLayoutDirection?: () => boolean;
+useImmediateExecutorInAndroidBridgeless?: () => boolean;