mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
move enableLayoutAnimationsOnIOS feature flag to common infra (#46174)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46174 changelog: [internal] LayoutAnimation on iOS should be shipped everywhere except FBiOS. Reviewed By: javache Differential Revision: D61656839 fbshipit-source-id: b3903491cbdea81dd4424a69e58976ab470b33e2
This commit is contained in:
committed by
Facebook GitHub Bot
parent
75114e3672
commit
858ad5e9c9
@@ -8,6 +8,7 @@
|
||||
#import "RCTScheduler.h"
|
||||
|
||||
#import <cxxreact/SystraceSection.h>
|
||||
#import <react/featureflags/ReactNativeFeatureFlags.h>
|
||||
#import <react/renderer/animations/LayoutAnimationDriver.h>
|
||||
#import <react/renderer/componentregistry/ComponentDescriptorFactory.h>
|
||||
#import <react/renderer/scheduler/Scheduler.h>
|
||||
@@ -118,7 +119,7 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi
|
||||
|
||||
_delegateProxy = std::make_shared<SchedulerDelegateProxy>((__bridge void *)self);
|
||||
|
||||
if (reactNativeConfig->getBool("react_fabric:enabled_layout_animations_ios")) {
|
||||
if (ReactNativeFeatureFlags::enableLayoutAnimationsOnIOS()) {
|
||||
_layoutAnimationDelegateProxy = std::make_shared<LayoutAnimationDelegateProxy>((__bridge void *)self);
|
||||
_animationDriver = std::make_shared<LayoutAnimationDriver>(
|
||||
toolbox.runtimeExecutor, toolbox.contextContainer, _layoutAnimationDelegateProxy.get());
|
||||
|
||||
+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<<213f28bbe5ea5f66048ece938609e815>>
|
||||
* @generated SignedSource<<37c55ee907c49bff0f6b3fe1d56dcfe6>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -112,6 +112,12 @@ public object ReactNativeFeatureFlags {
|
||||
@JvmStatic
|
||||
public fun enableGranularShadowTreeStateReconciliation(): Boolean = accessor.enableGranularShadowTreeStateReconciliation()
|
||||
|
||||
/**
|
||||
* When enabled, LayoutAnimations API will animate state changes on iOS.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun enableLayoutAnimationsOnIOS(): Boolean = accessor.enableLayoutAnimationsOnIOS()
|
||||
|
||||
/**
|
||||
* Enables the reporting of long tasks through `PerformanceObserver`. Only works if the event loop is enabled.
|
||||
*/
|
||||
|
||||
+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<<dbad540b061200d42d58f89dd48f2d7b>>
|
||||
* @generated SignedSource<<9ce10d501d1d245eaa56dd6644a2838d>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -34,6 +34,7 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
|
||||
private var enableFabricLogsCache: Boolean? = null
|
||||
private var enableFabricRendererExclusivelyCache: Boolean? = null
|
||||
private var enableGranularShadowTreeStateReconciliationCache: Boolean? = null
|
||||
private var enableLayoutAnimationsOnIOSCache: Boolean? = null
|
||||
private var enableLongTaskAPICache: Boolean? = null
|
||||
private var enableMicrotasksCache: Boolean? = null
|
||||
private var enablePropsUpdateReconciliationAndroidCache: Boolean? = null
|
||||
@@ -191,6 +192,15 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableLayoutAnimationsOnIOS(): Boolean {
|
||||
var cached = enableLayoutAnimationsOnIOSCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.enableLayoutAnimationsOnIOS()
|
||||
enableLayoutAnimationsOnIOSCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableLongTaskAPI(): Boolean {
|
||||
var cached = enableLongTaskAPICache
|
||||
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<<3dccfc01207bf4ea6b671754cbd31313>>
|
||||
* @generated SignedSource<<c5d5be97ecf6d9ab7cfb6e705d859cbf>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -56,6 +56,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableGranularShadowTreeStateReconciliation(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableLayoutAnimationsOnIOS(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableLongTaskAPI(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableMicrotasks(): 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<<b7de0bdf61f9b20363ade9ae0c07fbd4>>
|
||||
* @generated SignedSource<<2ac7adf2656a8a356cc1b4d8f40bd20b>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -51,6 +51,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
||||
|
||||
override fun enableGranularShadowTreeStateReconciliation(): Boolean = false
|
||||
|
||||
override fun enableLayoutAnimationsOnIOS(): Boolean = true
|
||||
|
||||
override fun enableLongTaskAPI(): Boolean = false
|
||||
|
||||
override fun enableMicrotasks(): 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<<fd8d47346a04e8f0da915d2f9fe53253>>
|
||||
* @generated SignedSource<<d883bc5832598b7034aaedfe8606a9ff>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -38,6 +38,7 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
||||
private var enableFabricLogsCache: Boolean? = null
|
||||
private var enableFabricRendererExclusivelyCache: Boolean? = null
|
||||
private var enableGranularShadowTreeStateReconciliationCache: Boolean? = null
|
||||
private var enableLayoutAnimationsOnIOSCache: Boolean? = null
|
||||
private var enableLongTaskAPICache: Boolean? = null
|
||||
private var enableMicrotasksCache: Boolean? = null
|
||||
private var enablePropsUpdateReconciliationAndroidCache: Boolean? = null
|
||||
@@ -209,6 +210,16 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableLayoutAnimationsOnIOS(): Boolean {
|
||||
var cached = enableLayoutAnimationsOnIOSCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.enableLayoutAnimationsOnIOS()
|
||||
accessedFeatureFlags.add("enableLayoutAnimationsOnIOS")
|
||||
enableLayoutAnimationsOnIOSCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableLongTaskAPI(): Boolean {
|
||||
var cached = enableLongTaskAPICache
|
||||
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<<fa4d24b87da9262d4a55da3e8377d0c2>>
|
||||
* @generated SignedSource<<2e4136d39051c4a1ee6289a6ccf02d52>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -51,6 +51,8 @@ public interface ReactNativeFeatureFlagsProvider {
|
||||
|
||||
@DoNotStrip public fun enableGranularShadowTreeStateReconciliation(): Boolean
|
||||
|
||||
@DoNotStrip public fun enableLayoutAnimationsOnIOS(): Boolean
|
||||
|
||||
@DoNotStrip public fun enableLongTaskAPI(): Boolean
|
||||
|
||||
@DoNotStrip public fun enableMicrotasks(): 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<<7c9c4fe7fb8c50deaacfca3e1236eb95>>
|
||||
* @generated SignedSource<<8c6289e2eda0e672a38a7c30bf508806>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -123,6 +123,12 @@ class ReactNativeFeatureFlagsProviderHolder
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool enableLayoutAnimationsOnIOS() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableLayoutAnimationsOnIOS");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool enableLongTaskAPI() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableLongTaskAPI");
|
||||
@@ -377,6 +383,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableGranularShadowTreeStateReconcilia
|
||||
return ReactNativeFeatureFlags::enableGranularShadowTreeStateReconciliation();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::enableLayoutAnimationsOnIOS(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::enableLayoutAnimationsOnIOS();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::enableLongTaskAPI(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::enableLongTaskAPI();
|
||||
@@ -586,6 +597,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
||||
makeNativeMethod(
|
||||
"enableGranularShadowTreeStateReconciliation",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableGranularShadowTreeStateReconciliation),
|
||||
makeNativeMethod(
|
||||
"enableLayoutAnimationsOnIOS",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableLayoutAnimationsOnIOS),
|
||||
makeNativeMethod(
|
||||
"enableLongTaskAPI",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableLongTaskAPI),
|
||||
|
||||
+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<<2f38de8d77e21643f0cb253dec06c979>>
|
||||
* @generated SignedSource<<50413c841b6983476df2efcf74e1c5d6>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -72,6 +72,9 @@ class JReactNativeFeatureFlagsCxxInterop
|
||||
static bool enableGranularShadowTreeStateReconciliation(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool enableLayoutAnimationsOnIOS(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool enableLongTaskAPI(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
namespace facebook::react {
|
||||
|
||||
bool EmptyReactNativeConfig::getBool(const std::string& param) const {
|
||||
if (param == "react_fabric:enabled_layout_animations_ios") {
|
||||
return true;
|
||||
}
|
||||
if (param == "react_fabric:enabled_automatic_interop_android") {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -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<<bfc4f756d9a8a6839780614aeb155927>>
|
||||
* @generated SignedSource<<6ced494246c9c64487dee9f409d75f0e>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -77,6 +77,10 @@ bool ReactNativeFeatureFlags::enableGranularShadowTreeStateReconciliation() {
|
||||
return getAccessor().enableGranularShadowTreeStateReconciliation();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::enableLayoutAnimationsOnIOS() {
|
||||
return getAccessor().enableLayoutAnimationsOnIOS();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::enableLongTaskAPI() {
|
||||
return getAccessor().enableLongTaskAPI();
|
||||
}
|
||||
|
||||
@@ -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<<07380f2e1127e32c6c585f6cdf377f36>>
|
||||
* @generated SignedSource<<9aa269f6c9056b4e0e477142554db59a>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -107,6 +107,11 @@ class ReactNativeFeatureFlags {
|
||||
*/
|
||||
RN_EXPORT static bool enableGranularShadowTreeStateReconciliation();
|
||||
|
||||
/**
|
||||
* When enabled, LayoutAnimations API will animate state changes on iOS.
|
||||
*/
|
||||
RN_EXPORT static bool enableLayoutAnimationsOnIOS();
|
||||
|
||||
/**
|
||||
* Enables the reporting of long tasks through `PerformanceObserver`. Only works if the event loop is enabled.
|
||||
*/
|
||||
|
||||
+49
-31
@@ -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<<48fa80b30c7851231dec8cd2ac2e9edb>>
|
||||
* @generated SignedSource<<c1b24faf6a4aa2f663dd8b2c7c762fe4>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -281,6 +281,24 @@ bool ReactNativeFeatureFlagsAccessor::enableGranularShadowTreeStateReconciliatio
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::enableLayoutAnimationsOnIOS() {
|
||||
auto flagValue = enableLayoutAnimationsOnIOS_.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(14, "enableLayoutAnimationsOnIOS");
|
||||
|
||||
flagValue = currentProvider_->enableLayoutAnimationsOnIOS();
|
||||
enableLayoutAnimationsOnIOS_ = flagValue;
|
||||
}
|
||||
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::enableLongTaskAPI() {
|
||||
auto flagValue = enableLongTaskAPI_.load();
|
||||
|
||||
@@ -290,7 +308,7 @@ bool ReactNativeFeatureFlagsAccessor::enableLongTaskAPI() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(14, "enableLongTaskAPI");
|
||||
markFlagAsAccessed(15, "enableLongTaskAPI");
|
||||
|
||||
flagValue = currentProvider_->enableLongTaskAPI();
|
||||
enableLongTaskAPI_ = flagValue;
|
||||
@@ -308,7 +326,7 @@ bool ReactNativeFeatureFlagsAccessor::enableMicrotasks() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(15, "enableMicrotasks");
|
||||
markFlagAsAccessed(16, "enableMicrotasks");
|
||||
|
||||
flagValue = currentProvider_->enableMicrotasks();
|
||||
enableMicrotasks_ = flagValue;
|
||||
@@ -326,7 +344,7 @@ bool ReactNativeFeatureFlagsAccessor::enablePropsUpdateReconciliationAndroid() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(16, "enablePropsUpdateReconciliationAndroid");
|
||||
markFlagAsAccessed(17, "enablePropsUpdateReconciliationAndroid");
|
||||
|
||||
flagValue = currentProvider_->enablePropsUpdateReconciliationAndroid();
|
||||
enablePropsUpdateReconciliationAndroid_ = flagValue;
|
||||
@@ -344,7 +362,7 @@ bool ReactNativeFeatureFlagsAccessor::enableReportEventPaintTime() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(17, "enableReportEventPaintTime");
|
||||
markFlagAsAccessed(18, "enableReportEventPaintTime");
|
||||
|
||||
flagValue = currentProvider_->enableReportEventPaintTime();
|
||||
enableReportEventPaintTime_ = flagValue;
|
||||
@@ -362,7 +380,7 @@ bool ReactNativeFeatureFlagsAccessor::enableSynchronousStateUpdates() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(18, "enableSynchronousStateUpdates");
|
||||
markFlagAsAccessed(19, "enableSynchronousStateUpdates");
|
||||
|
||||
flagValue = currentProvider_->enableSynchronousStateUpdates();
|
||||
enableSynchronousStateUpdates_ = flagValue;
|
||||
@@ -380,7 +398,7 @@ bool ReactNativeFeatureFlagsAccessor::enableUIConsistency() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(19, "enableUIConsistency");
|
||||
markFlagAsAccessed(20, "enableUIConsistency");
|
||||
|
||||
flagValue = currentProvider_->enableUIConsistency();
|
||||
enableUIConsistency_ = flagValue;
|
||||
@@ -398,7 +416,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecycling() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(20, "enableViewRecycling");
|
||||
markFlagAsAccessed(21, "enableViewRecycling");
|
||||
|
||||
flagValue = currentProvider_->enableViewRecycling();
|
||||
enableViewRecycling_ = flagValue;
|
||||
@@ -416,7 +434,7 @@ bool ReactNativeFeatureFlagsAccessor::excludeYogaFromRawProps() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(21, "excludeYogaFromRawProps");
|
||||
markFlagAsAccessed(22, "excludeYogaFromRawProps");
|
||||
|
||||
flagValue = currentProvider_->excludeYogaFromRawProps();
|
||||
excludeYogaFromRawProps_ = flagValue;
|
||||
@@ -434,7 +452,7 @@ bool ReactNativeFeatureFlagsAccessor::fetchImagesInViewPreallocation() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(22, "fetchImagesInViewPreallocation");
|
||||
markFlagAsAccessed(23, "fetchImagesInViewPreallocation");
|
||||
|
||||
flagValue = currentProvider_->fetchImagesInViewPreallocation();
|
||||
fetchImagesInViewPreallocation_ = flagValue;
|
||||
@@ -452,7 +470,7 @@ bool ReactNativeFeatureFlagsAccessor::fixIncorrectScrollViewStateUpdateOnAndroid
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(23, "fixIncorrectScrollViewStateUpdateOnAndroid");
|
||||
markFlagAsAccessed(24, "fixIncorrectScrollViewStateUpdateOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->fixIncorrectScrollViewStateUpdateOnAndroid();
|
||||
fixIncorrectScrollViewStateUpdateOnAndroid_ = flagValue;
|
||||
@@ -470,7 +488,7 @@ bool ReactNativeFeatureFlagsAccessor::fixMappingOfEventPrioritiesBetweenFabricAn
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(24, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
|
||||
markFlagAsAccessed(25, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
|
||||
|
||||
flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact();
|
||||
fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue;
|
||||
@@ -488,7 +506,7 @@ bool ReactNativeFeatureFlagsAccessor::fixMissedFabricStateUpdatesOnAndroid() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(25, "fixMissedFabricStateUpdatesOnAndroid");
|
||||
markFlagAsAccessed(26, "fixMissedFabricStateUpdatesOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->fixMissedFabricStateUpdatesOnAndroid();
|
||||
fixMissedFabricStateUpdatesOnAndroid_ = flagValue;
|
||||
@@ -506,7 +524,7 @@ bool ReactNativeFeatureFlagsAccessor::forceBatchingMountItemsOnAndroid() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(26, "forceBatchingMountItemsOnAndroid");
|
||||
markFlagAsAccessed(27, "forceBatchingMountItemsOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->forceBatchingMountItemsOnAndroid();
|
||||
forceBatchingMountItemsOnAndroid_ = flagValue;
|
||||
@@ -524,7 +542,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxEnabledDebug() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(27, "fuseboxEnabledDebug");
|
||||
markFlagAsAccessed(28, "fuseboxEnabledDebug");
|
||||
|
||||
flagValue = currentProvider_->fuseboxEnabledDebug();
|
||||
fuseboxEnabledDebug_ = flagValue;
|
||||
@@ -542,7 +560,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxEnabledRelease() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(28, "fuseboxEnabledRelease");
|
||||
markFlagAsAccessed(29, "fuseboxEnabledRelease");
|
||||
|
||||
flagValue = currentProvider_->fuseboxEnabledRelease();
|
||||
fuseboxEnabledRelease_ = flagValue;
|
||||
@@ -560,7 +578,7 @@ bool ReactNativeFeatureFlagsAccessor::initEagerTurboModulesOnNativeModulesQueueA
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(29, "initEagerTurboModulesOnNativeModulesQueueAndroid");
|
||||
markFlagAsAccessed(30, "initEagerTurboModulesOnNativeModulesQueueAndroid");
|
||||
|
||||
flagValue = currentProvider_->initEagerTurboModulesOnNativeModulesQueueAndroid();
|
||||
initEagerTurboModulesOnNativeModulesQueueAndroid_ = flagValue;
|
||||
@@ -578,7 +596,7 @@ bool ReactNativeFeatureFlagsAccessor::lazyAnimationCallbacks() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(30, "lazyAnimationCallbacks");
|
||||
markFlagAsAccessed(31, "lazyAnimationCallbacks");
|
||||
|
||||
flagValue = currentProvider_->lazyAnimationCallbacks();
|
||||
lazyAnimationCallbacks_ = flagValue;
|
||||
@@ -596,7 +614,7 @@ bool ReactNativeFeatureFlagsAccessor::loadVectorDrawablesOnImages() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(31, "loadVectorDrawablesOnImages");
|
||||
markFlagAsAccessed(32, "loadVectorDrawablesOnImages");
|
||||
|
||||
flagValue = currentProvider_->loadVectorDrawablesOnImages();
|
||||
loadVectorDrawablesOnImages_ = flagValue;
|
||||
@@ -614,7 +632,7 @@ bool ReactNativeFeatureFlagsAccessor::setAndroidLayoutDirection() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(32, "setAndroidLayoutDirection");
|
||||
markFlagAsAccessed(33, "setAndroidLayoutDirection");
|
||||
|
||||
flagValue = currentProvider_->setAndroidLayoutDirection();
|
||||
setAndroidLayoutDirection_ = flagValue;
|
||||
@@ -632,7 +650,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(34, "traceTurboModulePromiseRejectionsOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid();
|
||||
traceTurboModulePromiseRejectionsOnAndroid_ = flagValue;
|
||||
@@ -650,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(34, "useFabricInterop");
|
||||
markFlagAsAccessed(35, "useFabricInterop");
|
||||
|
||||
flagValue = currentProvider_->useFabricInterop();
|
||||
useFabricInterop_ = flagValue;
|
||||
@@ -668,7 +686,7 @@ bool ReactNativeFeatureFlagsAccessor::useImmediateExecutorInAndroidBridgeless()
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(35, "useImmediateExecutorInAndroidBridgeless");
|
||||
markFlagAsAccessed(36, "useImmediateExecutorInAndroidBridgeless");
|
||||
|
||||
flagValue = currentProvider_->useImmediateExecutorInAndroidBridgeless();
|
||||
useImmediateExecutorInAndroidBridgeless_ = flagValue;
|
||||
@@ -686,7 +704,7 @@ bool ReactNativeFeatureFlagsAccessor::useModernRuntimeScheduler() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(36, "useModernRuntimeScheduler");
|
||||
markFlagAsAccessed(37, "useModernRuntimeScheduler");
|
||||
|
||||
flagValue = currentProvider_->useModernRuntimeScheduler();
|
||||
useModernRuntimeScheduler_ = flagValue;
|
||||
@@ -704,7 +722,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(38, "useNativeViewConfigsInBridgelessMode");
|
||||
|
||||
flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
|
||||
useNativeViewConfigsInBridgelessMode_ = flagValue;
|
||||
@@ -722,7 +740,7 @@ bool ReactNativeFeatureFlagsAccessor::useNewReactImageViewBackgroundDrawing() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(38, "useNewReactImageViewBackgroundDrawing");
|
||||
markFlagAsAccessed(39, "useNewReactImageViewBackgroundDrawing");
|
||||
|
||||
flagValue = currentProvider_->useNewReactImageViewBackgroundDrawing();
|
||||
useNewReactImageViewBackgroundDrawing_ = flagValue;
|
||||
@@ -740,7 +758,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimisedViewPreallocationOnAndroid() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(39, "useOptimisedViewPreallocationOnAndroid");
|
||||
markFlagAsAccessed(40, "useOptimisedViewPreallocationOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->useOptimisedViewPreallocationOnAndroid();
|
||||
useOptimisedViewPreallocationOnAndroid_ = flagValue;
|
||||
@@ -758,7 +776,7 @@ bool ReactNativeFeatureFlagsAccessor::useRuntimeShadowNodeReferenceUpdate() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(40, "useRuntimeShadowNodeReferenceUpdate");
|
||||
markFlagAsAccessed(41, "useRuntimeShadowNodeReferenceUpdate");
|
||||
|
||||
flagValue = currentProvider_->useRuntimeShadowNodeReferenceUpdate();
|
||||
useRuntimeShadowNodeReferenceUpdate_ = flagValue;
|
||||
@@ -776,7 +794,7 @@ bool ReactNativeFeatureFlagsAccessor::useRuntimeShadowNodeReferenceUpdateOnLayou
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(41, "useRuntimeShadowNodeReferenceUpdateOnLayout");
|
||||
markFlagAsAccessed(42, "useRuntimeShadowNodeReferenceUpdateOnLayout");
|
||||
|
||||
flagValue = currentProvider_->useRuntimeShadowNodeReferenceUpdateOnLayout();
|
||||
useRuntimeShadowNodeReferenceUpdateOnLayout_ = flagValue;
|
||||
@@ -794,7 +812,7 @@ bool ReactNativeFeatureFlagsAccessor::useStateAlignmentMechanism() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(42, "useStateAlignmentMechanism");
|
||||
markFlagAsAccessed(43, "useStateAlignmentMechanism");
|
||||
|
||||
flagValue = currentProvider_->useStateAlignmentMechanism();
|
||||
useStateAlignmentMechanism_ = flagValue;
|
||||
@@ -812,7 +830,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(43, "useTurboModuleInterop");
|
||||
markFlagAsAccessed(44, "useTurboModuleInterop");
|
||||
|
||||
flagValue = currentProvider_->useTurboModuleInterop();
|
||||
useTurboModuleInterop_ = 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<<6432ff6056c15e06c9791e629be8aa74>>
|
||||
* @generated SignedSource<<3d703d706bd75f37a4d1af33be80c1ef>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -45,6 +45,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
bool enableFabricLogs();
|
||||
bool enableFabricRendererExclusively();
|
||||
bool enableGranularShadowTreeStateReconciliation();
|
||||
bool enableLayoutAnimationsOnIOS();
|
||||
bool enableLongTaskAPI();
|
||||
bool enableMicrotasks();
|
||||
bool enablePropsUpdateReconciliationAndroid();
|
||||
@@ -85,7 +86,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
|
||||
bool wasOverridden_;
|
||||
|
||||
std::array<std::atomic<const char*>, 44> accessedFeatureFlags_;
|
||||
std::array<std::atomic<const char*>, 45> accessedFeatureFlags_;
|
||||
|
||||
std::atomic<std::optional<bool>> commonTestFlag_;
|
||||
std::atomic<std::optional<bool>> allowRecursiveCommitsWithSynchronousMountOnAndroid_;
|
||||
@@ -101,6 +102,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::atomic<std::optional<bool>> enableFabricLogs_;
|
||||
std::atomic<std::optional<bool>> enableFabricRendererExclusively_;
|
||||
std::atomic<std::optional<bool>> enableGranularShadowTreeStateReconciliation_;
|
||||
std::atomic<std::optional<bool>> enableLayoutAnimationsOnIOS_;
|
||||
std::atomic<std::optional<bool>> enableLongTaskAPI_;
|
||||
std::atomic<std::optional<bool>> enableMicrotasks_;
|
||||
std::atomic<std::optional<bool>> enablePropsUpdateReconciliationAndroid_;
|
||||
|
||||
+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<<88919d5889d0c1a03e0dcdbdcf7adddf>>
|
||||
* @generated SignedSource<<42b958c53ce709e54864e604135633a5>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -83,6 +83,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool enableLayoutAnimationsOnIOS() override {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool enableLongTaskAPI() 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<<4324b1bb52eeb7d73b455abd3758bd0b>>
|
||||
* @generated SignedSource<<d453a8b69f3ed1f6e5652f27a4e29810>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -39,6 +39,7 @@ class ReactNativeFeatureFlagsProvider {
|
||||
virtual bool enableFabricLogs() = 0;
|
||||
virtual bool enableFabricRendererExclusively() = 0;
|
||||
virtual bool enableGranularShadowTreeStateReconciliation() = 0;
|
||||
virtual bool enableLayoutAnimationsOnIOS() = 0;
|
||||
virtual bool enableLongTaskAPI() = 0;
|
||||
virtual bool enableMicrotasks() = 0;
|
||||
virtual bool enablePropsUpdateReconciliationAndroid() = 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<<82f5464427c8411040c595775767a14c>>
|
||||
* @generated SignedSource<<79105bae18d1d43c3d425ddc9e7eb56d>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -107,6 +107,11 @@ bool NativeReactNativeFeatureFlags::enableGranularShadowTreeStateReconciliation(
|
||||
return ReactNativeFeatureFlags::enableGranularShadowTreeStateReconciliation();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::enableLayoutAnimationsOnIOS(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::enableLayoutAnimationsOnIOS();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::enableLongTaskAPI(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::enableLongTaskAPI();
|
||||
|
||||
+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<<b458f14c06be2bc012cdff17a8203d78>>
|
||||
* @generated SignedSource<<de2307f404cdcf679eb1258c9a12cf4b>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -63,6 +63,8 @@ class NativeReactNativeFeatureFlags
|
||||
|
||||
bool enableGranularShadowTreeStateReconciliation(jsi::Runtime& runtime);
|
||||
|
||||
bool enableLayoutAnimationsOnIOS(jsi::Runtime& runtime);
|
||||
|
||||
bool enableLongTaskAPI(jsi::Runtime& runtime);
|
||||
|
||||
bool enableMicrotasks(jsi::Runtime& runtime);
|
||||
|
||||
@@ -101,6 +101,11 @@ const definitions: FeatureFlagDefinitions = {
|
||||
description:
|
||||
'When enabled, the renderer would only fail commits when they propagate state and the last commit that updated state changed before committing.',
|
||||
},
|
||||
enableLayoutAnimationsOnIOS: {
|
||||
defaultValue: true,
|
||||
description:
|
||||
'When enabled, LayoutAnimations API will animate state changes on iOS.',
|
||||
},
|
||||
enableLongTaskAPI: {
|
||||
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<<4ec8afb16cae6c04f166b0c28a906aff>>
|
||||
* @generated SignedSource<<3c32ce3847859db45d2e8bafb3cc31a1>>
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
@@ -60,6 +60,7 @@ export type ReactNativeFeatureFlags = {
|
||||
enableFabricLogs: Getter<boolean>,
|
||||
enableFabricRendererExclusively: Getter<boolean>,
|
||||
enableGranularShadowTreeStateReconciliation: Getter<boolean>,
|
||||
enableLayoutAnimationsOnIOS: Getter<boolean>,
|
||||
enableLongTaskAPI: Getter<boolean>,
|
||||
enableMicrotasks: Getter<boolean>,
|
||||
enablePropsUpdateReconciliationAndroid: Getter<boolean>,
|
||||
@@ -218,6 +219,10 @@ export const enableFabricRendererExclusively: Getter<boolean> = createNativeFlag
|
||||
* When enabled, the renderer would only fail commits when they propagate state and the last commit that updated state changed before committing.
|
||||
*/
|
||||
export const enableGranularShadowTreeStateReconciliation: Getter<boolean> = createNativeFlagGetter('enableGranularShadowTreeStateReconciliation', false);
|
||||
/**
|
||||
* When enabled, LayoutAnimations API will animate state changes on iOS.
|
||||
*/
|
||||
export const enableLayoutAnimationsOnIOS: Getter<boolean> = createNativeFlagGetter('enableLayoutAnimationsOnIOS', true);
|
||||
/**
|
||||
* Enables the reporting of long tasks through `PerformanceObserver`. Only works if the event loop is enabled.
|
||||
*/
|
||||
|
||||
+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<<0795b225c6596461df69e979356a580d>>
|
||||
* @generated SignedSource<<1f1710a12f6980b23bb6c0ece0060b59>>
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
@@ -37,6 +37,7 @@ export interface Spec extends TurboModule {
|
||||
+enableFabricLogs?: () => boolean;
|
||||
+enableFabricRendererExclusively?: () => boolean;
|
||||
+enableGranularShadowTreeStateReconciliation?: () => boolean;
|
||||
+enableLayoutAnimationsOnIOS?: () => boolean;
|
||||
+enableLongTaskAPI?: () => boolean;
|
||||
+enableMicrotasks?: () => boolean;
|
||||
+enablePropsUpdateReconciliationAndroid?: () => boolean;
|
||||
|
||||
Reference in New Issue
Block a user