mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Migrate enableEagerRootViewAttachment to ReactNativeFeatureFlags (#45604)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45604 Migrate enableEagerRootViewAttachment to ReactNativeFeatureFlags changelog: [internal] internal Reviewed By: NickGerleman Differential Revision: D60022934 fbshipit-source-id: 1a1c3a030d8673dd13c7c87091210dfe8fe5a089
This commit is contained in:
committed by
Facebook GitHub Bot
parent
5386ecea80
commit
34fb23b08c
@@ -1981,7 +1981,6 @@ public class com/facebook/react/config/ReactFeatureFlags {
|
||||
public static field dispatchPointerEvents Z
|
||||
public static field enableBridgelessArchitecture Z
|
||||
public static field enableCppPropsIteratorSetter Z
|
||||
public static field enableEagerRootViewAttachment Z
|
||||
public static field enableFabricLogs Z
|
||||
public static field enableFabricRenderer Z
|
||||
public static field enableViewRecycling Z
|
||||
|
||||
+2
-1
@@ -49,6 +49,7 @@ import com.facebook.react.bridge.WritableMap;
|
||||
import com.facebook.react.bridge.WritableNativeMap;
|
||||
import com.facebook.react.common.annotations.VisibleForTesting;
|
||||
import com.facebook.react.config.ReactFeatureFlags;
|
||||
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags;
|
||||
import com.facebook.react.modules.appregistry.AppRegistry;
|
||||
import com.facebook.react.modules.deviceinfo.DeviceInfoModule;
|
||||
import com.facebook.react.uimanager.DisplayMetricsHolder;
|
||||
@@ -478,7 +479,7 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
|
||||
mReactInstanceManager.createReactContextInBackground();
|
||||
// if in this experiment, we initialize the root earlier in startReactApplication
|
||||
// instead of waiting for the initial measure
|
||||
if (ReactFeatureFlags.enableEagerRootViewAttachment) {
|
||||
if (ReactNativeFeatureFlags.enableEagerRootViewAttachment()) {
|
||||
if (!mWasMeasured) {
|
||||
// Ideally, those values will be used by default, but we only update them here to scope
|
||||
// this change to `enableEagerRootViewAttachment` experiment.
|
||||
|
||||
-3
@@ -55,9 +55,6 @@ public class ReactFeatureFlags {
|
||||
/** This feature flag enables logs for Fabric */
|
||||
public static boolean enableFabricLogs = false;
|
||||
|
||||
/** Feature flag to configure eager attachment of the root view/initialisation of the JS code */
|
||||
public static boolean enableEagerRootViewAttachment = false;
|
||||
|
||||
public static boolean dispatchPointerEvents = false;
|
||||
|
||||
/**
|
||||
|
||||
+7
-1
@@ -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<<ca939ab47fa68fbb5acf5ea34481def9>>
|
||||
* @generated SignedSource<<fe2b592db8339808bf8ab727594ec6e0>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -82,6 +82,12 @@ public object ReactNativeFeatureFlags {
|
||||
@JvmStatic
|
||||
public fun enableCleanTextInputYogaNode(): Boolean = accessor.enableCleanTextInputYogaNode()
|
||||
|
||||
/**
|
||||
* Feature flag to configure eager attachment of the root view/initialisation of the JS code.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun enableEagerRootViewAttachment(): Boolean = accessor.enableEagerRootViewAttachment()
|
||||
|
||||
/**
|
||||
* When the app is completely migrated to Fabric, set this flag to true to disable parts of Paper infrastructure that are not needed anymore but consume memory and CPU. Specifically, UIViewOperationQueue and EventDispatcherImpl will no longer work as they will not subscribe to ReactChoreographer for updates.
|
||||
*/
|
||||
|
||||
+11
-1
@@ -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<<2a8d5ca8a0ac46b4d3177cb8b12ad7ac>>
|
||||
* @generated SignedSource<<0341c3c0f1eb484c305ee8732d6fd26f>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -29,6 +29,7 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
|
||||
private var destroyFabricSurfacesInReactInstanceManagerCache: Boolean? = null
|
||||
private var enableAlignItemsBaselineOnFabricIOSCache: Boolean? = null
|
||||
private var enableCleanTextInputYogaNodeCache: Boolean? = null
|
||||
private var enableEagerRootViewAttachmentCache: Boolean? = null
|
||||
private var enableFabricRendererExclusivelyCache: Boolean? = null
|
||||
private var enableGranularShadowTreeStateReconciliationCache: Boolean? = null
|
||||
private var enableLongTaskAPICache: Boolean? = null
|
||||
@@ -139,6 +140,15 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableEagerRootViewAttachment(): Boolean {
|
||||
var cached = enableEagerRootViewAttachmentCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.enableEagerRootViewAttachment()
|
||||
enableEagerRootViewAttachmentCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableFabricRendererExclusively(): Boolean {
|
||||
var cached = enableFabricRendererExclusivelyCache
|
||||
if (cached == null) {
|
||||
|
||||
+3
-1
@@ -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<<aaf205098eaac9171aa15bc8f7bda805>>
|
||||
* @generated SignedSource<<82a0b829cbc75d864dba1ae4c65b2036>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -46,6 +46,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableCleanTextInputYogaNode(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableEagerRootViewAttachment(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableFabricRendererExclusively(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableGranularShadowTreeStateReconciliation(): Boolean
|
||||
|
||||
+3
-1
@@ -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<<fc363737bfe42515306043b836820f3f>>
|
||||
* @generated SignedSource<<f028022c11b7dcfdfdd4fc8e3951aefe>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -41,6 +41,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
||||
|
||||
override fun enableCleanTextInputYogaNode(): Boolean = false
|
||||
|
||||
override fun enableEagerRootViewAttachment(): Boolean = false
|
||||
|
||||
override fun enableFabricRendererExclusively(): Boolean = false
|
||||
|
||||
override fun enableGranularShadowTreeStateReconciliation(): Boolean = false
|
||||
|
||||
+12
-1
@@ -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<<82f6d4eda4011bee81810af366f5d677>>
|
||||
* @generated SignedSource<<833b024aec14737d59abd02092fcfa11>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -33,6 +33,7 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
||||
private var destroyFabricSurfacesInReactInstanceManagerCache: Boolean? = null
|
||||
private var enableAlignItemsBaselineOnFabricIOSCache: Boolean? = null
|
||||
private var enableCleanTextInputYogaNodeCache: Boolean? = null
|
||||
private var enableEagerRootViewAttachmentCache: Boolean? = null
|
||||
private var enableFabricRendererExclusivelyCache: Boolean? = null
|
||||
private var enableGranularShadowTreeStateReconciliationCache: Boolean? = null
|
||||
private var enableLongTaskAPICache: Boolean? = null
|
||||
@@ -152,6 +153,16 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableEagerRootViewAttachment(): Boolean {
|
||||
var cached = enableEagerRootViewAttachmentCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.enableEagerRootViewAttachment()
|
||||
accessedFeatureFlags.add("enableEagerRootViewAttachment")
|
||||
enableEagerRootViewAttachmentCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableFabricRendererExclusively(): Boolean {
|
||||
var cached = enableFabricRendererExclusivelyCache
|
||||
if (cached == null) {
|
||||
|
||||
+3
-1
@@ -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<<ece587d5e6643fb906cfee816824f224>>
|
||||
* @generated SignedSource<<69c396cad1d473c5793df517fa183f95>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -41,6 +41,8 @@ public interface ReactNativeFeatureFlagsProvider {
|
||||
|
||||
@DoNotStrip public fun enableCleanTextInputYogaNode(): Boolean
|
||||
|
||||
@DoNotStrip public fun enableEagerRootViewAttachment(): Boolean
|
||||
|
||||
@DoNotStrip public fun enableFabricRendererExclusively(): Boolean
|
||||
|
||||
@DoNotStrip public fun enableGranularShadowTreeStateReconciliation(): Boolean
|
||||
|
||||
+15
-1
@@ -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<<7c14f956fd20226acfb532d806c6eb7a>>
|
||||
* @generated SignedSource<<e1a5c4bfa72b16c95464432e449b4ba8>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -93,6 +93,12 @@ class ReactNativeFeatureFlagsProviderHolder
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool enableEagerRootViewAttachment() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableEagerRootViewAttachment");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool enableFabricRendererExclusively() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableFabricRendererExclusively");
|
||||
@@ -310,6 +316,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableCleanTextInputYogaNode(
|
||||
return ReactNativeFeatureFlags::enableCleanTextInputYogaNode();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::enableEagerRootViewAttachment(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::enableEagerRootViewAttachment();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::enableFabricRendererExclusively(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::enableFabricRendererExclusively();
|
||||
@@ -494,6 +505,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
||||
makeNativeMethod(
|
||||
"enableCleanTextInputYogaNode",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableCleanTextInputYogaNode),
|
||||
makeNativeMethod(
|
||||
"enableEagerRootViewAttachment",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableEagerRootViewAttachment),
|
||||
makeNativeMethod(
|
||||
"enableFabricRendererExclusively",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableFabricRendererExclusively),
|
||||
|
||||
+4
-1
@@ -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<<f06779455d65f78f561eaca745262a99>>
|
||||
* @generated SignedSource<<1722d711f77b3f47cc3c665fce026b5a>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -57,6 +57,9 @@ class JReactNativeFeatureFlagsCxxInterop
|
||||
static bool enableCleanTextInputYogaNode(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool enableEagerRootViewAttachment(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool enableFabricRendererExclusively(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.facebook.react.bridge.ReactTestHelper
|
||||
import com.facebook.react.bridge.WritableArray
|
||||
import com.facebook.react.bridge.WritableMap
|
||||
import com.facebook.react.common.SystemClock
|
||||
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsForTests
|
||||
import com.facebook.react.uimanager.DisplayMetricsHolder
|
||||
import com.facebook.react.uimanager.UIManagerModule
|
||||
import com.facebook.react.uimanager.events.Event
|
||||
@@ -56,6 +57,8 @@ class RootViewTest {
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
ReactNativeFeatureFlagsForTests.setUp()
|
||||
|
||||
arguments = Mockito.mockStatic(Arguments::class.java)
|
||||
arguments.`when`<WritableArray> { Arguments.createArray() }.thenAnswer { JavaOnlyArray() }
|
||||
arguments.`when`<WritableMap> { Arguments.createMap() }.thenAnswer { JavaOnlyMap() }
|
||||
|
||||
@@ -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<<bab53ba585938b3bf458dbe0874931f8>>
|
||||
* @generated SignedSource<<459682475d0fcefcdfce6ebeb7d1db19>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -57,6 +57,10 @@ bool ReactNativeFeatureFlags::enableCleanTextInputYogaNode() {
|
||||
return getAccessor().enableCleanTextInputYogaNode();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::enableEagerRootViewAttachment() {
|
||||
return getAccessor().enableEagerRootViewAttachment();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::enableFabricRendererExclusively() {
|
||||
return getAccessor().enableFabricRendererExclusively();
|
||||
}
|
||||
|
||||
@@ -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<<55d6c0f7ab8abe8411194235ab362cd2>>
|
||||
* @generated SignedSource<<83a6879d27dd7dbcb181f30c3b6f0225>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -82,6 +82,11 @@ class ReactNativeFeatureFlags {
|
||||
*/
|
||||
RN_EXPORT static bool enableCleanTextInputYogaNode();
|
||||
|
||||
/**
|
||||
* Feature flag to configure eager attachment of the root view/initialisation of the JS code.
|
||||
*/
|
||||
RN_EXPORT static bool enableEagerRootViewAttachment();
|
||||
|
||||
/**
|
||||
* When the app is completely migrated to Fabric, set this flag to true to disable parts of Paper infrastructure that are not needed anymore but consume memory and CPU. Specifically, UIViewOperationQueue and EventDispatcherImpl will no longer work as they will not subscribe to ReactChoreographer for updates.
|
||||
*/
|
||||
|
||||
+47
-29
@@ -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<<b1d1358f4e01ac76eefdbd91610c0c54>>
|
||||
* @generated SignedSource<<35dd53999023a10892fa311732b995f5>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -191,6 +191,24 @@ bool ReactNativeFeatureFlagsAccessor::enableCleanTextInputYogaNode() {
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::enableEagerRootViewAttachment() {
|
||||
auto flagValue = enableEagerRootViewAttachment_.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(9, "enableEagerRootViewAttachment");
|
||||
|
||||
flagValue = currentProvider_->enableEagerRootViewAttachment();
|
||||
enableEagerRootViewAttachment_ = flagValue;
|
||||
}
|
||||
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::enableFabricRendererExclusively() {
|
||||
auto flagValue = enableFabricRendererExclusively_.load();
|
||||
|
||||
@@ -200,7 +218,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(9, "enableFabricRendererExclusively");
|
||||
markFlagAsAccessed(10, "enableFabricRendererExclusively");
|
||||
|
||||
flagValue = currentProvider_->enableFabricRendererExclusively();
|
||||
enableFabricRendererExclusively_ = flagValue;
|
||||
@@ -218,7 +236,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(10, "enableGranularShadowTreeStateReconciliation");
|
||||
markFlagAsAccessed(11, "enableGranularShadowTreeStateReconciliation");
|
||||
|
||||
flagValue = currentProvider_->enableGranularShadowTreeStateReconciliation();
|
||||
enableGranularShadowTreeStateReconciliation_ = flagValue;
|
||||
@@ -236,7 +254,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(11, "enableLongTaskAPI");
|
||||
markFlagAsAccessed(12, "enableLongTaskAPI");
|
||||
|
||||
flagValue = currentProvider_->enableLongTaskAPI();
|
||||
enableLongTaskAPI_ = flagValue;
|
||||
@@ -254,7 +272,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(12, "enableMicrotasks");
|
||||
markFlagAsAccessed(13, "enableMicrotasks");
|
||||
|
||||
flagValue = currentProvider_->enableMicrotasks();
|
||||
enableMicrotasks_ = flagValue;
|
||||
@@ -272,7 +290,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(13, "enablePropsUpdateReconciliationAndroid");
|
||||
markFlagAsAccessed(14, "enablePropsUpdateReconciliationAndroid");
|
||||
|
||||
flagValue = currentProvider_->enablePropsUpdateReconciliationAndroid();
|
||||
enablePropsUpdateReconciliationAndroid_ = flagValue;
|
||||
@@ -290,7 +308,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(14, "enableReportEventPaintTime");
|
||||
markFlagAsAccessed(15, "enableReportEventPaintTime");
|
||||
|
||||
flagValue = currentProvider_->enableReportEventPaintTime();
|
||||
enableReportEventPaintTime_ = flagValue;
|
||||
@@ -308,7 +326,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(15, "enableSynchronousStateUpdates");
|
||||
markFlagAsAccessed(16, "enableSynchronousStateUpdates");
|
||||
|
||||
flagValue = currentProvider_->enableSynchronousStateUpdates();
|
||||
enableSynchronousStateUpdates_ = flagValue;
|
||||
@@ -326,7 +344,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(16, "enableUIConsistency");
|
||||
markFlagAsAccessed(17, "enableUIConsistency");
|
||||
|
||||
flagValue = currentProvider_->enableUIConsistency();
|
||||
enableUIConsistency_ = flagValue;
|
||||
@@ -344,7 +362,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(17, "excludeYogaFromRawProps");
|
||||
markFlagAsAccessed(18, "excludeYogaFromRawProps");
|
||||
|
||||
flagValue = currentProvider_->excludeYogaFromRawProps();
|
||||
excludeYogaFromRawProps_ = flagValue;
|
||||
@@ -362,7 +380,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(18, "fetchImagesInViewPreallocation");
|
||||
markFlagAsAccessed(19, "fetchImagesInViewPreallocation");
|
||||
|
||||
flagValue = currentProvider_->fetchImagesInViewPreallocation();
|
||||
fetchImagesInViewPreallocation_ = flagValue;
|
||||
@@ -380,7 +398,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(19, "fixIncorrectScrollViewStateUpdateOnAndroid");
|
||||
markFlagAsAccessed(20, "fixIncorrectScrollViewStateUpdateOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->fixIncorrectScrollViewStateUpdateOnAndroid();
|
||||
fixIncorrectScrollViewStateUpdateOnAndroid_ = flagValue;
|
||||
@@ -398,7 +416,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(20, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
|
||||
markFlagAsAccessed(21, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
|
||||
|
||||
flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact();
|
||||
fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue;
|
||||
@@ -416,7 +434,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(21, "fixMissedFabricStateUpdatesOnAndroid");
|
||||
markFlagAsAccessed(22, "fixMissedFabricStateUpdatesOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->fixMissedFabricStateUpdatesOnAndroid();
|
||||
fixMissedFabricStateUpdatesOnAndroid_ = flagValue;
|
||||
@@ -434,7 +452,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(22, "forceBatchingMountItemsOnAndroid");
|
||||
markFlagAsAccessed(23, "forceBatchingMountItemsOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->forceBatchingMountItemsOnAndroid();
|
||||
forceBatchingMountItemsOnAndroid_ = flagValue;
|
||||
@@ -452,7 +470,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(23, "fuseboxEnabledDebug");
|
||||
markFlagAsAccessed(24, "fuseboxEnabledDebug");
|
||||
|
||||
flagValue = currentProvider_->fuseboxEnabledDebug();
|
||||
fuseboxEnabledDebug_ = flagValue;
|
||||
@@ -470,7 +488,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(24, "fuseboxEnabledRelease");
|
||||
markFlagAsAccessed(25, "fuseboxEnabledRelease");
|
||||
|
||||
flagValue = currentProvider_->fuseboxEnabledRelease();
|
||||
fuseboxEnabledRelease_ = flagValue;
|
||||
@@ -488,7 +506,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(25, "initEagerTurboModulesOnNativeModulesQueueAndroid");
|
||||
markFlagAsAccessed(26, "initEagerTurboModulesOnNativeModulesQueueAndroid");
|
||||
|
||||
flagValue = currentProvider_->initEagerTurboModulesOnNativeModulesQueueAndroid();
|
||||
initEagerTurboModulesOnNativeModulesQueueAndroid_ = flagValue;
|
||||
@@ -506,7 +524,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(26, "lazyAnimationCallbacks");
|
||||
markFlagAsAccessed(27, "lazyAnimationCallbacks");
|
||||
|
||||
flagValue = currentProvider_->lazyAnimationCallbacks();
|
||||
lazyAnimationCallbacks_ = flagValue;
|
||||
@@ -524,7 +542,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(27, "loadVectorDrawablesOnImages");
|
||||
markFlagAsAccessed(28, "loadVectorDrawablesOnImages");
|
||||
|
||||
flagValue = currentProvider_->loadVectorDrawablesOnImages();
|
||||
loadVectorDrawablesOnImages_ = flagValue;
|
||||
@@ -542,7 +560,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(28, "setAndroidLayoutDirection");
|
||||
markFlagAsAccessed(29, "setAndroidLayoutDirection");
|
||||
|
||||
flagValue = currentProvider_->setAndroidLayoutDirection();
|
||||
setAndroidLayoutDirection_ = flagValue;
|
||||
@@ -560,7 +578,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(29, "useImmediateExecutorInAndroidBridgeless");
|
||||
markFlagAsAccessed(30, "useImmediateExecutorInAndroidBridgeless");
|
||||
|
||||
flagValue = currentProvider_->useImmediateExecutorInAndroidBridgeless();
|
||||
useImmediateExecutorInAndroidBridgeless_ = flagValue;
|
||||
@@ -578,7 +596,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(30, "useModernRuntimeScheduler");
|
||||
markFlagAsAccessed(31, "useModernRuntimeScheduler");
|
||||
|
||||
flagValue = currentProvider_->useModernRuntimeScheduler();
|
||||
useModernRuntimeScheduler_ = flagValue;
|
||||
@@ -596,7 +614,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(31, "useNativeViewConfigsInBridgelessMode");
|
||||
markFlagAsAccessed(32, "useNativeViewConfigsInBridgelessMode");
|
||||
|
||||
flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
|
||||
useNativeViewConfigsInBridgelessMode_ = flagValue;
|
||||
@@ -614,7 +632,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(32, "useNewReactImageViewBackgroundDrawing");
|
||||
markFlagAsAccessed(33, "useNewReactImageViewBackgroundDrawing");
|
||||
|
||||
flagValue = currentProvider_->useNewReactImageViewBackgroundDrawing();
|
||||
useNewReactImageViewBackgroundDrawing_ = flagValue;
|
||||
@@ -632,7 +650,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(33, "useOptimisedViewPreallocationOnAndroid");
|
||||
markFlagAsAccessed(34, "useOptimisedViewPreallocationOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->useOptimisedViewPreallocationOnAndroid();
|
||||
useOptimisedViewPreallocationOnAndroid_ = flagValue;
|
||||
@@ -650,7 +668,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(34, "useRuntimeShadowNodeReferenceUpdate");
|
||||
markFlagAsAccessed(35, "useRuntimeShadowNodeReferenceUpdate");
|
||||
|
||||
flagValue = currentProvider_->useRuntimeShadowNodeReferenceUpdate();
|
||||
useRuntimeShadowNodeReferenceUpdate_ = flagValue;
|
||||
@@ -668,7 +686,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(35, "useRuntimeShadowNodeReferenceUpdateOnLayout");
|
||||
markFlagAsAccessed(36, "useRuntimeShadowNodeReferenceUpdateOnLayout");
|
||||
|
||||
flagValue = currentProvider_->useRuntimeShadowNodeReferenceUpdateOnLayout();
|
||||
useRuntimeShadowNodeReferenceUpdateOnLayout_ = flagValue;
|
||||
@@ -686,7 +704,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(36, "useStateAlignmentMechanism");
|
||||
markFlagAsAccessed(37, "useStateAlignmentMechanism");
|
||||
|
||||
flagValue = currentProvider_->useStateAlignmentMechanism();
|
||||
useStateAlignmentMechanism_ = flagValue;
|
||||
|
||||
+4
-2
@@ -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<<c1230df8d1603fb6738dd634ab041a02>>
|
||||
* @generated SignedSource<<9a44283006da4b6f6700dc2aa4520bc7>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -40,6 +40,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
bool destroyFabricSurfacesInReactInstanceManager();
|
||||
bool enableAlignItemsBaselineOnFabricIOS();
|
||||
bool enableCleanTextInputYogaNode();
|
||||
bool enableEagerRootViewAttachment();
|
||||
bool enableFabricRendererExclusively();
|
||||
bool enableGranularShadowTreeStateReconciliation();
|
||||
bool enableLongTaskAPI();
|
||||
@@ -78,7 +79,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
|
||||
bool wasOverridden_;
|
||||
|
||||
std::array<std::atomic<const char*>, 37> accessedFeatureFlags_;
|
||||
std::array<std::atomic<const char*>, 38> accessedFeatureFlags_;
|
||||
|
||||
std::atomic<std::optional<bool>> commonTestFlag_;
|
||||
std::atomic<std::optional<bool>> allowCollapsableChildren_;
|
||||
@@ -89,6 +90,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::atomic<std::optional<bool>> destroyFabricSurfacesInReactInstanceManager_;
|
||||
std::atomic<std::optional<bool>> enableAlignItemsBaselineOnFabricIOS_;
|
||||
std::atomic<std::optional<bool>> enableCleanTextInputYogaNode_;
|
||||
std::atomic<std::optional<bool>> enableEagerRootViewAttachment_;
|
||||
std::atomic<std::optional<bool>> enableFabricRendererExclusively_;
|
||||
std::atomic<std::optional<bool>> enableGranularShadowTreeStateReconciliation_;
|
||||
std::atomic<std::optional<bool>> enableLongTaskAPI_;
|
||||
|
||||
+5
-1
@@ -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<<c849c35ad2b73c7c36017007eaee2851>>
|
||||
* @generated SignedSource<<8220d7b8c1eb4384f50cfc78c2d81fcf>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -63,6 +63,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool enableEagerRootViewAttachment() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool enableFabricRendererExclusively() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
+2
-1
@@ -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<<48be14c9be6da39c4acbf449d9ec8741>>
|
||||
* @generated SignedSource<<23af20797f2656d3acc95b65d394ab37>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -34,6 +34,7 @@ class ReactNativeFeatureFlagsProvider {
|
||||
virtual bool destroyFabricSurfacesInReactInstanceManager() = 0;
|
||||
virtual bool enableAlignItemsBaselineOnFabricIOS() = 0;
|
||||
virtual bool enableCleanTextInputYogaNode() = 0;
|
||||
virtual bool enableEagerRootViewAttachment() = 0;
|
||||
virtual bool enableFabricRendererExclusively() = 0;
|
||||
virtual bool enableGranularShadowTreeStateReconciliation() = 0;
|
||||
virtual bool enableLongTaskAPI() = 0;
|
||||
|
||||
+6
-1
@@ -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<<c3317cfbf03b60568e509dccc4cdacde>>
|
||||
* @generated SignedSource<<ec311048193fe779eb5a60e1ffc85080>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -82,6 +82,11 @@ bool NativeReactNativeFeatureFlags::enableCleanTextInputYogaNode(
|
||||
return ReactNativeFeatureFlags::enableCleanTextInputYogaNode();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::enableEagerRootViewAttachment(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::enableEagerRootViewAttachment();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::enableFabricRendererExclusively(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::enableFabricRendererExclusively();
|
||||
|
||||
+3
-1
@@ -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<<e79765ccb9d4b2d46c428b09d65ac12c>>
|
||||
* @generated SignedSource<<0ccdff52b79d102449efeb684b1d5fac>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -53,6 +53,8 @@ class NativeReactNativeFeatureFlags
|
||||
|
||||
bool enableCleanTextInputYogaNode(jsi::Runtime& runtime);
|
||||
|
||||
bool enableEagerRootViewAttachment(jsi::Runtime& runtime);
|
||||
|
||||
bool enableFabricRendererExclusively(jsi::Runtime& runtime);
|
||||
|
||||
bool enableGranularShadowTreeStateReconciliation(jsi::Runtime& runtime);
|
||||
|
||||
@@ -78,6 +78,11 @@ const definitions: FeatureFlagDefinitions = {
|
||||
defaultValue: false,
|
||||
description: 'Clean yoga node when <TextInput /> does not change.',
|
||||
},
|
||||
enableEagerRootViewAttachment: {
|
||||
defaultValue: false,
|
||||
description:
|
||||
'Feature flag to configure eager attachment of the root view/initialisation of the JS code.',
|
||||
},
|
||||
enableFabricRendererExclusively: {
|
||||
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<<46ea8a3a51ac64342484cc230727fca3>>
|
||||
* @generated SignedSource<<5d31de6fd08ec57d3c28023121413d7d>>
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
@@ -53,6 +53,7 @@ export type ReactNativeFeatureFlags = {
|
||||
destroyFabricSurfacesInReactInstanceManager: Getter<boolean>,
|
||||
enableAlignItemsBaselineOnFabricIOS: Getter<boolean>,
|
||||
enableCleanTextInputYogaNode: Getter<boolean>,
|
||||
enableEagerRootViewAttachment: Getter<boolean>,
|
||||
enableFabricRendererExclusively: Getter<boolean>,
|
||||
enableGranularShadowTreeStateReconciliation: Getter<boolean>,
|
||||
enableLongTaskAPI: Getter<boolean>,
|
||||
@@ -179,6 +180,10 @@ export const enableAlignItemsBaselineOnFabricIOS: Getter<boolean> = createNative
|
||||
* Clean yoga node when <TextInput /> does not change.
|
||||
*/
|
||||
export const enableCleanTextInputYogaNode: Getter<boolean> = createNativeFlagGetter('enableCleanTextInputYogaNode', false);
|
||||
/**
|
||||
* Feature flag to configure eager attachment of the root view/initialisation of the JS code.
|
||||
*/
|
||||
export const enableEagerRootViewAttachment: Getter<boolean> = createNativeFlagGetter('enableEagerRootViewAttachment', false);
|
||||
/**
|
||||
* When the app is completely migrated to Fabric, set this flag to true to disable parts of Paper infrastructure that are not needed anymore but consume memory and CPU. Specifically, UIViewOperationQueue and EventDispatcherImpl will no longer work as they will not subscribe to ReactChoreographer for updates.
|
||||
*/
|
||||
|
||||
+2
-1
@@ -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<<b190bdb77d71a851ab40661eedccac05>>
|
||||
* @generated SignedSource<<1b5138c76e8bf814bc85340c9a734744>>
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
@@ -32,6 +32,7 @@ export interface Spec extends TurboModule {
|
||||
+destroyFabricSurfacesInReactInstanceManager?: () => boolean;
|
||||
+enableAlignItemsBaselineOnFabricIOS?: () => boolean;
|
||||
+enableCleanTextInputYogaNode?: () => boolean;
|
||||
+enableEagerRootViewAttachment?: () => boolean;
|
||||
+enableFabricRendererExclusively?: () => boolean;
|
||||
+enableGranularShadowTreeStateReconciliation?: () => boolean;
|
||||
+enableLongTaskAPI?: () => boolean;
|
||||
|
||||
Reference in New Issue
Block a user