mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Clean up enableUIConsistency feature flag (#50484)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/50484 Changelog: [internal] This cleans up the `enableUIConsistency` feature flag (shipping the feature) after we verified it was stable and performance in production. Reviewed By: yungsters Differential Revision: D72387602 fbshipit-source-id: 11d225d962f7e3a47e858d039b7fd5c70a6cadfd
This commit is contained in:
committed by
Facebook GitHub Bot
parent
76cfce768d
commit
150b1ccaba
+1
-7
@@ -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<<8bc15cf2356e248a791c68f134c39a2f>>
|
||||
* @generated SignedSource<<0274d00d328b83c1c653737200ce9b5b>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -162,12 +162,6 @@ public object ReactNativeFeatureFlags {
|
||||
@JvmStatic
|
||||
public fun enableSynchronousStateUpdates(): Boolean = accessor.enableSynchronousStateUpdates()
|
||||
|
||||
/**
|
||||
* Ensures that JavaScript always has a consistent view of the state of the UI (e.g.: commits done in other threads are not immediately propagated to JS during its execution).
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun enableUIConsistency(): Boolean = accessor.enableUIConsistency()
|
||||
|
||||
/**
|
||||
* Enables View Culling: as soon as a view goes off screen, it can be reused anywhere in the UI and pieced together with other items to create new UI elements.
|
||||
*/
|
||||
|
||||
+1
-11
@@ -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<<92f9ae1833854159495119059d39bba9>>
|
||||
* @generated SignedSource<<7b5f542e6fab922f017e2b037b822293>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -42,7 +42,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
||||
private var enablePropsUpdateReconciliationAndroidCache: Boolean? = null
|
||||
private var enableReportEventPaintTimeCache: Boolean? = null
|
||||
private var enableSynchronousStateUpdatesCache: Boolean? = null
|
||||
private var enableUIConsistencyCache: Boolean? = null
|
||||
private var enableViewCullingCache: Boolean? = null
|
||||
private var enableViewRecyclingCache: Boolean? = null
|
||||
private var enableViewRecyclingForTextCache: Boolean? = null
|
||||
@@ -261,15 +260,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableUIConsistency(): Boolean {
|
||||
var cached = enableUIConsistencyCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.enableUIConsistency()
|
||||
enableUIConsistencyCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableViewCulling(): Boolean {
|
||||
var cached = enableViewCullingCache
|
||||
if (cached == null) {
|
||||
|
||||
+1
-3
@@ -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<<af0b3a715e7c2f3059b7e42fc6ccc337>>
|
||||
* @generated SignedSource<<475a2296ff585195bfddf0483238f50b>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -72,8 +72,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableSynchronousStateUpdates(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableUIConsistency(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableViewCulling(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableViewRecycling(): Boolean
|
||||
|
||||
+1
-3
@@ -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<<b8e277be7a521cbc3c4034d127af0a8a>>
|
||||
* @generated SignedSource<<74ff9aa9087574e9d54a57eadb084774>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -67,8 +67,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
||||
|
||||
override fun enableSynchronousStateUpdates(): Boolean = false
|
||||
|
||||
override fun enableUIConsistency(): Boolean = false
|
||||
|
||||
override fun enableViewCulling(): Boolean = false
|
||||
|
||||
override fun enableViewRecycling(): Boolean = false
|
||||
|
||||
+1
-12
@@ -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<<fc91518eced3e23036fd853ca3145ec3>>
|
||||
* @generated SignedSource<<e14b4058fd297105c518a2da4672cfb6>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -46,7 +46,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
||||
private var enablePropsUpdateReconciliationAndroidCache: Boolean? = null
|
||||
private var enableReportEventPaintTimeCache: Boolean? = null
|
||||
private var enableSynchronousStateUpdatesCache: Boolean? = null
|
||||
private var enableUIConsistencyCache: Boolean? = null
|
||||
private var enableViewCullingCache: Boolean? = null
|
||||
private var enableViewRecyclingCache: Boolean? = null
|
||||
private var enableViewRecyclingForTextCache: Boolean? = null
|
||||
@@ -287,16 +286,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableUIConsistency(): Boolean {
|
||||
var cached = enableUIConsistencyCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.enableUIConsistency()
|
||||
accessedFeatureFlags.add("enableUIConsistency")
|
||||
enableUIConsistencyCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableViewCulling(): Boolean {
|
||||
var cached = enableViewCullingCache
|
||||
if (cached == null) {
|
||||
|
||||
+1
-3
@@ -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<<d094e8d5d6d4fdc6de0eb5e7c3677ef6>>
|
||||
* @generated SignedSource<<db6135bdc1d847d4f112850b806dd3f1>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -67,8 +67,6 @@ public interface ReactNativeFeatureFlagsProvider {
|
||||
|
||||
@DoNotStrip public fun enableSynchronousStateUpdates(): Boolean
|
||||
|
||||
@DoNotStrip public fun enableUIConsistency(): Boolean
|
||||
|
||||
@DoNotStrip public fun enableViewCulling(): Boolean
|
||||
|
||||
@DoNotStrip public fun enableViewRecycling(): Boolean
|
||||
|
||||
+1
-15
@@ -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<<34180cac91373696c9d55316b9faf66c>>
|
||||
* @generated SignedSource<<c9710a7f21cd1652bc03c6467a903ee2>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -171,12 +171,6 @@ class ReactNativeFeatureFlagsJavaProvider
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool enableUIConsistency() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableUIConsistency");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool enableViewCulling() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableViewCulling");
|
||||
@@ -405,11 +399,6 @@ bool JReactNativeFeatureFlagsCxxInterop::enableSynchronousStateUpdates(
|
||||
return ReactNativeFeatureFlags::enableSynchronousStateUpdates();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::enableUIConsistency(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::enableUIConsistency();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::enableViewCulling(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::enableViewCulling();
|
||||
@@ -602,9 +591,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
||||
makeNativeMethod(
|
||||
"enableSynchronousStateUpdates",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableSynchronousStateUpdates),
|
||||
makeNativeMethod(
|
||||
"enableUIConsistency",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableUIConsistency),
|
||||
makeNativeMethod(
|
||||
"enableViewCulling",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableViewCulling),
|
||||
|
||||
+1
-4
@@ -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<<b73b48dcf930c8d45ff48fbebe5881f2>>
|
||||
* @generated SignedSource<<af66ae8bc9ed3d7c255d027be6fec28e>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -96,9 +96,6 @@ class JReactNativeFeatureFlagsCxxInterop
|
||||
static bool enableSynchronousStateUpdates(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool enableUIConsistency(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool enableViewCulling(
|
||||
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<<637a883106342d65133f54a8e931a5d4>>
|
||||
* @generated SignedSource<<1d2da1e23d32515f9135c9361975e424>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -114,10 +114,6 @@ bool ReactNativeFeatureFlags::enableSynchronousStateUpdates() {
|
||||
return getAccessor().enableSynchronousStateUpdates();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::enableUIConsistency() {
|
||||
return getAccessor().enableUIConsistency();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::enableViewCulling() {
|
||||
return getAccessor().enableViewCulling();
|
||||
}
|
||||
|
||||
@@ -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<<881026a6a7c333595552737f29539b79>>
|
||||
* @generated SignedSource<<f898916fad826270649a0eb84719bc80>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -149,11 +149,6 @@ class ReactNativeFeatureFlags {
|
||||
*/
|
||||
RN_EXPORT static bool enableSynchronousStateUpdates();
|
||||
|
||||
/**
|
||||
* Ensures that JavaScript always has a consistent view of the state of the UI (e.g.: commits done in other threads are not immediately propagated to JS during its execution).
|
||||
*/
|
||||
RN_EXPORT static bool enableUIConsistency();
|
||||
|
||||
/**
|
||||
* Enables View Culling: as soon as a view goes off screen, it can be reused anywhere in the UI and pieced together with other items to create new UI elements.
|
||||
*/
|
||||
|
||||
+20
-38
@@ -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<<f830c2d7a18fc8ec2e58f753c556d552>>
|
||||
* @generated SignedSource<<9a854560b5b7081324d61fd1e52e05d0>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -425,24 +425,6 @@ bool ReactNativeFeatureFlagsAccessor::enableSynchronousStateUpdates() {
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::enableUIConsistency() {
|
||||
auto flagValue = enableUIConsistency_.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(22, "enableUIConsistency");
|
||||
|
||||
flagValue = currentProvider_->enableUIConsistency();
|
||||
enableUIConsistency_ = flagValue;
|
||||
}
|
||||
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::enableViewCulling() {
|
||||
auto flagValue = enableViewCulling_.load();
|
||||
|
||||
@@ -452,7 +434,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewCulling() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(23, "enableViewCulling");
|
||||
markFlagAsAccessed(22, "enableViewCulling");
|
||||
|
||||
flagValue = currentProvider_->enableViewCulling();
|
||||
enableViewCulling_ = flagValue;
|
||||
@@ -470,7 +452,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(24, "enableViewRecycling");
|
||||
markFlagAsAccessed(23, "enableViewRecycling");
|
||||
|
||||
flagValue = currentProvider_->enableViewRecycling();
|
||||
enableViewRecycling_ = flagValue;
|
||||
@@ -488,7 +470,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForText() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(25, "enableViewRecyclingForText");
|
||||
markFlagAsAccessed(24, "enableViewRecyclingForText");
|
||||
|
||||
flagValue = currentProvider_->enableViewRecyclingForText();
|
||||
enableViewRecyclingForText_ = flagValue;
|
||||
@@ -506,7 +488,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForView() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(26, "enableViewRecyclingForView");
|
||||
markFlagAsAccessed(25, "enableViewRecyclingForView");
|
||||
|
||||
flagValue = currentProvider_->enableViewRecyclingForView();
|
||||
enableViewRecyclingForView_ = flagValue;
|
||||
@@ -524,7 +506,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(27, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
|
||||
markFlagAsAccessed(26, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
|
||||
|
||||
flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact();
|
||||
fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue;
|
||||
@@ -542,7 +524,7 @@ bool ReactNativeFeatureFlagsAccessor::fixMountingCoordinatorReportedPendingTrans
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(28, "fixMountingCoordinatorReportedPendingTransactionsOnAndroid");
|
||||
markFlagAsAccessed(27, "fixMountingCoordinatorReportedPendingTransactionsOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->fixMountingCoordinatorReportedPendingTransactionsOnAndroid();
|
||||
fixMountingCoordinatorReportedPendingTransactionsOnAndroid_ = flagValue;
|
||||
@@ -560,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(29, "fuseboxEnabledRelease");
|
||||
markFlagAsAccessed(28, "fuseboxEnabledRelease");
|
||||
|
||||
flagValue = currentProvider_->fuseboxEnabledRelease();
|
||||
fuseboxEnabledRelease_ = flagValue;
|
||||
@@ -578,7 +560,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxNetworkInspectionEnabled() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(30, "fuseboxNetworkInspectionEnabled");
|
||||
markFlagAsAccessed(29, "fuseboxNetworkInspectionEnabled");
|
||||
|
||||
flagValue = currentProvider_->fuseboxNetworkInspectionEnabled();
|
||||
fuseboxNetworkInspectionEnabled_ = flagValue;
|
||||
@@ -596,7 +578,7 @@ bool ReactNativeFeatureFlagsAccessor::removeTurboModuleManagerDelegateMutex() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(31, "removeTurboModuleManagerDelegateMutex");
|
||||
markFlagAsAccessed(30, "removeTurboModuleManagerDelegateMutex");
|
||||
|
||||
flagValue = currentProvider_->removeTurboModuleManagerDelegateMutex();
|
||||
removeTurboModuleManagerDelegateMutex_ = flagValue;
|
||||
@@ -614,7 +596,7 @@ bool ReactNativeFeatureFlagsAccessor::throwExceptionInsteadOfDeadlockOnTurboModu
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(32, "throwExceptionInsteadOfDeadlockOnTurboModuleSetupDuringSyncRenderIOS");
|
||||
markFlagAsAccessed(31, "throwExceptionInsteadOfDeadlockOnTurboModuleSetupDuringSyncRenderIOS");
|
||||
|
||||
flagValue = currentProvider_->throwExceptionInsteadOfDeadlockOnTurboModuleSetupDuringSyncRenderIOS();
|
||||
throwExceptionInsteadOfDeadlockOnTurboModuleSetupDuringSyncRenderIOS_ = 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::useAlwaysAvailableJSErrorHandling() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(34, "useAlwaysAvailableJSErrorHandling");
|
||||
markFlagAsAccessed(33, "useAlwaysAvailableJSErrorHandling");
|
||||
|
||||
flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling();
|
||||
useAlwaysAvailableJSErrorHandling_ = flagValue;
|
||||
@@ -668,7 +650,7 @@ bool ReactNativeFeatureFlagsAccessor::useEditTextStockAndroidFocusBehavior() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(35, "useEditTextStockAndroidFocusBehavior");
|
||||
markFlagAsAccessed(34, "useEditTextStockAndroidFocusBehavior");
|
||||
|
||||
flagValue = currentProvider_->useEditTextStockAndroidFocusBehavior();
|
||||
useEditTextStockAndroidFocusBehavior_ = flagValue;
|
||||
@@ -686,7 +668,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(36, "useFabricInterop");
|
||||
markFlagAsAccessed(35, "useFabricInterop");
|
||||
|
||||
flagValue = currentProvider_->useFabricInterop();
|
||||
useFabricInterop_ = 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::useOptimizedEventBatchingOnAndroid() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(38, "useOptimizedEventBatchingOnAndroid");
|
||||
markFlagAsAccessed(37, "useOptimizedEventBatchingOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->useOptimizedEventBatchingOnAndroid();
|
||||
useOptimizedEventBatchingOnAndroid_ = flagValue;
|
||||
@@ -740,7 +722,7 @@ bool ReactNativeFeatureFlagsAccessor::useRawPropsJsiValue() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(39, "useRawPropsJsiValue");
|
||||
markFlagAsAccessed(38, "useRawPropsJsiValue");
|
||||
|
||||
flagValue = currentProvider_->useRawPropsJsiValue();
|
||||
useRawPropsJsiValue_ = flagValue;
|
||||
@@ -758,7 +740,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(40, "useTurboModuleInterop");
|
||||
markFlagAsAccessed(39, "useTurboModuleInterop");
|
||||
|
||||
flagValue = currentProvider_->useTurboModuleInterop();
|
||||
useTurboModuleInterop_ = flagValue;
|
||||
@@ -776,7 +758,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModules() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(41, "useTurboModules");
|
||||
markFlagAsAccessed(40, "useTurboModules");
|
||||
|
||||
flagValue = currentProvider_->useTurboModules();
|
||||
useTurboModules_ = flagValue;
|
||||
|
||||
+2
-4
@@ -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<<aa11071b2b2561cd2433c74d56a0df80>>
|
||||
* @generated SignedSource<<ae6178fe0a98476f51dacbfb4fe60c68>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -54,7 +54,6 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
bool enablePropsUpdateReconciliationAndroid();
|
||||
bool enableReportEventPaintTime();
|
||||
bool enableSynchronousStateUpdates();
|
||||
bool enableUIConsistency();
|
||||
bool enableViewCulling();
|
||||
bool enableViewRecycling();
|
||||
bool enableViewRecyclingForText();
|
||||
@@ -85,7 +84,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
|
||||
bool wasOverridden_;
|
||||
|
||||
std::array<std::atomic<const char*>, 42> accessedFeatureFlags_;
|
||||
std::array<std::atomic<const char*>, 41> accessedFeatureFlags_;
|
||||
|
||||
std::atomic<std::optional<bool>> commonTestFlag_;
|
||||
std::atomic<std::optional<bool>> animatedShouldSignalBatch_;
|
||||
@@ -109,7 +108,6 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::atomic<std::optional<bool>> enablePropsUpdateReconciliationAndroid_;
|
||||
std::atomic<std::optional<bool>> enableReportEventPaintTime_;
|
||||
std::atomic<std::optional<bool>> enableSynchronousStateUpdates_;
|
||||
std::atomic<std::optional<bool>> enableUIConsistency_;
|
||||
std::atomic<std::optional<bool>> enableViewCulling_;
|
||||
std::atomic<std::optional<bool>> enableViewRecycling_;
|
||||
std::atomic<std::optional<bool>> enableViewRecyclingForText_;
|
||||
|
||||
+1
-5
@@ -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<<a98f50869ebeb68bd94bca19b7b40123>>
|
||||
* @generated SignedSource<<ca5e033ab15204739218965c99b79324>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -115,10 +115,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool enableUIConsistency() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool enableViewCulling() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
+1
-10
@@ -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<<8d19b32f41249aca2af9dcc429c8f8d1>>
|
||||
* @generated SignedSource<<52ba13e30dd740f540f68d066674aff3>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -243,15 +243,6 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
|
||||
return ReactNativeFeatureFlagsDefaults::enableSynchronousStateUpdates();
|
||||
}
|
||||
|
||||
bool enableUIConsistency() override {
|
||||
auto value = values_["enableUIConsistency"];
|
||||
if (!value.isNull()) {
|
||||
return value.getBool();
|
||||
}
|
||||
|
||||
return ReactNativeFeatureFlagsDefaults::enableUIConsistency();
|
||||
}
|
||||
|
||||
bool enableViewCulling() override {
|
||||
auto value = values_["enableViewCulling"];
|
||||
if (!value.isNull()) {
|
||||
|
||||
+1
-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<<045dab52c3701c760f9fadc6a86169d6>>
|
||||
* @generated SignedSource<<c286bb00921003c059ae4214f8e50fa1>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,6 @@ class ReactNativeFeatureFlagsProvider {
|
||||
virtual bool enablePropsUpdateReconciliationAndroid() = 0;
|
||||
virtual bool enableReportEventPaintTime() = 0;
|
||||
virtual bool enableSynchronousStateUpdates() = 0;
|
||||
virtual bool enableUIConsistency() = 0;
|
||||
virtual bool enableViewCulling() = 0;
|
||||
virtual bool enableViewRecycling() = 0;
|
||||
virtual bool enableViewRecyclingForText() = 0;
|
||||
|
||||
+1
-6
@@ -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<<8919fd03c9dce13db93091fd5eeb0d4c>>
|
||||
* @generated SignedSource<<da63453ac8130cecd6667b35afa2765b>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -154,11 +154,6 @@ bool NativeReactNativeFeatureFlags::enableSynchronousStateUpdates(
|
||||
return ReactNativeFeatureFlags::enableSynchronousStateUpdates();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::enableUIConsistency(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::enableUIConsistency();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::enableViewCulling(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::enableViewCulling();
|
||||
|
||||
+1
-3
@@ -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<<f12093c4d572ad5ee667739473b0e31f>>
|
||||
* @generated SignedSource<<8e873e3a94a7f6af2a740c81ebf88070>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -81,8 +81,6 @@ class NativeReactNativeFeatureFlags
|
||||
|
||||
bool enableSynchronousStateUpdates(jsi::Runtime& runtime);
|
||||
|
||||
bool enableUIConsistency(jsi::Runtime& runtime);
|
||||
|
||||
bool enableViewCulling(jsi::Runtime& runtime);
|
||||
|
||||
bool enableViewRecycling(jsi::Runtime& runtime);
|
||||
|
||||
@@ -56,10 +56,8 @@ Scheduler::Scheduler(
|
||||
|
||||
runtimeScheduler_ = weakRuntimeScheduler.value().lock().get();
|
||||
|
||||
if (ReactNativeFeatureFlags::enableUIConsistency()) {
|
||||
runtimeScheduler_->setShadowTreeRevisionConsistencyManager(
|
||||
uiManager->getShadowTreeRevisionConsistencyManager());
|
||||
}
|
||||
runtimeScheduler_->setShadowTreeRevisionConsistencyManager(
|
||||
uiManager->getShadowTreeRevisionConsistencyManager());
|
||||
|
||||
if (ReactNativeFeatureFlags::enableReportEventPaintTime()) {
|
||||
runtimeScheduler_->setEventTimingDelegate(eventPerformanceLogger_.get());
|
||||
|
||||
@@ -50,15 +50,8 @@ UIManager::UIManager(
|
||||
contextContainer_(std::move(contextContainer)),
|
||||
leakChecker_(constructLeakCheckerIfNeeded(runtimeExecutor)),
|
||||
lazyShadowTreeRevisionConsistencyManager_(
|
||||
ReactNativeFeatureFlags::enableUIConsistency()
|
||||
? std::make_unique<LazyShadowTreeRevisionConsistencyManager>(
|
||||
shadowTreeRegistry_)
|
||||
: nullptr),
|
||||
latestShadowTreeRevisionProvider_(
|
||||
ReactNativeFeatureFlags::enableUIConsistency()
|
||||
? nullptr
|
||||
: std::make_unique<LatestShadowTreeRevisionProvider>(
|
||||
shadowTreeRegistry_)) {}
|
||||
std::make_unique<LazyShadowTreeRevisionConsistencyManager>(
|
||||
shadowTreeRegistry_)) {}
|
||||
|
||||
UIManager::~UIManager() {
|
||||
LOG(WARNING) << "UIManager::~UIManager() was called (address: " << this
|
||||
@@ -205,8 +198,7 @@ void UIManager::completeSurface(
|
||||
},
|
||||
commitOptions);
|
||||
|
||||
if (result == ShadowTree::CommitStatus::Succeeded &&
|
||||
lazyShadowTreeRevisionConsistencyManager_ != nullptr) {
|
||||
if (result == ShadowTree::CommitStatus::Succeeded) {
|
||||
// It's safe to update the visible revision of the shadow tree immediately
|
||||
// after we commit a specific one.
|
||||
lazyShadowTreeRevisionConsistencyManager_->updateCurrentRevision(
|
||||
@@ -325,16 +317,7 @@ UIManager::getShadowTreeRevisionConsistencyManager() {
|
||||
}
|
||||
|
||||
ShadowTreeRevisionProvider* UIManager::getShadowTreeRevisionProvider() {
|
||||
if (lazyShadowTreeRevisionConsistencyManager_ != nullptr) {
|
||||
return lazyShadowTreeRevisionConsistencyManager_.get();
|
||||
} else if (latestShadowTreeRevisionProvider_ != nullptr) {
|
||||
return latestShadowTreeRevisionProvider_.get();
|
||||
}
|
||||
|
||||
LOG(ERROR) << "Unexpected state found in UIManager where both "
|
||||
<< "lazyShadowTreeRevisionConsistencyManager_ and "
|
||||
<< "latestShadowTreeRevisionProvider_ were null";
|
||||
return nullptr;
|
||||
return lazyShadowTreeRevisionConsistencyManager_.get();
|
||||
}
|
||||
|
||||
ShadowNode::Shared UIManager::findNodeAtPoint(
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <react/renderer/mounting/ShadowTreeRegistry.h>
|
||||
#include <react/renderer/uimanager/UIManagerAnimationDelegate.h>
|
||||
#include <react/renderer/uimanager/UIManagerDelegate.h>
|
||||
#include <react/renderer/uimanager/consistency/LatestShadowTreeRevisionProvider.h>
|
||||
#include <react/renderer/uimanager/consistency/LazyShadowTreeRevisionConsistencyManager.h>
|
||||
#include <react/renderer/uimanager/consistency/ShadowTreeRevisionProvider.h>
|
||||
#include <react/renderer/uimanager/primitives.h>
|
||||
@@ -242,8 +241,6 @@ class UIManager final : public ShadowTreeDelegate {
|
||||
|
||||
std::unique_ptr<LazyShadowTreeRevisionConsistencyManager>
|
||||
lazyShadowTreeRevisionConsistencyManager_;
|
||||
std::unique_ptr<LatestShadowTreeRevisionProvider>
|
||||
latestShadowTreeRevisionProvider_;
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include "LatestShadowTreeRevisionProvider.h"
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
LatestShadowTreeRevisionProvider::LatestShadowTreeRevisionProvider(
|
||||
ShadowTreeRegistry& shadowTreeRegistry)
|
||||
: shadowTreeRegistry_(shadowTreeRegistry) {}
|
||||
|
||||
#pragma mark - ShadowTreeRevisionProvider
|
||||
|
||||
RootShadowNode::Shared LatestShadowTreeRevisionProvider::getCurrentRevision(
|
||||
SurfaceId surfaceId) {
|
||||
RootShadowNode::Shared rootShadowNode;
|
||||
|
||||
shadowTreeRegistry_.visit(surfaceId, [&](const ShadowTree& shadowTree) {
|
||||
rootShadowNode = shadowTree.getCurrentRevision().rootShadowNode;
|
||||
});
|
||||
|
||||
return rootShadowNode;
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/root/RootShadowNode.h>
|
||||
#include <react/renderer/mounting/ShadowTreeRegistry.h>
|
||||
#include <react/renderer/uimanager/consistency/ShadowTreeRevisionProvider.h>
|
||||
#include <memory>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
/**
|
||||
* This is a drop-in replacement for `LazyShadowTreeRevisionConsistencyManager`
|
||||
* that preserves the current behavior (always providing the latest committed
|
||||
* revision instead of locking to a specific one).
|
||||
*/
|
||||
class LatestShadowTreeRevisionProvider : public ShadowTreeRevisionProvider {
|
||||
public:
|
||||
explicit LatestShadowTreeRevisionProvider(
|
||||
ShadowTreeRegistry& shadowTreeRegistry);
|
||||
|
||||
#pragma mark - ShadowTreeRevisionProvider
|
||||
|
||||
RootShadowNode::Shared getCurrentRevision(SurfaceId surfaceId) override;
|
||||
|
||||
private:
|
||||
ShadowTreeRegistry& shadowTreeRegistry_;
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -276,17 +276,6 @@ const definitions: FeatureFlagDefinitions = {
|
||||
},
|
||||
ossReleaseStage: 'none',
|
||||
},
|
||||
enableUIConsistency: {
|
||||
defaultValue: false,
|
||||
metadata: {
|
||||
dateAdded: '2024-04-25',
|
||||
description:
|
||||
'Ensures that JavaScript always has a consistent view of the state of the UI (e.g.: commits done in other threads are not immediately propagated to JS during its execution).',
|
||||
expectedReleaseValue: true,
|
||||
purpose: 'experimentation',
|
||||
},
|
||||
ossReleaseStage: 'none',
|
||||
},
|
||||
enableViewCulling: {
|
||||
defaultValue: false,
|
||||
metadata: {
|
||||
|
||||
@@ -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<<5e3d982c0dfc71417fc6a1838758c6f4>>
|
||||
* @generated SignedSource<<ed88e2ee3332ecda9c7c862164340e75>>
|
||||
* @flow strict
|
||||
*/
|
||||
|
||||
@@ -69,7 +69,6 @@ export type ReactNativeFeatureFlags = $ReadOnly<{
|
||||
enablePropsUpdateReconciliationAndroid: Getter<boolean>,
|
||||
enableReportEventPaintTime: Getter<boolean>,
|
||||
enableSynchronousStateUpdates: Getter<boolean>,
|
||||
enableUIConsistency: Getter<boolean>,
|
||||
enableViewCulling: Getter<boolean>,
|
||||
enableViewRecycling: Getter<boolean>,
|
||||
enableViewRecyclingForText: Getter<boolean>,
|
||||
@@ -248,10 +247,6 @@ export const enableReportEventPaintTime: Getter<boolean> = createNativeFlagGette
|
||||
* Dispatches state updates synchronously in Fabric (e.g.: updates the scroll position in the shadow tree synchronously from the main thread).
|
||||
*/
|
||||
export const enableSynchronousStateUpdates: Getter<boolean> = createNativeFlagGetter('enableSynchronousStateUpdates', false);
|
||||
/**
|
||||
* Ensures that JavaScript always has a consistent view of the state of the UI (e.g.: commits done in other threads are not immediately propagated to JS during its execution).
|
||||
*/
|
||||
export const enableUIConsistency: Getter<boolean> = createNativeFlagGetter('enableUIConsistency', false);
|
||||
/**
|
||||
* Enables View Culling: as soon as a view goes off screen, it can be reused anywhere in the UI and pieced together with other items to create new UI elements.
|
||||
*/
|
||||
|
||||
+1
-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<<7b549d01fadc97455774ff6b41de426d>>
|
||||
* @generated SignedSource<<5a78f3aad46e8593f7c63578816bc09e>>
|
||||
* @flow strict
|
||||
*/
|
||||
|
||||
@@ -46,7 +46,6 @@ export interface Spec extends TurboModule {
|
||||
+enablePropsUpdateReconciliationAndroid?: () => boolean;
|
||||
+enableReportEventPaintTime?: () => boolean;
|
||||
+enableSynchronousStateUpdates?: () => boolean;
|
||||
+enableUIConsistency?: () => boolean;
|
||||
+enableViewCulling?: () => boolean;
|
||||
+enableViewRecycling?: () => boolean;
|
||||
+enableViewRecyclingForText?: () => boolean;
|
||||
|
||||
-1
@@ -8,7 +8,6 @@
|
||||
* @format
|
||||
* @oncall react_native
|
||||
* @fantom_flags enableAccessToHostTreeInFabric:true
|
||||
* @fantom_flags enableUIConsistency:true
|
||||
* @fantom_flags enableSynchronousStateUpdates:true
|
||||
*/
|
||||
|
||||
|
||||
@@ -6719,8 +6719,6 @@ class JReactNativeFeatureFlagsCxxInterop
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
static bool enableSynchronousStateUpdates(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
static bool enableUIConsistency(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
static bool enableViewRecycling(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
static bool excludeYogaFromRawProps(
|
||||
@@ -15814,7 +15812,6 @@ class NativeReactNativeFeatureFlags
|
||||
bool enablePropsUpdateReconciliationAndroid(jsi::Runtime& runtime);
|
||||
bool enableReportEventPaintTime(jsi::Runtime& runtime);
|
||||
bool enableSynchronousStateUpdates(jsi::Runtime& runtime);
|
||||
bool enableUIConsistency(jsi::Runtime& runtime);
|
||||
bool enableViewRecycling(jsi::Runtime& runtime);
|
||||
bool excludeYogaFromRawProps(jsi::Runtime& runtime);
|
||||
bool fixDifferentiatorEmittingUpdatesWithWrongParentTag(
|
||||
@@ -32949,8 +32946,6 @@ class UIManager final : public ShadowTreeDelegate {
|
||||
std::unique_ptr<LeakChecker> leakChecker_;
|
||||
std::unique_ptr<LazyShadowTreeRevisionConsistencyManager>
|
||||
lazyShadowTreeRevisionConsistencyManager_;
|
||||
std::unique_ptr<LatestShadowTreeRevisionProvider>
|
||||
latestShadowTreeRevisionProvider_;
|
||||
};
|
||||
} // namespace facebook::react
|
||||
|
||||
@@ -33058,16 +33053,6 @@ jsi::Value callMethodOfModule(
|
||||
std::initializer_list<jsi::Value> args);
|
||||
}
|
||||
|
||||
/// @src {packages/react-native/ReactCommon/react/renderer/uimanager/consistency/LatestShadowTreeRevisionProvider.h}:
|
||||
namespace facebook::react {
|
||||
class LatestShadowTreeRevisionProvider : public ShadowTreeRevisionProvider {
|
||||
public:
|
||||
explicit LatestShadowTreeRevisionProvider(
|
||||
ShadowTreeRegistry& shadowTreeRegistry);
|
||||
RootShadowNode::Shared getCurrentRevision(SurfaceId surfaceId) override;
|
||||
};
|
||||
} // namespace facebook::react
|
||||
|
||||
/// @src {packages/react-native/ReactCommon/react/renderer/uimanager/consistency/LazyShadowTreeRevisionConsistencyManager.h}:
|
||||
namespace facebook::react {
|
||||
class LazyShadowTreeRevisionConsistencyManager
|
||||
|
||||
Reference in New Issue
Block a user