Cleanup ReactNativeFeatureFlags.allowCollapsableChildren() (#45860)

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

This has been on by default for a long while.

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D60579198

fbshipit-source-id: 4bd8a13dada8edf00489dc64b1ff4ff0364a8843
This commit is contained in:
Nick Gerleman
2024-08-06 20:17:27 -07:00
committed by Facebook GitHub Bot
parent 10c91e9a38
commit 8ed3838cbd
20 changed files with 71 additions and 181 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<<ea2ffa17af587ce1889472a5fd1bb0ee>>
* @generated SignedSource<<11bd299e21bf2eb1c320e657885826e4>>
*/
/**
@@ -34,12 +34,6 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun commonTestFlag(): Boolean = accessor.commonTestFlag()
/**
* Enables the differentiator to understand the "collapsableChildren" prop
*/
@JvmStatic
public fun allowCollapsableChildren(): Boolean = accessor.allowCollapsableChildren()
/**
* Adds support for recursively processing commits that mount synchronously (Android only).
*/
@@ -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<<2d2f24ab93b9c2eb0b2002354f609ead>>
* @generated SignedSource<<c646b32a6639fdb0e794f3a2b6e01171>>
*/
/**
@@ -21,7 +21,6 @@ package com.facebook.react.internal.featureflags
public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccessor {
private var commonTestFlagCache: Boolean? = null
private var allowCollapsableChildrenCache: Boolean? = null
private var allowRecursiveCommitsWithSynchronousMountOnAndroidCache: Boolean? = null
private var batchRenderingUpdatesInEventLoopCache: Boolean? = null
private var changeOrderOfMountingInstructionsOnAndroidCache: Boolean? = null
@@ -74,15 +73,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
return cached
}
override fun allowCollapsableChildren(): Boolean {
var cached = allowCollapsableChildrenCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.allowCollapsableChildren()
allowCollapsableChildrenCache = cached
}
return cached
}
override fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean {
var cached = allowRecursiveCommitsWithSynchronousMountOnAndroidCache
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<<fab209e8817791c6892b61889b3c42ec>>
* @generated SignedSource<<fec9ad21cd603e23ef38d926ba693340>>
*/
/**
@@ -30,8 +30,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
@DoNotStrip @JvmStatic public external fun commonTestFlag(): Boolean
@DoNotStrip @JvmStatic public external fun allowCollapsableChildren(): Boolean
@DoNotStrip @JvmStatic public external fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean
@DoNotStrip @JvmStatic public external fun batchRenderingUpdatesInEventLoop(): 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<<2fe2a37cfa83ae9a6a53d1e2e17382b7>>
* @generated SignedSource<<06c99ad6853216864f14c96fdc9704dd>>
*/
/**
@@ -25,8 +25,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
override fun commonTestFlag(): Boolean = false
override fun allowCollapsableChildren(): Boolean = true
override fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean = false
override fun batchRenderingUpdatesInEventLoop(): 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<<9df3a3025e104c4dd9ce4fb99b8acbcd>>
* @generated SignedSource<<a0b0cc1b62abded9dd8a7b70f8d897da>>
*/
/**
@@ -25,7 +25,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
private val accessedFeatureFlags = mutableSetOf<String>()
private var commonTestFlagCache: Boolean? = null
private var allowCollapsableChildrenCache: Boolean? = null
private var allowRecursiveCommitsWithSynchronousMountOnAndroidCache: Boolean? = null
private var batchRenderingUpdatesInEventLoopCache: Boolean? = null
private var changeOrderOfMountingInstructionsOnAndroidCache: Boolean? = null
@@ -79,16 +78,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
return cached
}
override fun allowCollapsableChildren(): Boolean {
var cached = allowCollapsableChildrenCache
if (cached == null) {
cached = currentProvider.allowCollapsableChildren()
accessedFeatureFlags.add("allowCollapsableChildren")
allowCollapsableChildrenCache = cached
}
return cached
}
override fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean {
var cached = allowRecursiveCommitsWithSynchronousMountOnAndroidCache
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<<ede274d7ec557bdc870c7f87bf1e0b9b>>
* @generated SignedSource<<6c32d13e793895356e70e01c2fa784b6>>
*/
/**
@@ -25,8 +25,6 @@ import com.facebook.proguard.annotations.DoNotStrip
public interface ReactNativeFeatureFlagsProvider {
@DoNotStrip public fun commonTestFlag(): Boolean
@DoNotStrip public fun allowCollapsableChildren(): Boolean
@DoNotStrip public fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean
@DoNotStrip public fun batchRenderingUpdatesInEventLoop(): 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<<8c7af40ab6ea0f4ea88a795d5884a07b>>
* @generated SignedSource<<12c6250b601db5f8db15dc1bed57405c>>
*/
/**
@@ -45,12 +45,6 @@ class ReactNativeFeatureFlagsProviderHolder
return method(javaProvider_);
}
bool allowCollapsableChildren() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("allowCollapsableChildren");
return method(javaProvider_);
}
bool allowRecursiveCommitsWithSynchronousMountOnAndroid() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("allowRecursiveCommitsWithSynchronousMountOnAndroid");
@@ -312,11 +306,6 @@ bool JReactNativeFeatureFlagsCxxInterop::commonTestFlag(
return ReactNativeFeatureFlags::commonTestFlag();
}
bool JReactNativeFeatureFlagsCxxInterop::allowCollapsableChildren(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::allowCollapsableChildren();
}
bool JReactNativeFeatureFlagsCxxInterop::allowRecursiveCommitsWithSynchronousMountOnAndroid(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::allowRecursiveCommitsWithSynchronousMountOnAndroid();
@@ -547,9 +536,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"commonTestFlag",
JReactNativeFeatureFlagsCxxInterop::commonTestFlag),
makeNativeMethod(
"allowCollapsableChildren",
JReactNativeFeatureFlagsCxxInterop::allowCollapsableChildren),
makeNativeMethod(
"allowRecursiveCommitsWithSynchronousMountOnAndroid",
JReactNativeFeatureFlagsCxxInterop::allowRecursiveCommitsWithSynchronousMountOnAndroid),
@@ -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<<6c0276095ccff4eb927141ce3b2c5469>>
* @generated SignedSource<<5399269d162bd4823a7ec36198c0604f>>
*/
/**
@@ -33,9 +33,6 @@ class JReactNativeFeatureFlagsCxxInterop
static bool commonTestFlag(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool allowCollapsableChildren(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool allowRecursiveCommitsWithSynchronousMountOnAndroid(
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<<763d10f3232028a26f5ed194fdb3b4f7>>
* @generated SignedSource<<ed768614ca40990bc4cb67fd30c62274>>
*/
/**
@@ -25,10 +25,6 @@ bool ReactNativeFeatureFlags::commonTestFlag() {
return getAccessor().commonTestFlag();
}
bool ReactNativeFeatureFlags::allowCollapsableChildren() {
return getAccessor().allowCollapsableChildren();
}
bool ReactNativeFeatureFlags::allowRecursiveCommitsWithSynchronousMountOnAndroid() {
return getAccessor().allowRecursiveCommitsWithSynchronousMountOnAndroid();
}
@@ -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<<14d7dd1b3690775bb8df6dc17d18c43c>>
* @generated SignedSource<<93b1717fb2e45f00fb068a4ffa248afe>>
*/
/**
@@ -42,11 +42,6 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool commonTestFlag();
/**
* Enables the differentiator to understand the "collapsableChildren" prop
*/
RN_EXPORT static bool allowCollapsableChildren();
/**
* Adds support for recursively processing commits that mount synchronously (Android only).
*/
@@ -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<<56f6d8ad5191b77222c9fbc5676ce697>>
* @generated SignedSource<<e4c43c6ffd07384ea55929cdcfa72703>>
*/
/**
@@ -47,24 +47,6 @@ bool ReactNativeFeatureFlagsAccessor::commonTestFlag() {
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::allowCollapsableChildren() {
auto flagValue = allowCollapsableChildren_.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(1, "allowCollapsableChildren");
flagValue = currentProvider_->allowCollapsableChildren();
allowCollapsableChildren_ = flagValue;
}
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::allowRecursiveCommitsWithSynchronousMountOnAndroid() {
auto flagValue = allowRecursiveCommitsWithSynchronousMountOnAndroid_.load();
@@ -74,7 +56,7 @@ bool ReactNativeFeatureFlagsAccessor::allowRecursiveCommitsWithSynchronousMountO
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(2, "allowRecursiveCommitsWithSynchronousMountOnAndroid");
markFlagAsAccessed(1, "allowRecursiveCommitsWithSynchronousMountOnAndroid");
flagValue = currentProvider_->allowRecursiveCommitsWithSynchronousMountOnAndroid();
allowRecursiveCommitsWithSynchronousMountOnAndroid_ = flagValue;
@@ -92,7 +74,7 @@ bool ReactNativeFeatureFlagsAccessor::batchRenderingUpdatesInEventLoop() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(3, "batchRenderingUpdatesInEventLoop");
markFlagAsAccessed(2, "batchRenderingUpdatesInEventLoop");
flagValue = currentProvider_->batchRenderingUpdatesInEventLoop();
batchRenderingUpdatesInEventLoop_ = flagValue;
@@ -110,7 +92,7 @@ bool ReactNativeFeatureFlagsAccessor::changeOrderOfMountingInstructionsOnAndroid
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(4, "changeOrderOfMountingInstructionsOnAndroid");
markFlagAsAccessed(3, "changeOrderOfMountingInstructionsOnAndroid");
flagValue = currentProvider_->changeOrderOfMountingInstructionsOnAndroid();
changeOrderOfMountingInstructionsOnAndroid_ = flagValue;
@@ -128,7 +110,7 @@ bool ReactNativeFeatureFlagsAccessor::completeReactInstanceCreationOnBgThreadOnA
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(5, "completeReactInstanceCreationOnBgThreadOnAndroid");
markFlagAsAccessed(4, "completeReactInstanceCreationOnBgThreadOnAndroid");
flagValue = currentProvider_->completeReactInstanceCreationOnBgThreadOnAndroid();
completeReactInstanceCreationOnBgThreadOnAndroid_ = flagValue;
@@ -146,7 +128,7 @@ bool ReactNativeFeatureFlagsAccessor::destroyFabricSurfacesInReactInstanceManage
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(6, "destroyFabricSurfacesInReactInstanceManager");
markFlagAsAccessed(5, "destroyFabricSurfacesInReactInstanceManager");
flagValue = currentProvider_->destroyFabricSurfacesInReactInstanceManager();
destroyFabricSurfacesInReactInstanceManager_ = flagValue;
@@ -164,7 +146,7 @@ bool ReactNativeFeatureFlagsAccessor::enableAlignItemsBaselineOnFabricIOS() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(7, "enableAlignItemsBaselineOnFabricIOS");
markFlagAsAccessed(6, "enableAlignItemsBaselineOnFabricIOS");
flagValue = currentProvider_->enableAlignItemsBaselineOnFabricIOS();
enableAlignItemsBaselineOnFabricIOS_ = flagValue;
@@ -182,7 +164,7 @@ bool ReactNativeFeatureFlagsAccessor::enableBackgroundStyleApplicator() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(8, "enableBackgroundStyleApplicator");
markFlagAsAccessed(7, "enableBackgroundStyleApplicator");
flagValue = currentProvider_->enableBackgroundStyleApplicator();
enableBackgroundStyleApplicator_ = flagValue;
@@ -200,7 +182,7 @@ bool ReactNativeFeatureFlagsAccessor::enableCleanTextInputYogaNode() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(9, "enableCleanTextInputYogaNode");
markFlagAsAccessed(8, "enableCleanTextInputYogaNode");
flagValue = currentProvider_->enableCleanTextInputYogaNode();
enableCleanTextInputYogaNode_ = flagValue;
@@ -218,7 +200,7 @@ bool ReactNativeFeatureFlagsAccessor::enableEagerRootViewAttachment() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(10, "enableEagerRootViewAttachment");
markFlagAsAccessed(9, "enableEagerRootViewAttachment");
flagValue = currentProvider_->enableEagerRootViewAttachment();
enableEagerRootViewAttachment_ = flagValue;
@@ -236,7 +218,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(11, "enableFabricLogs");
markFlagAsAccessed(10, "enableFabricLogs");
flagValue = currentProvider_->enableFabricLogs();
enableFabricLogs_ = flagValue;
@@ -254,7 +236,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(12, "enableFabricRendererExclusively");
markFlagAsAccessed(11, "enableFabricRendererExclusively");
flagValue = currentProvider_->enableFabricRendererExclusively();
enableFabricRendererExclusively_ = flagValue;
@@ -272,7 +254,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(13, "enableGranularShadowTreeStateReconciliation");
markFlagAsAccessed(12, "enableGranularShadowTreeStateReconciliation");
flagValue = currentProvider_->enableGranularShadowTreeStateReconciliation();
enableGranularShadowTreeStateReconciliation_ = flagValue;
@@ -290,7 +272,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(14, "enableLongTaskAPI");
markFlagAsAccessed(13, "enableLongTaskAPI");
flagValue = currentProvider_->enableLongTaskAPI();
enableLongTaskAPI_ = flagValue;
@@ -308,7 +290,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(15, "enableMicrotasks");
markFlagAsAccessed(14, "enableMicrotasks");
flagValue = currentProvider_->enableMicrotasks();
enableMicrotasks_ = flagValue;
@@ -326,7 +308,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(16, "enablePropsUpdateReconciliationAndroid");
markFlagAsAccessed(15, "enablePropsUpdateReconciliationAndroid");
flagValue = currentProvider_->enablePropsUpdateReconciliationAndroid();
enablePropsUpdateReconciliationAndroid_ = flagValue;
@@ -344,7 +326,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(17, "enableReportEventPaintTime");
markFlagAsAccessed(16, "enableReportEventPaintTime");
flagValue = currentProvider_->enableReportEventPaintTime();
enableReportEventPaintTime_ = flagValue;
@@ -362,7 +344,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(18, "enableSynchronousStateUpdates");
markFlagAsAccessed(17, "enableSynchronousStateUpdates");
flagValue = currentProvider_->enableSynchronousStateUpdates();
enableSynchronousStateUpdates_ = flagValue;
@@ -380,7 +362,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(19, "enableUIConsistency");
markFlagAsAccessed(18, "enableUIConsistency");
flagValue = currentProvider_->enableUIConsistency();
enableUIConsistency_ = flagValue;
@@ -398,7 +380,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(20, "enableViewRecycling");
markFlagAsAccessed(19, "enableViewRecycling");
flagValue = currentProvider_->enableViewRecycling();
enableViewRecycling_ = flagValue;
@@ -416,7 +398,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(21, "excludeYogaFromRawProps");
markFlagAsAccessed(20, "excludeYogaFromRawProps");
flagValue = currentProvider_->excludeYogaFromRawProps();
excludeYogaFromRawProps_ = flagValue;
@@ -434,7 +416,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(22, "fetchImagesInViewPreallocation");
markFlagAsAccessed(21, "fetchImagesInViewPreallocation");
flagValue = currentProvider_->fetchImagesInViewPreallocation();
fetchImagesInViewPreallocation_ = flagValue;
@@ -452,7 +434,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(23, "fixIncorrectScrollViewStateUpdateOnAndroid");
markFlagAsAccessed(22, "fixIncorrectScrollViewStateUpdateOnAndroid");
flagValue = currentProvider_->fixIncorrectScrollViewStateUpdateOnAndroid();
fixIncorrectScrollViewStateUpdateOnAndroid_ = flagValue;
@@ -470,7 +452,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(24, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
markFlagAsAccessed(23, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact();
fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue;
@@ -488,7 +470,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(25, "fixMissedFabricStateUpdatesOnAndroid");
markFlagAsAccessed(24, "fixMissedFabricStateUpdatesOnAndroid");
flagValue = currentProvider_->fixMissedFabricStateUpdatesOnAndroid();
fixMissedFabricStateUpdatesOnAndroid_ = flagValue;
@@ -506,7 +488,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(26, "forceBatchingMountItemsOnAndroid");
markFlagAsAccessed(25, "forceBatchingMountItemsOnAndroid");
flagValue = currentProvider_->forceBatchingMountItemsOnAndroid();
forceBatchingMountItemsOnAndroid_ = flagValue;
@@ -524,7 +506,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(27, "fuseboxEnabledDebug");
markFlagAsAccessed(26, "fuseboxEnabledDebug");
flagValue = currentProvider_->fuseboxEnabledDebug();
fuseboxEnabledDebug_ = flagValue;
@@ -542,7 +524,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(28, "fuseboxEnabledRelease");
markFlagAsAccessed(27, "fuseboxEnabledRelease");
flagValue = currentProvider_->fuseboxEnabledRelease();
fuseboxEnabledRelease_ = flagValue;
@@ -560,7 +542,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(29, "initEagerTurboModulesOnNativeModulesQueueAndroid");
markFlagAsAccessed(28, "initEagerTurboModulesOnNativeModulesQueueAndroid");
flagValue = currentProvider_->initEagerTurboModulesOnNativeModulesQueueAndroid();
initEagerTurboModulesOnNativeModulesQueueAndroid_ = flagValue;
@@ -578,7 +560,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(30, "lazyAnimationCallbacks");
markFlagAsAccessed(29, "lazyAnimationCallbacks");
flagValue = currentProvider_->lazyAnimationCallbacks();
lazyAnimationCallbacks_ = flagValue;
@@ -596,7 +578,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(31, "loadVectorDrawablesOnImages");
markFlagAsAccessed(30, "loadVectorDrawablesOnImages");
flagValue = currentProvider_->loadVectorDrawablesOnImages();
loadVectorDrawablesOnImages_ = flagValue;
@@ -614,7 +596,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(32, "setAndroidLayoutDirection");
markFlagAsAccessed(31, "setAndroidLayoutDirection");
flagValue = currentProvider_->setAndroidLayoutDirection();
setAndroidLayoutDirection_ = flagValue;
@@ -632,7 +614,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(33, "traceTurboModulePromiseRejectionsOnAndroid");
markFlagAsAccessed(32, "traceTurboModulePromiseRejectionsOnAndroid");
flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid();
traceTurboModulePromiseRejectionsOnAndroid_ = flagValue;
@@ -650,7 +632,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(34, "useFabricInterop");
markFlagAsAccessed(33, "useFabricInterop");
flagValue = currentProvider_->useFabricInterop();
useFabricInterop_ = flagValue;
@@ -668,7 +650,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(35, "useImmediateExecutorInAndroidBridgeless");
markFlagAsAccessed(34, "useImmediateExecutorInAndroidBridgeless");
flagValue = currentProvider_->useImmediateExecutorInAndroidBridgeless();
useImmediateExecutorInAndroidBridgeless_ = flagValue;
@@ -686,7 +668,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(36, "useModernRuntimeScheduler");
markFlagAsAccessed(35, "useModernRuntimeScheduler");
flagValue = currentProvider_->useModernRuntimeScheduler();
useModernRuntimeScheduler_ = flagValue;
@@ -704,7 +686,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(37, "useNativeViewConfigsInBridgelessMode");
markFlagAsAccessed(36, "useNativeViewConfigsInBridgelessMode");
flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
useNativeViewConfigsInBridgelessMode_ = flagValue;
@@ -722,7 +704,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(38, "useNewReactImageViewBackgroundDrawing");
markFlagAsAccessed(37, "useNewReactImageViewBackgroundDrawing");
flagValue = currentProvider_->useNewReactImageViewBackgroundDrawing();
useNewReactImageViewBackgroundDrawing_ = flagValue;
@@ -740,7 +722,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(39, "useOptimisedViewPreallocationOnAndroid");
markFlagAsAccessed(38, "useOptimisedViewPreallocationOnAndroid");
flagValue = currentProvider_->useOptimisedViewPreallocationOnAndroid();
useOptimisedViewPreallocationOnAndroid_ = flagValue;
@@ -758,7 +740,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(40, "useRuntimeShadowNodeReferenceUpdate");
markFlagAsAccessed(39, "useRuntimeShadowNodeReferenceUpdate");
flagValue = currentProvider_->useRuntimeShadowNodeReferenceUpdate();
useRuntimeShadowNodeReferenceUpdate_ = flagValue;
@@ -776,7 +758,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(41, "useRuntimeShadowNodeReferenceUpdateOnLayout");
markFlagAsAccessed(40, "useRuntimeShadowNodeReferenceUpdateOnLayout");
flagValue = currentProvider_->useRuntimeShadowNodeReferenceUpdateOnLayout();
useRuntimeShadowNodeReferenceUpdateOnLayout_ = flagValue;
@@ -794,7 +776,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(42, "useStateAlignmentMechanism");
markFlagAsAccessed(41, "useStateAlignmentMechanism");
flagValue = currentProvider_->useStateAlignmentMechanism();
useStateAlignmentMechanism_ = flagValue;
@@ -812,7 +794,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(43, "useTurboModuleInterop");
markFlagAsAccessed(42, "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<<71e34bc8db537e0b891b1fea9ffc3475>>
* @generated SignedSource<<42259cb82f9ac5b3c0918339b45e6a2a>>
*/
/**
@@ -32,7 +32,6 @@ class ReactNativeFeatureFlagsAccessor {
ReactNativeFeatureFlagsAccessor();
bool commonTestFlag();
bool allowCollapsableChildren();
bool allowRecursiveCommitsWithSynchronousMountOnAndroid();
bool batchRenderingUpdatesInEventLoop();
bool changeOrderOfMountingInstructionsOnAndroid();
@@ -85,10 +84,9 @@ class ReactNativeFeatureFlagsAccessor {
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
bool wasOverridden_;
std::array<std::atomic<const char*>, 44> accessedFeatureFlags_;
std::array<std::atomic<const char*>, 43> accessedFeatureFlags_;
std::atomic<std::optional<bool>> commonTestFlag_;
std::atomic<std::optional<bool>> allowCollapsableChildren_;
std::atomic<std::optional<bool>> allowRecursiveCommitsWithSynchronousMountOnAndroid_;
std::atomic<std::optional<bool>> batchRenderingUpdatesInEventLoop_;
std::atomic<std::optional<bool>> changeOrderOfMountingInstructionsOnAndroid_;
@@ -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<<06d4d5356769bc25529b987aa7e0abb8>>
* @generated SignedSource<<6624485d7a7712c8243e4a00621fa10d>>
*/
/**
@@ -31,10 +31,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
return false;
}
bool allowCollapsableChildren() override {
return true;
}
bool allowRecursiveCommitsWithSynchronousMountOnAndroid() 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<<0e9a6d8770362cb0408f7b2c633eda38>>
* @generated SignedSource<<28c8387a6ed837bcfbe75da8dae74e63>>
*/
/**
@@ -26,7 +26,6 @@ class ReactNativeFeatureFlagsProvider {
virtual ~ReactNativeFeatureFlagsProvider() = default;
virtual bool commonTestFlag() = 0;
virtual bool allowCollapsableChildren() = 0;
virtual bool allowRecursiveCommitsWithSynchronousMountOnAndroid() = 0;
virtual bool batchRenderingUpdatesInEventLoop() = 0;
virtual bool changeOrderOfMountingInstructionsOnAndroid() = 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<<b64ec98268a5f4c19e3c6edaf93e7298>>
* @generated SignedSource<<aee6b808045e1f1e8f91cb3820c177d9>>
*/
/**
@@ -42,11 +42,6 @@ bool NativeReactNativeFeatureFlags::commonTestFlag(
return ReactNativeFeatureFlags::commonTestFlag();
}
bool NativeReactNativeFeatureFlags::allowCollapsableChildren(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::allowCollapsableChildren();
}
bool NativeReactNativeFeatureFlags::allowRecursiveCommitsWithSynchronousMountOnAndroid(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::allowRecursiveCommitsWithSynchronousMountOnAndroid();
@@ -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<<e96f638fecb353c9bcf98fb03e97c12d>>
* @generated SignedSource<<d06bdd9b0aea9cc9de7feceb012b70bb>>
*/
/**
@@ -37,8 +37,6 @@ class NativeReactNativeFeatureFlags
bool commonTestFlag(jsi::Runtime& runtime);
bool allowCollapsableChildren(jsi::Runtime& runtime);
bool allowRecursiveCommitsWithSynchronousMountOnAndroid(jsi::Runtime& runtime);
bool batchRenderingUpdatesInEventLoop(jsi::Runtime& runtime);
@@ -232,24 +232,16 @@ static void sliceChildShadowNodeViewPairsRecursively(
// This might not be a FormsView, or a FormsStackingContext. We let the
// differ handle removal of flattened views from the Mounting layer and
// shuffling their children around.
bool isConcreteView = false;
bool areChildrenFlattened = false;
if (ReactNativeFeatureFlags::allowCollapsableChildren()) {
bool childrenFormStackingContexts = shadowNode.getTraits().check(
ShadowNodeTraits::Trait::ChildrenFormStackingContext);
isConcreteView = childShadowNode.getTraits().check(
ShadowNodeTraits::Trait::FormsView) ||
childrenFormStackingContexts;
areChildrenFlattened =
!childShadowNode.getTraits().check(
ShadowNodeTraits::Trait::FormsStackingContext) &&
!childrenFormStackingContexts;
} else {
isConcreteView =
childShadowNode.getTraits().check(ShadowNodeTraits::Trait::FormsView);
areChildrenFlattened = !childShadowNode.getTraits().check(
ShadowNodeTraits::Trait::FormsStackingContext);
}
bool childrenFormStackingContexts = shadowNode.getTraits().check(
ShadowNodeTraits::Trait::ChildrenFormStackingContext);
bool isConcreteView =
childShadowNode.getTraits().check(ShadowNodeTraits::Trait::FormsView) ||
childrenFormStackingContexts;
bool areChildrenFlattened =
!childShadowNode.getTraits().check(
ShadowNodeTraits::Trait::FormsStackingContext) &&
!childrenFormStackingContexts;
Point storedOrigin = {};
if (areChildrenFlattened) {
storedOrigin = origin;
@@ -39,11 +39,6 @@ const testDefinitions: FeatureFlagDefinitions = {
const definitions: FeatureFlagDefinitions = {
common: {
...testDefinitions.common,
allowCollapsableChildren: {
defaultValue: true,
description:
'Enables the differentiator to understand the "collapsableChildren" prop',
},
allowRecursiveCommitsWithSynchronousMountOnAndroid: {
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<<0b57a2e853d1f2872ddf0c0b610805bb>>
* @generated SignedSource<<6896ec018143f40b7d08487fb10239d7>>
* @flow strict-local
*/
@@ -45,7 +45,6 @@ export type ReactNativeFeatureFlagsJsOnlyOverrides = Partial<ReactNativeFeatureF
export type ReactNativeFeatureFlags = {
...ReactNativeFeatureFlagsJsOnly,
commonTestFlag: Getter<boolean>,
allowCollapsableChildren: Getter<boolean>,
allowRecursiveCommitsWithSynchronousMountOnAndroid: Getter<boolean>,
batchRenderingUpdatesInEventLoop: Getter<boolean>,
changeOrderOfMountingInstructionsOnAndroid: Getter<boolean>,
@@ -154,10 +153,6 @@ export const useRefsForTextInputState: Getter<boolean> = createJavaScriptFlagGet
* Common flag for testing. Do NOT modify.
*/
export const commonTestFlag: Getter<boolean> = createNativeFlagGetter('commonTestFlag', false);
/**
* Enables the differentiator to understand the "collapsableChildren" prop
*/
export const allowCollapsableChildren: Getter<boolean> = createNativeFlagGetter('allowCollapsableChildren', true);
/**
* Adds support for recursively processing commits that mount synchronously (Android only).
*/
@@ -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<<e7852212097fb9d6e9f929b19a99e279>>
* @generated SignedSource<<8e7f7c0b5eccf4db77ab4b65a4aae313>>
* @flow strict-local
*/
@@ -24,7 +24,6 @@ import * as TurboModuleRegistry from '../../../../Libraries/TurboModule/TurboMod
export interface Spec extends TurboModule {
+commonTestFlag?: () => boolean;
+allowCollapsableChildren?: () => boolean;
+allowRecursiveCommitsWithSynchronousMountOnAndroid?: () => boolean;
+batchRenderingUpdatesInEventLoop?: () => boolean;
+changeOrderOfMountingInstructionsOnAndroid?: () => boolean;