mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Set up experiment to fix incorrect state updates in smooth scroll animations on Android (#45237)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45237 Changelog: [internal] This creates a feature flag to test a fix for an incorrect state update dispatched to Fabric when using smooth scroll animations. Specifically, when starting a smooth scroll animation from X to Y, the scroll view would set the state to Y, and then all the range from X to Y again. For example, the sequence of state updates when smooth scrolling from 0 to 5 would be `0 -> 5 -> 1 -> 2 -> 3 -> 4 -> 5`, which is obviously incorrect. This flag prevents setting the final value before it's actually reached. Reviewed By: javache Differential Revision: D59233069 fbshipit-source-id: 221602d7d30635070e7776ce756e2ef438edf638
This commit is contained in:
committed by
Facebook GitHub Bot
parent
818e70f7eb
commit
e35a2f4a7c
+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<<e031aebb1124ba925f1d725d267043c4>>
|
||||
* @generated SignedSource<<1cad606bd06ab650004955138228d227>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -94,6 +94,12 @@ public object ReactNativeFeatureFlags {
|
||||
@JvmStatic
|
||||
public fun enableUIConsistency(): Boolean = accessor.enableUIConsistency()
|
||||
|
||||
/**
|
||||
* When doing a smooth scroll animation, it stops setting the state with the final scroll position in Fabric before the animation starts.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun fixIncorrectScrollViewStateUpdateOnAndroid(): Boolean = accessor.fixIncorrectScrollViewStateUpdateOnAndroid()
|
||||
|
||||
/**
|
||||
* Uses the default event priority instead of the discreet event priority by default when dispatching events from Fabric to React.
|
||||
*/
|
||||
|
||||
+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<<92ebcb510939039fc157e0f85b08073e>>
|
||||
* @generated SignedSource<<b03fe019d1bacd13740a3e783197c17b>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -31,6 +31,7 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
|
||||
private var enableMicrotasksCache: Boolean? = null
|
||||
private var enableSynchronousStateUpdatesCache: Boolean? = null
|
||||
private var enableUIConsistencyCache: Boolean? = null
|
||||
private var fixIncorrectScrollViewStateUpdateOnAndroidCache: Boolean? = null
|
||||
private var fixMappingOfEventPrioritiesBetweenFabricAndReactCache: Boolean? = null
|
||||
private var fixMissedFabricStateUpdatesOnAndroidCache: Boolean? = null
|
||||
private var fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeakCache: Boolean? = null
|
||||
@@ -146,6 +147,15 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun fixIncorrectScrollViewStateUpdateOnAndroid(): Boolean {
|
||||
var cached = fixIncorrectScrollViewStateUpdateOnAndroidCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.fixIncorrectScrollViewStateUpdateOnAndroid()
|
||||
fixIncorrectScrollViewStateUpdateOnAndroidCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean {
|
||||
var cached = fixMappingOfEventPrioritiesBetweenFabricAndReactCache
|
||||
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<<2434a09bc40a30291c642a26453f939f>>
|
||||
* @generated SignedSource<<1b39ae121d8238bbb34c54330700c9e8>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -50,6 +50,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableUIConsistency(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun fixIncorrectScrollViewStateUpdateOnAndroid(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun fixMissedFabricStateUpdatesOnAndroid(): 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<<b2e96bbb47ac02eac2216200ecb12f17>>
|
||||
* @generated SignedSource<<0584cef0a5e682b2b3ba6d46161e0286>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -45,6 +45,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
||||
|
||||
override fun enableUIConsistency(): Boolean = false
|
||||
|
||||
override fun fixIncorrectScrollViewStateUpdateOnAndroid(): Boolean = false
|
||||
|
||||
override fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean = false
|
||||
|
||||
override fun fixMissedFabricStateUpdatesOnAndroid(): 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<<65a88218f057b56211d84b6d473e8a90>>
|
||||
* @generated SignedSource<<a97af69ca22746594d72410f72a0a1cb>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -35,6 +35,7 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
||||
private var enableMicrotasksCache: Boolean? = null
|
||||
private var enableSynchronousStateUpdatesCache: Boolean? = null
|
||||
private var enableUIConsistencyCache: Boolean? = null
|
||||
private var fixIncorrectScrollViewStateUpdateOnAndroidCache: Boolean? = null
|
||||
private var fixMappingOfEventPrioritiesBetweenFabricAndReactCache: Boolean? = null
|
||||
private var fixMissedFabricStateUpdatesOnAndroidCache: Boolean? = null
|
||||
private var fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeakCache: Boolean? = null
|
||||
@@ -161,6 +162,16 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun fixIncorrectScrollViewStateUpdateOnAndroid(): Boolean {
|
||||
var cached = fixIncorrectScrollViewStateUpdateOnAndroidCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.fixIncorrectScrollViewStateUpdateOnAndroid()
|
||||
accessedFeatureFlags.add("fixIncorrectScrollViewStateUpdateOnAndroid")
|
||||
fixIncorrectScrollViewStateUpdateOnAndroidCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean {
|
||||
var cached = fixMappingOfEventPrioritiesBetweenFabricAndReactCache
|
||||
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<<3a0f547e2b68072a76b1eabc28c371cb>>
|
||||
* @generated SignedSource<<de2cd46cfe4a934b6584e782c4d9d213>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -45,6 +45,8 @@ public interface ReactNativeFeatureFlagsProvider {
|
||||
|
||||
@DoNotStrip public fun enableUIConsistency(): Boolean
|
||||
|
||||
@DoNotStrip public fun fixIncorrectScrollViewStateUpdateOnAndroid(): Boolean
|
||||
|
||||
@DoNotStrip public fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean
|
||||
|
||||
@DoNotStrip public fun fixMissedFabricStateUpdatesOnAndroid(): Boolean
|
||||
|
||||
+4
-1
@@ -19,6 +19,7 @@ import com.facebook.react.bridge.ReactContext
|
||||
import com.facebook.react.bridge.WritableMap
|
||||
import com.facebook.react.bridge.WritableNativeMap
|
||||
import com.facebook.react.common.ReactConstants
|
||||
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
|
||||
import com.facebook.react.uimanager.PixelUtil.toDIPFromPixel
|
||||
import com.facebook.react.uimanager.StateWrapper
|
||||
import com.facebook.react.uimanager.UIManagerHelper
|
||||
@@ -249,7 +250,9 @@ public object ReactScrollViewHelper {
|
||||
if (scrollY != y) {
|
||||
scrollView.startFlingAnimator(scrollY, y)
|
||||
}
|
||||
updateFabricScrollState<T>(scrollView, x, y)
|
||||
if (ReactNativeFeatureFlags.fixIncorrectScrollViewStateUpdateOnAndroid()) {
|
||||
updateFabricScrollState<T>(scrollView, x, y)
|
||||
}
|
||||
}
|
||||
|
||||
/** Get current position or position after current animation finishes, if any. */
|
||||
|
||||
+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<<f245741c5e9986bc1e2a4c53613fe000>>
|
||||
* @generated SignedSource<<2e4bde6040e04475ee137722c9d2df24>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -105,6 +105,12 @@ class ReactNativeFeatureFlagsProviderHolder
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool fixIncorrectScrollViewStateUpdateOnAndroid() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("fixIncorrectScrollViewStateUpdateOnAndroid");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool fixMappingOfEventPrioritiesBetweenFabricAndReact() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("fixMappingOfEventPrioritiesBetweenFabricAndReact");
|
||||
@@ -254,6 +260,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableUIConsistency(
|
||||
return ReactNativeFeatureFlags::enableUIConsistency();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::fixIncorrectScrollViewStateUpdateOnAndroid(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::fixIncorrectScrollViewStateUpdateOnAndroid();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::fixMappingOfEventPrioritiesBetweenFabricAndReact(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact();
|
||||
@@ -379,6 +390,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
||||
makeNativeMethod(
|
||||
"enableUIConsistency",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableUIConsistency),
|
||||
makeNativeMethod(
|
||||
"fixIncorrectScrollViewStateUpdateOnAndroid",
|
||||
JReactNativeFeatureFlagsCxxInterop::fixIncorrectScrollViewStateUpdateOnAndroid),
|
||||
makeNativeMethod(
|
||||
"fixMappingOfEventPrioritiesBetweenFabricAndReact",
|
||||
JReactNativeFeatureFlagsCxxInterop::fixMappingOfEventPrioritiesBetweenFabricAndReact),
|
||||
|
||||
+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<<7e9c48995f6a5f4e0a56c0f2ec784def>>
|
||||
* @generated SignedSource<<aacec18a9a195a7332a7df275a2d181e>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -63,6 +63,9 @@ class JReactNativeFeatureFlagsCxxInterop
|
||||
static bool enableUIConsistency(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool fixIncorrectScrollViewStateUpdateOnAndroid(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool fixMappingOfEventPrioritiesBetweenFabricAndReact(
|
||||
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<<91a56189178d461874bfff11b14ca318>>
|
||||
* @generated SignedSource<<4f7eb0f1d6cb613d81c9cf5d05a7c6ec>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -65,6 +65,10 @@ bool ReactNativeFeatureFlags::enableUIConsistency() {
|
||||
return getAccessor().enableUIConsistency();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::fixIncorrectScrollViewStateUpdateOnAndroid() {
|
||||
return getAccessor().fixIncorrectScrollViewStateUpdateOnAndroid();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact() {
|
||||
return getAccessor().fixMappingOfEventPrioritiesBetweenFabricAndReact();
|
||||
}
|
||||
|
||||
@@ -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<<6683bcf499d88e4449f570f38b7d8b2f>>
|
||||
* @generated SignedSource<<70c78db13887af269fe4d6b2113510b2>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -92,6 +92,11 @@ class ReactNativeFeatureFlags {
|
||||
*/
|
||||
RN_EXPORT static bool enableUIConsistency();
|
||||
|
||||
/**
|
||||
* When doing a smooth scroll animation, it stops setting the state with the final scroll position in Fabric before the animation starts.
|
||||
*/
|
||||
RN_EXPORT static bool fixIncorrectScrollViewStateUpdateOnAndroid();
|
||||
|
||||
/**
|
||||
* Uses the default event priority instead of the discreet event priority by default when dispatching events from Fabric to React.
|
||||
*/
|
||||
|
||||
+34
-16
@@ -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<<e6fb2d4186ceec77a58ce6156f1cefad>>
|
||||
* @generated SignedSource<<f596079ef605f37b99fc22571eef9e53>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -227,6 +227,24 @@ bool ReactNativeFeatureFlagsAccessor::enableUIConsistency() {
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::fixIncorrectScrollViewStateUpdateOnAndroid() {
|
||||
auto flagValue = fixIncorrectScrollViewStateUpdateOnAndroid_.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(11, "fixIncorrectScrollViewStateUpdateOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->fixIncorrectScrollViewStateUpdateOnAndroid();
|
||||
fixIncorrectScrollViewStateUpdateOnAndroid_ = flagValue;
|
||||
}
|
||||
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::fixMappingOfEventPrioritiesBetweenFabricAndReact() {
|
||||
auto flagValue = fixMappingOfEventPrioritiesBetweenFabricAndReact_.load();
|
||||
|
||||
@@ -236,7 +254,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(11, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
|
||||
markFlagAsAccessed(12, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
|
||||
|
||||
flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact();
|
||||
fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue;
|
||||
@@ -254,7 +272,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(12, "fixMissedFabricStateUpdatesOnAndroid");
|
||||
markFlagAsAccessed(13, "fixMissedFabricStateUpdatesOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->fixMissedFabricStateUpdatesOnAndroid();
|
||||
fixMissedFabricStateUpdatesOnAndroid_ = flagValue;
|
||||
@@ -272,7 +290,7 @@ bool ReactNativeFeatureFlagsAccessor::fixStoppedSurfaceRemoveDeleteTreeUIFrameCa
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(13, "fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak");
|
||||
markFlagAsAccessed(14, "fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak");
|
||||
|
||||
flagValue = currentProvider_->fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak();
|
||||
fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak_ = flagValue;
|
||||
@@ -290,7 +308,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(14, "forceBatchingMountItemsOnAndroid");
|
||||
markFlagAsAccessed(15, "forceBatchingMountItemsOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->forceBatchingMountItemsOnAndroid();
|
||||
forceBatchingMountItemsOnAndroid_ = flagValue;
|
||||
@@ -308,7 +326,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(15, "fuseboxEnabledDebug");
|
||||
markFlagAsAccessed(16, "fuseboxEnabledDebug");
|
||||
|
||||
flagValue = currentProvider_->fuseboxEnabledDebug();
|
||||
fuseboxEnabledDebug_ = flagValue;
|
||||
@@ -326,7 +344,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(16, "fuseboxEnabledRelease");
|
||||
markFlagAsAccessed(17, "fuseboxEnabledRelease");
|
||||
|
||||
flagValue = currentProvider_->fuseboxEnabledRelease();
|
||||
fuseboxEnabledRelease_ = flagValue;
|
||||
@@ -344,7 +362,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(17, "lazyAnimationCallbacks");
|
||||
markFlagAsAccessed(18, "lazyAnimationCallbacks");
|
||||
|
||||
flagValue = currentProvider_->lazyAnimationCallbacks();
|
||||
lazyAnimationCallbacks_ = flagValue;
|
||||
@@ -362,7 +380,7 @@ bool ReactNativeFeatureFlagsAccessor::preventDoubleTextMeasure() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(18, "preventDoubleTextMeasure");
|
||||
markFlagAsAccessed(19, "preventDoubleTextMeasure");
|
||||
|
||||
flagValue = currentProvider_->preventDoubleTextMeasure();
|
||||
preventDoubleTextMeasure_ = flagValue;
|
||||
@@ -380,7 +398,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(19, "setAndroidLayoutDirection");
|
||||
markFlagAsAccessed(20, "setAndroidLayoutDirection");
|
||||
|
||||
flagValue = currentProvider_->setAndroidLayoutDirection();
|
||||
setAndroidLayoutDirection_ = flagValue;
|
||||
@@ -398,7 +416,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(20, "useImmediateExecutorInAndroidBridgeless");
|
||||
markFlagAsAccessed(21, "useImmediateExecutorInAndroidBridgeless");
|
||||
|
||||
flagValue = currentProvider_->useImmediateExecutorInAndroidBridgeless();
|
||||
useImmediateExecutorInAndroidBridgeless_ = flagValue;
|
||||
@@ -416,7 +434,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(21, "useModernRuntimeScheduler");
|
||||
markFlagAsAccessed(22, "useModernRuntimeScheduler");
|
||||
|
||||
flagValue = currentProvider_->useModernRuntimeScheduler();
|
||||
useModernRuntimeScheduler_ = flagValue;
|
||||
@@ -434,7 +452,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(22, "useNativeViewConfigsInBridgelessMode");
|
||||
markFlagAsAccessed(23, "useNativeViewConfigsInBridgelessMode");
|
||||
|
||||
flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
|
||||
useNativeViewConfigsInBridgelessMode_ = flagValue;
|
||||
@@ -452,7 +470,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(23, "useRuntimeShadowNodeReferenceUpdate");
|
||||
markFlagAsAccessed(24, "useRuntimeShadowNodeReferenceUpdate");
|
||||
|
||||
flagValue = currentProvider_->useRuntimeShadowNodeReferenceUpdate();
|
||||
useRuntimeShadowNodeReferenceUpdate_ = flagValue;
|
||||
@@ -470,7 +488,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(24, "useRuntimeShadowNodeReferenceUpdateOnLayout");
|
||||
markFlagAsAccessed(25, "useRuntimeShadowNodeReferenceUpdateOnLayout");
|
||||
|
||||
flagValue = currentProvider_->useRuntimeShadowNodeReferenceUpdateOnLayout();
|
||||
useRuntimeShadowNodeReferenceUpdateOnLayout_ = flagValue;
|
||||
@@ -488,7 +506,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(25, "useStateAlignmentMechanism");
|
||||
markFlagAsAccessed(26, "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<<c4afa05f0c2a175476d82a52d47c3b91>>
|
||||
* @generated SignedSource<<8b86c11a06dc9f53991482cb6640d806>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -42,6 +42,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
bool enableMicrotasks();
|
||||
bool enableSynchronousStateUpdates();
|
||||
bool enableUIConsistency();
|
||||
bool fixIncorrectScrollViewStateUpdateOnAndroid();
|
||||
bool fixMappingOfEventPrioritiesBetweenFabricAndReact();
|
||||
bool fixMissedFabricStateUpdatesOnAndroid();
|
||||
bool fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak();
|
||||
@@ -67,7 +68,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
|
||||
bool wasOverridden_;
|
||||
|
||||
std::array<std::atomic<const char*>, 26> accessedFeatureFlags_;
|
||||
std::array<std::atomic<const char*>, 27> accessedFeatureFlags_;
|
||||
|
||||
std::atomic<std::optional<bool>> commonTestFlag_;
|
||||
std::atomic<std::optional<bool>> allowCollapsableChildren_;
|
||||
@@ -80,6 +81,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::atomic<std::optional<bool>> enableMicrotasks_;
|
||||
std::atomic<std::optional<bool>> enableSynchronousStateUpdates_;
|
||||
std::atomic<std::optional<bool>> enableUIConsistency_;
|
||||
std::atomic<std::optional<bool>> fixIncorrectScrollViewStateUpdateOnAndroid_;
|
||||
std::atomic<std::optional<bool>> fixMappingOfEventPrioritiesBetweenFabricAndReact_;
|
||||
std::atomic<std::optional<bool>> fixMissedFabricStateUpdatesOnAndroid_;
|
||||
std::atomic<std::optional<bool>> fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak_;
|
||||
|
||||
+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<<cb2b8b9fc0efdcde70d12724a2ac6768>>
|
||||
* @generated SignedSource<<79318071dbc264dabddac64a52bd5256>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -71,6 +71,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool fixIncorrectScrollViewStateUpdateOnAndroid() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool fixMappingOfEventPrioritiesBetweenFabricAndReact() 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<<57b9e4f683df27a7a5770633e88f8b22>>
|
||||
* @generated SignedSource<<bc66fbce7a26dbfe5c2df9a0151f6b57>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -36,6 +36,7 @@ class ReactNativeFeatureFlagsProvider {
|
||||
virtual bool enableMicrotasks() = 0;
|
||||
virtual bool enableSynchronousStateUpdates() = 0;
|
||||
virtual bool enableUIConsistency() = 0;
|
||||
virtual bool fixIncorrectScrollViewStateUpdateOnAndroid() = 0;
|
||||
virtual bool fixMappingOfEventPrioritiesBetweenFabricAndReact() = 0;
|
||||
virtual bool fixMissedFabricStateUpdatesOnAndroid() = 0;
|
||||
virtual bool fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak() = 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<<58b0c0c49dc6cf2ecdbc2c3038395e4e>>
|
||||
* @generated SignedSource<<e3b1d2259fca22d839d0f99af2d94471>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -92,6 +92,11 @@ bool NativeReactNativeFeatureFlags::enableUIConsistency(
|
||||
return ReactNativeFeatureFlags::enableUIConsistency();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::fixIncorrectScrollViewStateUpdateOnAndroid(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::fixIncorrectScrollViewStateUpdateOnAndroid();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact();
|
||||
|
||||
+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<<eadc2ecdbe5e95fe92224d031733d3b4>>
|
||||
* @generated SignedSource<<426ae84f1b0deeb7b0fda5fb29042909>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -57,6 +57,8 @@ class NativeReactNativeFeatureFlags
|
||||
|
||||
bool enableUIConsistency(jsi::Runtime& runtime);
|
||||
|
||||
bool fixIncorrectScrollViewStateUpdateOnAndroid(jsi::Runtime& runtime);
|
||||
|
||||
bool fixMappingOfEventPrioritiesBetweenFabricAndReact(jsi::Runtime& runtime);
|
||||
|
||||
bool fixMissedFabricStateUpdatesOnAndroid(jsi::Runtime& runtime);
|
||||
|
||||
@@ -88,6 +88,11 @@ const definitions: FeatureFlagDefinitions = {
|
||||
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).',
|
||||
},
|
||||
fixIncorrectScrollViewStateUpdateOnAndroid: {
|
||||
defaultValue: false,
|
||||
description:
|
||||
'When doing a smooth scroll animation, it stops setting the state with the final scroll position in Fabric before the animation starts.',
|
||||
},
|
||||
fixMappingOfEventPrioritiesBetweenFabricAndReact: {
|
||||
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<<95a692d91055d05301a06fd33636d3fa>>
|
||||
* @generated SignedSource<<250a4b89541fd36953e204c580123895>>
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
@@ -52,6 +52,7 @@ export type ReactNativeFeatureFlags = {
|
||||
enableMicrotasks: Getter<boolean>,
|
||||
enableSynchronousStateUpdates: Getter<boolean>,
|
||||
enableUIConsistency: Getter<boolean>,
|
||||
fixIncorrectScrollViewStateUpdateOnAndroid: Getter<boolean>,
|
||||
fixMappingOfEventPrioritiesBetweenFabricAndReact: Getter<boolean>,
|
||||
fixMissedFabricStateUpdatesOnAndroid: Getter<boolean>,
|
||||
fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak: Getter<boolean>,
|
||||
@@ -158,6 +159,10 @@ export const enableSynchronousStateUpdates: Getter<boolean> = createNativeFlagGe
|
||||
* 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);
|
||||
/**
|
||||
* When doing a smooth scroll animation, it stops setting the state with the final scroll position in Fabric before the animation starts.
|
||||
*/
|
||||
export const fixIncorrectScrollViewStateUpdateOnAndroid: Getter<boolean> = createNativeFlagGetter('fixIncorrectScrollViewStateUpdateOnAndroid', false);
|
||||
/**
|
||||
* Uses the default event priority instead of the discreet event priority by default when dispatching events from Fabric to React.
|
||||
*/
|
||||
|
||||
+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<<cd704035749b46f1be6f940806c88df5>>
|
||||
* @generated SignedSource<<5436af4d7f25024a57ef557827a02ecb>>
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
@@ -34,6 +34,7 @@ export interface Spec extends TurboModule {
|
||||
+enableMicrotasks?: () => boolean;
|
||||
+enableSynchronousStateUpdates?: () => boolean;
|
||||
+enableUIConsistency?: () => boolean;
|
||||
+fixIncorrectScrollViewStateUpdateOnAndroid?: () => boolean;
|
||||
+fixMappingOfEventPrioritiesBetweenFabricAndReact?: () => boolean;
|
||||
+fixMissedFabricStateUpdatesOnAndroid?: () => boolean;
|
||||
+fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak?: () => boolean;
|
||||
|
||||
Reference in New Issue
Block a user