Introduce the enableEventEmitterRetentionDuringGesturesOnAndroid to gate the Pressable fix (#45930)

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

This introduces the `enableEventEmitterRetentionDuringGesturesOnAndroid` that allows us to gate the
fix for bug #45126 and #44610.

Changelog:
[Internal] [Changed] - Introduce the enableEventEmitterRetentionDuringGesturesOnAndroid to gate the Pressable fix

Reviewed By: mdvacca

Differential Revision: D60908117

fbshipit-source-id: 885917832718d9b90d043b2d7e2cdb47e0f01ea7
This commit is contained in:
Nicola Corti
2024-08-08 05:06:04 -07:00
committed by Facebook GitHub Bot
parent 6b7f68240e
commit 92dff73ba2
22 changed files with 174 additions and 53 deletions
@@ -46,6 +46,11 @@ public object DefaultNewArchitectureEntryPoint {
ReactNativeFeatureFlags.override(
object : ReactNativeNewArchitectureFeatureFlagsDefaults(newArchitectureEnabled = true) {
override fun useFabricInterop(): Boolean = fabricEnabled
// We turn this feature flag to true for OSS to fix #44610 and #45126 and other
// similar bugs related to pressable.
override fun enableEventEmitterRetentionDuringGesturesOnAndroid(): Boolean =
fabricEnabled
})
}
@@ -1042,7 +1042,8 @@ public class SurfaceMountingManager {
return;
}
if (mViewsWithActiveTouches.contains(reactTag)) {
if (ReactNativeFeatureFlags.enableEventEmitterRetentionDuringGesturesOnAndroid()
&& mViewsWithActiveTouches.contains(reactTag)) {
// If the view that went offscreen is still being touched, we can't delete it yet.
// We have to delay the deletion till the touch is completed.
// This is causing bugs like those otherwise:
@@ -1181,10 +1182,16 @@ public class SurfaceMountingManager {
}
public void markActiveTouchForTag(int reactTag) {
if (!ReactNativeFeatureFlags.enableEventEmitterRetentionDuringGesturesOnAndroid()) {
return;
}
mViewsWithActiveTouches.add(reactTag);
}
public void sweepActiveTouchForTag(int reactTag) {
if (!ReactNativeFeatureFlags.enableEventEmitterRetentionDuringGesturesOnAndroid()) {
return;
}
mViewsWithActiveTouches.remove(reactTag);
if (mViewsToDeleteAfterTouchFinishes.contains(reactTag)) {
mViewsToDeleteAfterTouchFinishes.remove(reactTag);
@@ -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<<11bd299e21bf2eb1c320e657885826e4>>
* @generated SignedSource<<275859c437f60e7733da2b238c911152>>
*/
/**
@@ -88,6 +88,12 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun enableEagerRootViewAttachment(): Boolean = accessor.enableEagerRootViewAttachment()
/**
* Enables the retention of EventEmitterWrapper on Android till the touch gesture is over to fix a bug on pressable (#44610)
*/
@JvmStatic
public fun enableEventEmitterRetentionDuringGesturesOnAndroid(): Boolean = accessor.enableEventEmitterRetentionDuringGesturesOnAndroid()
/**
* This feature flag enables logs for Fabric.
*/
@@ -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<<c646b32a6639fdb0e794f3a2b6e01171>>
* @generated SignedSource<<e58ecac6e67cd870b8ac077cbdfd7469>>
*/
/**
@@ -30,6 +30,7 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
private var enableBackgroundStyleApplicatorCache: Boolean? = null
private var enableCleanTextInputYogaNodeCache: Boolean? = null
private var enableEagerRootViewAttachmentCache: Boolean? = null
private var enableEventEmitterRetentionDuringGesturesOnAndroidCache: Boolean? = null
private var enableFabricLogsCache: Boolean? = null
private var enableFabricRendererExclusivelyCache: Boolean? = null
private var enableGranularShadowTreeStateReconciliationCache: Boolean? = null
@@ -154,6 +155,15 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
return cached
}
override fun enableEventEmitterRetentionDuringGesturesOnAndroid(): Boolean {
var cached = enableEventEmitterRetentionDuringGesturesOnAndroidCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.enableEventEmitterRetentionDuringGesturesOnAndroid()
enableEventEmitterRetentionDuringGesturesOnAndroidCache = cached
}
return cached
}
override fun enableFabricLogs(): Boolean {
var cached = enableFabricLogsCache
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<<fec9ad21cd603e23ef38d926ba693340>>
* @generated SignedSource<<1d79b037e6e8cf2e7306b7f5b3798b9a>>
*/
/**
@@ -48,6 +48,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
@DoNotStrip @JvmStatic public external fun enableEagerRootViewAttachment(): Boolean
@DoNotStrip @JvmStatic public external fun enableEventEmitterRetentionDuringGesturesOnAndroid(): Boolean
@DoNotStrip @JvmStatic public external fun enableFabricLogs(): Boolean
@DoNotStrip @JvmStatic public external fun enableFabricRendererExclusively(): 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<<06c99ad6853216864f14c96fdc9704dd>>
* @generated SignedSource<<c9d11f2cf414d546f5c9be0a05b22e85>>
*/
/**
@@ -43,6 +43,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
override fun enableEagerRootViewAttachment(): Boolean = false
override fun enableEventEmitterRetentionDuringGesturesOnAndroid(): Boolean = false
override fun enableFabricLogs(): Boolean = false
override fun enableFabricRendererExclusively(): Boolean = 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<<a0b0cc1b62abded9dd8a7b70f8d897da>>
* @generated SignedSource<<408d66cdad8b708c06ca844cd6524ba4>>
*/
/**
@@ -34,6 +34,7 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
private var enableBackgroundStyleApplicatorCache: Boolean? = null
private var enableCleanTextInputYogaNodeCache: Boolean? = null
private var enableEagerRootViewAttachmentCache: Boolean? = null
private var enableEventEmitterRetentionDuringGesturesOnAndroidCache: Boolean? = null
private var enableFabricLogsCache: Boolean? = null
private var enableFabricRendererExclusivelyCache: Boolean? = null
private var enableGranularShadowTreeStateReconciliationCache: Boolean? = null
@@ -168,6 +169,16 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
return cached
}
override fun enableEventEmitterRetentionDuringGesturesOnAndroid(): Boolean {
var cached = enableEventEmitterRetentionDuringGesturesOnAndroidCache
if (cached == null) {
cached = currentProvider.enableEventEmitterRetentionDuringGesturesOnAndroid()
accessedFeatureFlags.add("enableEventEmitterRetentionDuringGesturesOnAndroid")
enableEventEmitterRetentionDuringGesturesOnAndroidCache = cached
}
return cached
}
override fun enableFabricLogs(): Boolean {
var cached = enableFabricLogsCache
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<<6c32d13e793895356e70e01c2fa784b6>>
* @generated SignedSource<<040b9cb9cec727e2eb31769712980528>>
*/
/**
@@ -43,6 +43,8 @@ public interface ReactNativeFeatureFlagsProvider {
@DoNotStrip public fun enableEagerRootViewAttachment(): Boolean
@DoNotStrip public fun enableEventEmitterRetentionDuringGesturesOnAndroid(): Boolean
@DoNotStrip public fun enableFabricLogs(): Boolean
@DoNotStrip public fun enableFabricRendererExclusively(): Boolean
@@ -16,6 +16,7 @@ import com.facebook.infer.annotation.Nullsafe;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.UIManager;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags;
import com.facebook.react.uimanager.common.UIManagerType;
import com.facebook.react.uimanager.events.EventDispatcher;
import com.facebook.react.uimanager.events.TouchEvent;
@@ -191,6 +192,9 @@ public class JSTouchDispatcher {
private void markActiveTouchForTag(
int surfaceId, int reactTag, @Nullable ReactContext reactContext) {
if (!ReactNativeFeatureFlags.enableEventEmitterRetentionDuringGesturesOnAndroid()) {
return;
}
if (reactContext == null) {
return;
}
@@ -202,6 +206,9 @@ public class JSTouchDispatcher {
private void sweepActiveTouchForTag(
int surfaceId, int reactTag, @Nullable ReactContext reactContext) {
if (!ReactNativeFeatureFlags.enableEventEmitterRetentionDuringGesturesOnAndroid()) {
return;
}
if (reactContext == null) {
return;
}
@@ -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<<12c6250b601db5f8db15dc1bed57405c>>
* @generated SignedSource<<d9fe713f8bbf188b2f47e7798b939351>>
*/
/**
@@ -99,6 +99,12 @@ class ReactNativeFeatureFlagsProviderHolder
return method(javaProvider_);
}
bool enableEventEmitterRetentionDuringGesturesOnAndroid() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableEventEmitterRetentionDuringGesturesOnAndroid");
return method(javaProvider_);
}
bool enableFabricLogs() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableFabricLogs");
@@ -351,6 +357,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableEagerRootViewAttachment(
return ReactNativeFeatureFlags::enableEagerRootViewAttachment();
}
bool JReactNativeFeatureFlagsCxxInterop::enableEventEmitterRetentionDuringGesturesOnAndroid(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableEventEmitterRetentionDuringGesturesOnAndroid();
}
bool JReactNativeFeatureFlagsCxxInterop::enableFabricLogs(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableFabricLogs();
@@ -563,6 +574,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"enableEagerRootViewAttachment",
JReactNativeFeatureFlagsCxxInterop::enableEagerRootViewAttachment),
makeNativeMethod(
"enableEventEmitterRetentionDuringGesturesOnAndroid",
JReactNativeFeatureFlagsCxxInterop::enableEventEmitterRetentionDuringGesturesOnAndroid),
makeNativeMethod(
"enableFabricLogs",
JReactNativeFeatureFlagsCxxInterop::enableFabricLogs),
@@ -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<<5399269d162bd4823a7ec36198c0604f>>
* @generated SignedSource<<d53535b04b78e24612042ba9b39f26a8>>
*/
/**
@@ -60,6 +60,9 @@ class JReactNativeFeatureFlagsCxxInterop
static bool enableEagerRootViewAttachment(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool enableEventEmitterRetentionDuringGesturesOnAndroid(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool enableFabricLogs(
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<<ed768614ca40990bc4cb67fd30c62274>>
* @generated SignedSource<<d6fc68526bed62a7aa33973b2cb1eec8>>
*/
/**
@@ -61,6 +61,10 @@ bool ReactNativeFeatureFlags::enableEagerRootViewAttachment() {
return getAccessor().enableEagerRootViewAttachment();
}
bool ReactNativeFeatureFlags::enableEventEmitterRetentionDuringGesturesOnAndroid() {
return getAccessor().enableEventEmitterRetentionDuringGesturesOnAndroid();
}
bool ReactNativeFeatureFlags::enableFabricLogs() {
return getAccessor().enableFabricLogs();
}
@@ -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<<93b1717fb2e45f00fb068a4ffa248afe>>
* @generated SignedSource<<45ae072fb6a0b1ec404b3dc8adc13186>>
*/
/**
@@ -87,6 +87,11 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool enableEagerRootViewAttachment();
/**
* Enables the retention of EventEmitterWrapper on Android till the touch gesture is over to fix a bug on pressable (#44610)
*/
RN_EXPORT static bool enableEventEmitterRetentionDuringGesturesOnAndroid();
/**
* This feature flag enables logs for Fabric.
*/
@@ -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<<e4c43c6ffd07384ea55929cdcfa72703>>
* @generated SignedSource<<9e7498efd93e3c23b74219b7b30ec851>>
*/
/**
@@ -209,6 +209,24 @@ bool ReactNativeFeatureFlagsAccessor::enableEagerRootViewAttachment() {
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::enableEventEmitterRetentionDuringGesturesOnAndroid() {
auto flagValue = enableEventEmitterRetentionDuringGesturesOnAndroid_.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(10, "enableEventEmitterRetentionDuringGesturesOnAndroid");
flagValue = currentProvider_->enableEventEmitterRetentionDuringGesturesOnAndroid();
enableEventEmitterRetentionDuringGesturesOnAndroid_ = flagValue;
}
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::enableFabricLogs() {
auto flagValue = enableFabricLogs_.load();
@@ -218,7 +236,7 @@ bool ReactNativeFeatureFlagsAccessor::enableFabricLogs() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(10, "enableFabricLogs");
markFlagAsAccessed(11, "enableFabricLogs");
flagValue = currentProvider_->enableFabricLogs();
enableFabricLogs_ = flagValue;
@@ -236,7 +254,7 @@ bool ReactNativeFeatureFlagsAccessor::enableFabricRendererExclusively() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(11, "enableFabricRendererExclusively");
markFlagAsAccessed(12, "enableFabricRendererExclusively");
flagValue = currentProvider_->enableFabricRendererExclusively();
enableFabricRendererExclusively_ = flagValue;
@@ -254,7 +272,7 @@ bool ReactNativeFeatureFlagsAccessor::enableGranularShadowTreeStateReconciliatio
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(12, "enableGranularShadowTreeStateReconciliation");
markFlagAsAccessed(13, "enableGranularShadowTreeStateReconciliation");
flagValue = currentProvider_->enableGranularShadowTreeStateReconciliation();
enableGranularShadowTreeStateReconciliation_ = flagValue;
@@ -272,7 +290,7 @@ bool ReactNativeFeatureFlagsAccessor::enableLongTaskAPI() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(13, "enableLongTaskAPI");
markFlagAsAccessed(14, "enableLongTaskAPI");
flagValue = currentProvider_->enableLongTaskAPI();
enableLongTaskAPI_ = flagValue;
@@ -290,7 +308,7 @@ bool ReactNativeFeatureFlagsAccessor::enableMicrotasks() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(14, "enableMicrotasks");
markFlagAsAccessed(15, "enableMicrotasks");
flagValue = currentProvider_->enableMicrotasks();
enableMicrotasks_ = flagValue;
@@ -308,7 +326,7 @@ bool ReactNativeFeatureFlagsAccessor::enablePropsUpdateReconciliationAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(15, "enablePropsUpdateReconciliationAndroid");
markFlagAsAccessed(16, "enablePropsUpdateReconciliationAndroid");
flagValue = currentProvider_->enablePropsUpdateReconciliationAndroid();
enablePropsUpdateReconciliationAndroid_ = flagValue;
@@ -326,7 +344,7 @@ bool ReactNativeFeatureFlagsAccessor::enableReportEventPaintTime() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(16, "enableReportEventPaintTime");
markFlagAsAccessed(17, "enableReportEventPaintTime");
flagValue = currentProvider_->enableReportEventPaintTime();
enableReportEventPaintTime_ = flagValue;
@@ -344,7 +362,7 @@ bool ReactNativeFeatureFlagsAccessor::enableSynchronousStateUpdates() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(17, "enableSynchronousStateUpdates");
markFlagAsAccessed(18, "enableSynchronousStateUpdates");
flagValue = currentProvider_->enableSynchronousStateUpdates();
enableSynchronousStateUpdates_ = flagValue;
@@ -362,7 +380,7 @@ bool ReactNativeFeatureFlagsAccessor::enableUIConsistency() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(18, "enableUIConsistency");
markFlagAsAccessed(19, "enableUIConsistency");
flagValue = currentProvider_->enableUIConsistency();
enableUIConsistency_ = flagValue;
@@ -380,7 +398,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecycling() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(19, "enableViewRecycling");
markFlagAsAccessed(20, "enableViewRecycling");
flagValue = currentProvider_->enableViewRecycling();
enableViewRecycling_ = flagValue;
@@ -398,7 +416,7 @@ bool ReactNativeFeatureFlagsAccessor::excludeYogaFromRawProps() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(20, "excludeYogaFromRawProps");
markFlagAsAccessed(21, "excludeYogaFromRawProps");
flagValue = currentProvider_->excludeYogaFromRawProps();
excludeYogaFromRawProps_ = flagValue;
@@ -416,7 +434,7 @@ bool ReactNativeFeatureFlagsAccessor::fetchImagesInViewPreallocation() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(21, "fetchImagesInViewPreallocation");
markFlagAsAccessed(22, "fetchImagesInViewPreallocation");
flagValue = currentProvider_->fetchImagesInViewPreallocation();
fetchImagesInViewPreallocation_ = flagValue;
@@ -434,7 +452,7 @@ bool ReactNativeFeatureFlagsAccessor::fixIncorrectScrollViewStateUpdateOnAndroid
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(22, "fixIncorrectScrollViewStateUpdateOnAndroid");
markFlagAsAccessed(23, "fixIncorrectScrollViewStateUpdateOnAndroid");
flagValue = currentProvider_->fixIncorrectScrollViewStateUpdateOnAndroid();
fixIncorrectScrollViewStateUpdateOnAndroid_ = flagValue;
@@ -452,7 +470,7 @@ bool ReactNativeFeatureFlagsAccessor::fixMappingOfEventPrioritiesBetweenFabricAn
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(23, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
markFlagAsAccessed(24, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact();
fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue;
@@ -470,7 +488,7 @@ bool ReactNativeFeatureFlagsAccessor::fixMissedFabricStateUpdatesOnAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(24, "fixMissedFabricStateUpdatesOnAndroid");
markFlagAsAccessed(25, "fixMissedFabricStateUpdatesOnAndroid");
flagValue = currentProvider_->fixMissedFabricStateUpdatesOnAndroid();
fixMissedFabricStateUpdatesOnAndroid_ = flagValue;
@@ -488,7 +506,7 @@ bool ReactNativeFeatureFlagsAccessor::forceBatchingMountItemsOnAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(25, "forceBatchingMountItemsOnAndroid");
markFlagAsAccessed(26, "forceBatchingMountItemsOnAndroid");
flagValue = currentProvider_->forceBatchingMountItemsOnAndroid();
forceBatchingMountItemsOnAndroid_ = flagValue;
@@ -506,7 +524,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxEnabledDebug() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(26, "fuseboxEnabledDebug");
markFlagAsAccessed(27, "fuseboxEnabledDebug");
flagValue = currentProvider_->fuseboxEnabledDebug();
fuseboxEnabledDebug_ = flagValue;
@@ -524,7 +542,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxEnabledRelease() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(27, "fuseboxEnabledRelease");
markFlagAsAccessed(28, "fuseboxEnabledRelease");
flagValue = currentProvider_->fuseboxEnabledRelease();
fuseboxEnabledRelease_ = flagValue;
@@ -542,7 +560,7 @@ bool ReactNativeFeatureFlagsAccessor::initEagerTurboModulesOnNativeModulesQueueA
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(28, "initEagerTurboModulesOnNativeModulesQueueAndroid");
markFlagAsAccessed(29, "initEagerTurboModulesOnNativeModulesQueueAndroid");
flagValue = currentProvider_->initEagerTurboModulesOnNativeModulesQueueAndroid();
initEagerTurboModulesOnNativeModulesQueueAndroid_ = flagValue;
@@ -560,7 +578,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(29, "lazyAnimationCallbacks");
markFlagAsAccessed(30, "lazyAnimationCallbacks");
flagValue = currentProvider_->lazyAnimationCallbacks();
lazyAnimationCallbacks_ = flagValue;
@@ -578,7 +596,7 @@ bool ReactNativeFeatureFlagsAccessor::loadVectorDrawablesOnImages() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(30, "loadVectorDrawablesOnImages");
markFlagAsAccessed(31, "loadVectorDrawablesOnImages");
flagValue = currentProvider_->loadVectorDrawablesOnImages();
loadVectorDrawablesOnImages_ = flagValue;
@@ -596,7 +614,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(31, "setAndroidLayoutDirection");
markFlagAsAccessed(32, "setAndroidLayoutDirection");
flagValue = currentProvider_->setAndroidLayoutDirection();
setAndroidLayoutDirection_ = flagValue;
@@ -614,7 +632,7 @@ bool ReactNativeFeatureFlagsAccessor::traceTurboModulePromiseRejectionsOnAndroid
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(32, "traceTurboModulePromiseRejectionsOnAndroid");
markFlagAsAccessed(33, "traceTurboModulePromiseRejectionsOnAndroid");
flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid();
traceTurboModulePromiseRejectionsOnAndroid_ = flagValue;
@@ -632,7 +650,7 @@ bool ReactNativeFeatureFlagsAccessor::useFabricInterop() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(33, "useFabricInterop");
markFlagAsAccessed(34, "useFabricInterop");
flagValue = currentProvider_->useFabricInterop();
useFabricInterop_ = flagValue;
@@ -650,7 +668,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(34, "useImmediateExecutorInAndroidBridgeless");
markFlagAsAccessed(35, "useImmediateExecutorInAndroidBridgeless");
flagValue = currentProvider_->useImmediateExecutorInAndroidBridgeless();
useImmediateExecutorInAndroidBridgeless_ = flagValue;
@@ -668,7 +686,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(35, "useModernRuntimeScheduler");
markFlagAsAccessed(36, "useModernRuntimeScheduler");
flagValue = currentProvider_->useModernRuntimeScheduler();
useModernRuntimeScheduler_ = flagValue;
@@ -686,7 +704,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(36, "useNativeViewConfigsInBridgelessMode");
markFlagAsAccessed(37, "useNativeViewConfigsInBridgelessMode");
flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
useNativeViewConfigsInBridgelessMode_ = flagValue;
@@ -704,7 +722,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(37, "useNewReactImageViewBackgroundDrawing");
markFlagAsAccessed(38, "useNewReactImageViewBackgroundDrawing");
flagValue = currentProvider_->useNewReactImageViewBackgroundDrawing();
useNewReactImageViewBackgroundDrawing_ = flagValue;
@@ -722,7 +740,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimisedViewPreallocationOnAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(38, "useOptimisedViewPreallocationOnAndroid");
markFlagAsAccessed(39, "useOptimisedViewPreallocationOnAndroid");
flagValue = currentProvider_->useOptimisedViewPreallocationOnAndroid();
useOptimisedViewPreallocationOnAndroid_ = flagValue;
@@ -740,7 +758,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(39, "useRuntimeShadowNodeReferenceUpdate");
markFlagAsAccessed(40, "useRuntimeShadowNodeReferenceUpdate");
flagValue = currentProvider_->useRuntimeShadowNodeReferenceUpdate();
useRuntimeShadowNodeReferenceUpdate_ = flagValue;
@@ -758,7 +776,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(40, "useRuntimeShadowNodeReferenceUpdateOnLayout");
markFlagAsAccessed(41, "useRuntimeShadowNodeReferenceUpdateOnLayout");
flagValue = currentProvider_->useRuntimeShadowNodeReferenceUpdateOnLayout();
useRuntimeShadowNodeReferenceUpdateOnLayout_ = flagValue;
@@ -776,7 +794,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(41, "useStateAlignmentMechanism");
markFlagAsAccessed(42, "useStateAlignmentMechanism");
flagValue = currentProvider_->useStateAlignmentMechanism();
useStateAlignmentMechanism_ = flagValue;
@@ -794,7 +812,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(42, "useTurboModuleInterop");
markFlagAsAccessed(43, "useTurboModuleInterop");
flagValue = currentProvider_->useTurboModuleInterop();
useTurboModuleInterop_ = 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<<42259cb82f9ac5b3c0918339b45e6a2a>>
* @generated SignedSource<<b95d717c37ef81f310016fdcdd0938e9>>
*/
/**
@@ -41,6 +41,7 @@ class ReactNativeFeatureFlagsAccessor {
bool enableBackgroundStyleApplicator();
bool enableCleanTextInputYogaNode();
bool enableEagerRootViewAttachment();
bool enableEventEmitterRetentionDuringGesturesOnAndroid();
bool enableFabricLogs();
bool enableFabricRendererExclusively();
bool enableGranularShadowTreeStateReconciliation();
@@ -84,7 +85,7 @@ class ReactNativeFeatureFlagsAccessor {
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
bool wasOverridden_;
std::array<std::atomic<const char*>, 43> accessedFeatureFlags_;
std::array<std::atomic<const char*>, 44> accessedFeatureFlags_;
std::atomic<std::optional<bool>> commonTestFlag_;
std::atomic<std::optional<bool>> allowRecursiveCommitsWithSynchronousMountOnAndroid_;
@@ -96,6 +97,7 @@ class ReactNativeFeatureFlagsAccessor {
std::atomic<std::optional<bool>> enableBackgroundStyleApplicator_;
std::atomic<std::optional<bool>> enableCleanTextInputYogaNode_;
std::atomic<std::optional<bool>> enableEagerRootViewAttachment_;
std::atomic<std::optional<bool>> enableEventEmitterRetentionDuringGesturesOnAndroid_;
std::atomic<std::optional<bool>> enableFabricLogs_;
std::atomic<std::optional<bool>> enableFabricRendererExclusively_;
std::atomic<std::optional<bool>> enableGranularShadowTreeStateReconciliation_;
@@ -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<<6624485d7a7712c8243e4a00621fa10d>>
* @generated SignedSource<<5984a783c431c11b00c2dd8321432235>>
*/
/**
@@ -67,6 +67,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
return false;
}
bool enableEventEmitterRetentionDuringGesturesOnAndroid() override {
return false;
}
bool enableFabricLogs() 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<<28c8387a6ed837bcfbe75da8dae74e63>>
* @generated SignedSource<<362ab4dfd19d6f3189b3c3e5aafd009a>>
*/
/**
@@ -35,6 +35,7 @@ class ReactNativeFeatureFlagsProvider {
virtual bool enableBackgroundStyleApplicator() = 0;
virtual bool enableCleanTextInputYogaNode() = 0;
virtual bool enableEagerRootViewAttachment() = 0;
virtual bool enableEventEmitterRetentionDuringGesturesOnAndroid() = 0;
virtual bool enableFabricLogs() = 0;
virtual bool enableFabricRendererExclusively() = 0;
virtual bool enableGranularShadowTreeStateReconciliation() = 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<<aee6b808045e1f1e8f91cb3820c177d9>>
* @generated SignedSource<<defc646c8f8a2f3ae91052f1c8ac7940>>
*/
/**
@@ -87,6 +87,11 @@ bool NativeReactNativeFeatureFlags::enableEagerRootViewAttachment(
return ReactNativeFeatureFlags::enableEagerRootViewAttachment();
}
bool NativeReactNativeFeatureFlags::enableEventEmitterRetentionDuringGesturesOnAndroid(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::enableEventEmitterRetentionDuringGesturesOnAndroid();
}
bool NativeReactNativeFeatureFlags::enableFabricLogs(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::enableFabricLogs();
@@ -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<<d06bdd9b0aea9cc9de7feceb012b70bb>>
* @generated SignedSource<<6b0ad22b5e8302c1d4b0dae4d1f2eb19>>
*/
/**
@@ -55,6 +55,8 @@ class NativeReactNativeFeatureFlags
bool enableEagerRootViewAttachment(jsi::Runtime& runtime);
bool enableEventEmitterRetentionDuringGesturesOnAndroid(jsi::Runtime& runtime);
bool enableFabricLogs(jsi::Runtime& runtime);
bool enableFabricRendererExclusively(jsi::Runtime& runtime);
@@ -83,6 +83,11 @@ const definitions: FeatureFlagDefinitions = {
description:
'Feature flag to configure eager attachment of the root view/initialisation of the JS code.',
},
enableEventEmitterRetentionDuringGesturesOnAndroid: {
defaultValue: false,
description:
'Enables the retention of EventEmitterWrapper on Android till the touch gesture is over to fix a bug on pressable (#44610)',
},
enableFabricLogs: {
defaultValue: false,
description: 'This feature flag enables logs for Fabric.',
@@ -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<<6896ec018143f40b7d08487fb10239d7>>
* @generated SignedSource<<453a0231b2d396d59727425f008c65b8>>
* @flow strict-local
*/
@@ -54,6 +54,7 @@ export type ReactNativeFeatureFlags = {
enableBackgroundStyleApplicator: Getter<boolean>,
enableCleanTextInputYogaNode: Getter<boolean>,
enableEagerRootViewAttachment: Getter<boolean>,
enableEventEmitterRetentionDuringGesturesOnAndroid: Getter<boolean>,
enableFabricLogs: Getter<boolean>,
enableFabricRendererExclusively: Getter<boolean>,
enableGranularShadowTreeStateReconciliation: Getter<boolean>,
@@ -189,6 +190,10 @@ export const enableCleanTextInputYogaNode: Getter<boolean> = createNativeFlagGet
* Feature flag to configure eager attachment of the root view/initialisation of the JS code.
*/
export const enableEagerRootViewAttachment: Getter<boolean> = createNativeFlagGetter('enableEagerRootViewAttachment', false);
/**
* Enables the retention of EventEmitterWrapper on Android till the touch gesture is over to fix a bug on pressable (#44610)
*/
export const enableEventEmitterRetentionDuringGesturesOnAndroid: Getter<boolean> = createNativeFlagGetter('enableEventEmitterRetentionDuringGesturesOnAndroid', false);
/**
* This feature flag enables logs for Fabric.
*/
@@ -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<<8e7f7c0b5eccf4db77ab4b65a4aae313>>
* @generated SignedSource<<cf3a429b8e2ca23dcba05f3e66cf2e23>>
* @flow strict-local
*/
@@ -33,6 +33,7 @@ export interface Spec extends TurboModule {
+enableBackgroundStyleApplicator?: () => boolean;
+enableCleanTextInputYogaNode?: () => boolean;
+enableEagerRootViewAttachment?: () => boolean;
+enableEventEmitterRetentionDuringGesturesOnAndroid?: () => boolean;
+enableFabricLogs?: () => boolean;
+enableFabricRendererExclusively?: () => boolean;
+enableGranularShadowTreeStateReconciliation?: () => boolean;