mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add "enableNativeCSSParsing" feature flag (#49314)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49314 Add a flag which we will use to prefer Fabric CSS parser to ViewConfig processors. We will use this to experiment on iOS, where we are using Fabric props (until Props 2.0 for Android). Changelog: [Internal] Reviewed By: lenaic Differential Revision: D69337803 fbshipit-source-id: e3d4faeecbadb138c0a58f3fca6dba79eb7b13fa
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c60f6fbb2a
commit
69c3c55ddb
+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<<9b03da2a06054bb69a000da22820b3d3>>
|
||||
* @generated SignedSource<<60990f71a42269290b741cd9072d21fe>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -124,6 +124,12 @@ public object ReactNativeFeatureFlags {
|
||||
@JvmStatic
|
||||
public fun enableLongTaskAPI(): Boolean = accessor.enableLongTaskAPI()
|
||||
|
||||
/**
|
||||
* Parse CSS strings using the Fabric CSS parser instead of ViewConfig processing
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun enableNativeCSSParsing(): Boolean = accessor.enableNativeCSSParsing()
|
||||
|
||||
/**
|
||||
* Use BackgroundDrawable and BorderDrawable instead of CSSBackgroundDrawable
|
||||
*/
|
||||
|
||||
+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<<6c4aec34882502876bab914f81758f4f>>
|
||||
* @generated SignedSource<<697f62ac96b2b28d64659cd77007a59b>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -36,6 +36,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
||||
private var enableLayoutAnimationsOnAndroidCache: Boolean? = null
|
||||
private var enableLayoutAnimationsOnIOSCache: Boolean? = null
|
||||
private var enableLongTaskAPICache: Boolean? = null
|
||||
private var enableNativeCSSParsingCache: Boolean? = null
|
||||
private var enableNewBackgroundAndBorderDrawablesCache: Boolean? = null
|
||||
private var enablePreciseSchedulingForPremountItemsOnAndroidCache: Boolean? = null
|
||||
private var enablePropsUpdateReconciliationAndroidCache: Boolean? = null
|
||||
@@ -207,6 +208,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableNativeCSSParsing(): Boolean {
|
||||
var cached = enableNativeCSSParsingCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.enableNativeCSSParsing()
|
||||
enableNativeCSSParsingCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableNewBackgroundAndBorderDrawables(): Boolean {
|
||||
var cached = enableNewBackgroundAndBorderDrawablesCache
|
||||
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<<ca2bdc1f77774cd424f43430f7e59c2d>>
|
||||
* @generated SignedSource<<9e28e6e3e2e7ef27761e3410ea4613a4>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -60,6 +60,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableLongTaskAPI(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableNativeCSSParsing(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableNewBackgroundAndBorderDrawables(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enablePreciseSchedulingForPremountItemsOnAndroid(): 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<<0a7b92a63576665376f0c3deaed210ab>>
|
||||
* @generated SignedSource<<6db30b8e6ac5778ae5ff333a12c6c17d>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -55,6 +55,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
||||
|
||||
override fun enableLongTaskAPI(): Boolean = false
|
||||
|
||||
override fun enableNativeCSSParsing(): Boolean = false
|
||||
|
||||
override fun enableNewBackgroundAndBorderDrawables(): Boolean = false
|
||||
|
||||
override fun enablePreciseSchedulingForPremountItemsOnAndroid(): 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<<674940401c20b6c88d8616890d8f5116>>
|
||||
* @generated SignedSource<<a3e5efb627b5821c18833184e1399303>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -40,6 +40,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
||||
private var enableLayoutAnimationsOnAndroidCache: Boolean? = null
|
||||
private var enableLayoutAnimationsOnIOSCache: Boolean? = null
|
||||
private var enableLongTaskAPICache: Boolean? = null
|
||||
private var enableNativeCSSParsingCache: Boolean? = null
|
||||
private var enableNewBackgroundAndBorderDrawablesCache: Boolean? = null
|
||||
private var enablePreciseSchedulingForPremountItemsOnAndroidCache: Boolean? = null
|
||||
private var enablePropsUpdateReconciliationAndroidCache: Boolean? = null
|
||||
@@ -227,6 +228,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableNativeCSSParsing(): Boolean {
|
||||
var cached = enableNativeCSSParsingCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.enableNativeCSSParsing()
|
||||
accessedFeatureFlags.add("enableNativeCSSParsing")
|
||||
enableNativeCSSParsingCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableNewBackgroundAndBorderDrawables(): Boolean {
|
||||
var cached = enableNewBackgroundAndBorderDrawablesCache
|
||||
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<<5736c271e7289f1f621672d1340426b7>>
|
||||
* @generated SignedSource<<7fb143a0fdf58bc1242ae076cf275037>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -55,6 +55,8 @@ public interface ReactNativeFeatureFlagsProvider {
|
||||
|
||||
@DoNotStrip public fun enableLongTaskAPI(): Boolean
|
||||
|
||||
@DoNotStrip public fun enableNativeCSSParsing(): Boolean
|
||||
|
||||
@DoNotStrip public fun enableNewBackgroundAndBorderDrawables(): Boolean
|
||||
|
||||
@DoNotStrip public fun enablePreciseSchedulingForPremountItemsOnAndroid(): 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<<45cd1dcffa2131da90b86a068e11d396>>
|
||||
* @generated SignedSource<<29ba9a9556698e26eac8e2534bce4732>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -135,6 +135,12 @@ class ReactNativeFeatureFlagsProviderHolder
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool enableNativeCSSParsing() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableNativeCSSParsing");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool enableNewBackgroundAndBorderDrawables() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableNewBackgroundAndBorderDrawables");
|
||||
@@ -375,6 +381,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableLongTaskAPI(
|
||||
return ReactNativeFeatureFlags::enableLongTaskAPI();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::enableNativeCSSParsing(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::enableNativeCSSParsing();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::enableNewBackgroundAndBorderDrawables(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::enableNewBackgroundAndBorderDrawables();
|
||||
@@ -584,6 +595,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
||||
makeNativeMethod(
|
||||
"enableLongTaskAPI",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableLongTaskAPI),
|
||||
makeNativeMethod(
|
||||
"enableNativeCSSParsing",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableNativeCSSParsing),
|
||||
makeNativeMethod(
|
||||
"enableNewBackgroundAndBorderDrawables",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableNewBackgroundAndBorderDrawables),
|
||||
|
||||
+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<<60205d92a1e74e9b21756543bc41b9be>>
|
||||
* @generated SignedSource<<a0a26aa89e2156853ae452368b8f0fc8>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -78,6 +78,9 @@ class JReactNativeFeatureFlagsCxxInterop
|
||||
static bool enableLongTaskAPI(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool enableNativeCSSParsing(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool enableNewBackgroundAndBorderDrawables(
|
||||
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<<dee2f749110388397d1ecc597bd002d8>>
|
||||
* @generated SignedSource<<e11bfe475e88d1cc2b1f65174db555dd>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -90,6 +90,10 @@ bool ReactNativeFeatureFlags::enableLongTaskAPI() {
|
||||
return getAccessor().enableLongTaskAPI();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::enableNativeCSSParsing() {
|
||||
return getAccessor().enableNativeCSSParsing();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::enableNewBackgroundAndBorderDrawables() {
|
||||
return getAccessor().enableNewBackgroundAndBorderDrawables();
|
||||
}
|
||||
|
||||
@@ -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<<7f535343ebc3c6e77c1ff9efce3541c7>>
|
||||
* @generated SignedSource<<7f9d91738a6817bee27c5e0c8ace3686>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -119,6 +119,11 @@ class ReactNativeFeatureFlags {
|
||||
*/
|
||||
RN_EXPORT static bool enableLongTaskAPI();
|
||||
|
||||
/**
|
||||
* Parse CSS strings using the Fabric CSS parser instead of ViewConfig processing
|
||||
*/
|
||||
RN_EXPORT static bool enableNativeCSSParsing();
|
||||
|
||||
/**
|
||||
* Use BackgroundDrawable and BorderDrawable instead of CSSBackgroundDrawable
|
||||
*/
|
||||
|
||||
+45
-27
@@ -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<<aa23fbe6a3d9c2954d03db5032ce8578>>
|
||||
* @generated SignedSource<<569e1a2d92d988c3695ebeb0d937337c>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -317,6 +317,24 @@ bool ReactNativeFeatureFlagsAccessor::enableLongTaskAPI() {
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::enableNativeCSSParsing() {
|
||||
auto flagValue = enableNativeCSSParsing_.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(16, "enableNativeCSSParsing");
|
||||
|
||||
flagValue = currentProvider_->enableNativeCSSParsing();
|
||||
enableNativeCSSParsing_ = flagValue;
|
||||
}
|
||||
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::enableNewBackgroundAndBorderDrawables() {
|
||||
auto flagValue = enableNewBackgroundAndBorderDrawables_.load();
|
||||
|
||||
@@ -326,7 +344,7 @@ bool ReactNativeFeatureFlagsAccessor::enableNewBackgroundAndBorderDrawables() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(16, "enableNewBackgroundAndBorderDrawables");
|
||||
markFlagAsAccessed(17, "enableNewBackgroundAndBorderDrawables");
|
||||
|
||||
flagValue = currentProvider_->enableNewBackgroundAndBorderDrawables();
|
||||
enableNewBackgroundAndBorderDrawables_ = flagValue;
|
||||
@@ -344,7 +362,7 @@ bool ReactNativeFeatureFlagsAccessor::enablePreciseSchedulingForPremountItemsOnA
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(17, "enablePreciseSchedulingForPremountItemsOnAndroid");
|
||||
markFlagAsAccessed(18, "enablePreciseSchedulingForPremountItemsOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->enablePreciseSchedulingForPremountItemsOnAndroid();
|
||||
enablePreciseSchedulingForPremountItemsOnAndroid_ = flagValue;
|
||||
@@ -362,7 +380,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(18, "enablePropsUpdateReconciliationAndroid");
|
||||
markFlagAsAccessed(19, "enablePropsUpdateReconciliationAndroid");
|
||||
|
||||
flagValue = currentProvider_->enablePropsUpdateReconciliationAndroid();
|
||||
enablePropsUpdateReconciliationAndroid_ = flagValue;
|
||||
@@ -380,7 +398,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(19, "enableReportEventPaintTime");
|
||||
markFlagAsAccessed(20, "enableReportEventPaintTime");
|
||||
|
||||
flagValue = currentProvider_->enableReportEventPaintTime();
|
||||
enableReportEventPaintTime_ = flagValue;
|
||||
@@ -398,7 +416,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(20, "enableSynchronousStateUpdates");
|
||||
markFlagAsAccessed(21, "enableSynchronousStateUpdates");
|
||||
|
||||
flagValue = currentProvider_->enableSynchronousStateUpdates();
|
||||
enableSynchronousStateUpdates_ = flagValue;
|
||||
@@ -416,7 +434,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(21, "enableUIConsistency");
|
||||
markFlagAsAccessed(22, "enableUIConsistency");
|
||||
|
||||
flagValue = currentProvider_->enableUIConsistency();
|
||||
enableUIConsistency_ = flagValue;
|
||||
@@ -434,7 +452,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(22, "enableViewCulling");
|
||||
markFlagAsAccessed(23, "enableViewCulling");
|
||||
|
||||
flagValue = currentProvider_->enableViewCulling();
|
||||
enableViewCulling_ = flagValue;
|
||||
@@ -452,7 +470,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(23, "enableViewRecycling");
|
||||
markFlagAsAccessed(24, "enableViewRecycling");
|
||||
|
||||
flagValue = currentProvider_->enableViewRecycling();
|
||||
enableViewRecycling_ = flagValue;
|
||||
@@ -470,7 +488,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(24, "enableViewRecyclingForText");
|
||||
markFlagAsAccessed(25, "enableViewRecyclingForText");
|
||||
|
||||
flagValue = currentProvider_->enableViewRecyclingForText();
|
||||
enableViewRecyclingForText_ = flagValue;
|
||||
@@ -488,7 +506,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(25, "enableViewRecyclingForView");
|
||||
markFlagAsAccessed(26, "enableViewRecyclingForView");
|
||||
|
||||
flagValue = currentProvider_->enableViewRecyclingForView();
|
||||
enableViewRecyclingForView_ = flagValue;
|
||||
@@ -506,7 +524,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(26, "excludeYogaFromRawProps");
|
||||
markFlagAsAccessed(27, "excludeYogaFromRawProps");
|
||||
|
||||
flagValue = currentProvider_->excludeYogaFromRawProps();
|
||||
excludeYogaFromRawProps_ = flagValue;
|
||||
@@ -524,7 +542,7 @@ bool ReactNativeFeatureFlagsAccessor::fixDifferentiatorEmittingUpdatesWithWrongP
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(27, "fixDifferentiatorEmittingUpdatesWithWrongParentTag");
|
||||
markFlagAsAccessed(28, "fixDifferentiatorEmittingUpdatesWithWrongParentTag");
|
||||
|
||||
flagValue = currentProvider_->fixDifferentiatorEmittingUpdatesWithWrongParentTag();
|
||||
fixDifferentiatorEmittingUpdatesWithWrongParentTag_ = flagValue;
|
||||
@@ -542,7 +560,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(28, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
|
||||
markFlagAsAccessed(29, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
|
||||
|
||||
flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact();
|
||||
fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue;
|
||||
@@ -560,7 +578,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(29, "fixMountingCoordinatorReportedPendingTransactionsOnAndroid");
|
||||
markFlagAsAccessed(30, "fixMountingCoordinatorReportedPendingTransactionsOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->fixMountingCoordinatorReportedPendingTransactionsOnAndroid();
|
||||
fixMountingCoordinatorReportedPendingTransactionsOnAndroid_ = flagValue;
|
||||
@@ -578,7 +596,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(30, "fuseboxEnabledRelease");
|
||||
markFlagAsAccessed(31, "fuseboxEnabledRelease");
|
||||
|
||||
flagValue = currentProvider_->fuseboxEnabledRelease();
|
||||
fuseboxEnabledRelease_ = flagValue;
|
||||
@@ -596,7 +614,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(31, "fuseboxNetworkInspectionEnabled");
|
||||
markFlagAsAccessed(32, "fuseboxNetworkInspectionEnabled");
|
||||
|
||||
flagValue = currentProvider_->fuseboxNetworkInspectionEnabled();
|
||||
fuseboxNetworkInspectionEnabled_ = flagValue;
|
||||
@@ -614,7 +632,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(32, "lazyAnimationCallbacks");
|
||||
markFlagAsAccessed(33, "lazyAnimationCallbacks");
|
||||
|
||||
flagValue = currentProvider_->lazyAnimationCallbacks();
|
||||
lazyAnimationCallbacks_ = 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::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(35, "useAlwaysAvailableJSErrorHandling");
|
||||
|
||||
flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling();
|
||||
useAlwaysAvailableJSErrorHandling_ = flagValue;
|
||||
@@ -668,7 +686,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(36, "useEditTextStockAndroidFocusBehavior");
|
||||
|
||||
flagValue = currentProvider_->useEditTextStockAndroidFocusBehavior();
|
||||
useEditTextStockAndroidFocusBehavior_ = flagValue;
|
||||
@@ -686,7 +704,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(37, "useFabricInterop");
|
||||
|
||||
flagValue = currentProvider_->useFabricInterop();
|
||||
useFabricInterop_ = 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::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(39, "useOptimizedEventBatchingOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->useOptimizedEventBatchingOnAndroid();
|
||||
useOptimizedEventBatchingOnAndroid_ = flagValue;
|
||||
@@ -740,7 +758,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(40, "useRawPropsJsiValue");
|
||||
|
||||
flagValue = currentProvider_->useRawPropsJsiValue();
|
||||
useRawPropsJsiValue_ = flagValue;
|
||||
@@ -758,7 +776,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(41, "useTurboModuleInterop");
|
||||
|
||||
flagValue = currentProvider_->useTurboModuleInterop();
|
||||
useTurboModuleInterop_ = flagValue;
|
||||
@@ -776,7 +794,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(42, "useTurboModules");
|
||||
|
||||
flagValue = currentProvider_->useTurboModules();
|
||||
useTurboModules_ = 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<<193ecc14d6db3eeba75f1c9cbeaed0c9>>
|
||||
* @generated SignedSource<<faf54ae7c4ef9bc2dcad119f70581754>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -48,6 +48,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
bool enableLayoutAnimationsOnAndroid();
|
||||
bool enableLayoutAnimationsOnIOS();
|
||||
bool enableLongTaskAPI();
|
||||
bool enableNativeCSSParsing();
|
||||
bool enableNewBackgroundAndBorderDrawables();
|
||||
bool enablePreciseSchedulingForPremountItemsOnAndroid();
|
||||
bool enablePropsUpdateReconciliationAndroid();
|
||||
@@ -85,7 +86,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
|
||||
bool wasOverridden_;
|
||||
|
||||
std::array<std::atomic<const char*>, 42> accessedFeatureFlags_;
|
||||
std::array<std::atomic<const char*>, 43> accessedFeatureFlags_;
|
||||
|
||||
std::atomic<std::optional<bool>> commonTestFlag_;
|
||||
std::atomic<std::optional<bool>> disableMountItemReorderingAndroid_;
|
||||
@@ -103,6 +104,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::atomic<std::optional<bool>> enableLayoutAnimationsOnAndroid_;
|
||||
std::atomic<std::optional<bool>> enableLayoutAnimationsOnIOS_;
|
||||
std::atomic<std::optional<bool>> enableLongTaskAPI_;
|
||||
std::atomic<std::optional<bool>> enableNativeCSSParsing_;
|
||||
std::atomic<std::optional<bool>> enableNewBackgroundAndBorderDrawables_;
|
||||
std::atomic<std::optional<bool>> enablePreciseSchedulingForPremountItemsOnAndroid_;
|
||||
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<<b13c582c678143b6ea3343d4f55574b1>>
|
||||
* @generated SignedSource<<c6a8b105e4657ef398ab9dd548ebeff0>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -91,6 +91,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool enableNativeCSSParsing() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool enableNewBackgroundAndBorderDrawables() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
+10
-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<<b031924a95baa03c978541cf376cfb6d>>
|
||||
* @generated SignedSource<<ef09e15c51a69db7d3c66fd5f096314e>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -189,6 +189,15 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
|
||||
return ReactNativeFeatureFlagsDefaults::enableLongTaskAPI();
|
||||
}
|
||||
|
||||
bool enableNativeCSSParsing() override {
|
||||
auto value = values_["enableNativeCSSParsing"];
|
||||
if (!value.isNull()) {
|
||||
return value.getBool();
|
||||
}
|
||||
|
||||
return ReactNativeFeatureFlagsDefaults::enableNativeCSSParsing();
|
||||
}
|
||||
|
||||
bool enableNewBackgroundAndBorderDrawables() override {
|
||||
auto value = values_["enableNewBackgroundAndBorderDrawables"];
|
||||
if (!value.isNull()) {
|
||||
|
||||
+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<<13e9d18cc4177f5c2c87cef80982e551>>
|
||||
* @generated SignedSource<<b40ca96bcb72e91578320384e6d26401>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -41,6 +41,7 @@ class ReactNativeFeatureFlagsProvider {
|
||||
virtual bool enableLayoutAnimationsOnAndroid() = 0;
|
||||
virtual bool enableLayoutAnimationsOnIOS() = 0;
|
||||
virtual bool enableLongTaskAPI() = 0;
|
||||
virtual bool enableNativeCSSParsing() = 0;
|
||||
virtual bool enableNewBackgroundAndBorderDrawables() = 0;
|
||||
virtual bool enablePreciseSchedulingForPremountItemsOnAndroid() = 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<<dc8b83517469455dd4d4367bcaff6782>>
|
||||
* @generated SignedSource<<4f565477e7fd49756af7e8ac548c09a2>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -124,6 +124,11 @@ bool NativeReactNativeFeatureFlags::enableLongTaskAPI(
|
||||
return ReactNativeFeatureFlags::enableLongTaskAPI();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::enableNativeCSSParsing(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::enableNativeCSSParsing();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::enableNewBackgroundAndBorderDrawables(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::enableNewBackgroundAndBorderDrawables();
|
||||
|
||||
+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<<cd99847ee4b9988f4a69edef5b29e8dc>>
|
||||
* @generated SignedSource<<9f27af3cebde0b0befb40a5bda2c2f0e>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -69,6 +69,8 @@ class NativeReactNativeFeatureFlags
|
||||
|
||||
bool enableLongTaskAPI(jsi::Runtime& runtime);
|
||||
|
||||
bool enableNativeCSSParsing(jsi::Runtime& runtime);
|
||||
|
||||
bool enableNewBackgroundAndBorderDrawables(jsi::Runtime& runtime);
|
||||
|
||||
bool enablePreciseSchedulingForPremountItemsOnAndroid(jsi::Runtime& runtime);
|
||||
|
||||
@@ -214,6 +214,17 @@ const definitions: FeatureFlagDefinitions = {
|
||||
},
|
||||
ossReleaseStage: 'none',
|
||||
},
|
||||
enableNativeCSSParsing: {
|
||||
defaultValue: false,
|
||||
metadata: {
|
||||
dateAdded: '2025-02-07',
|
||||
description:
|
||||
'Parse CSS strings using the Fabric CSS parser instead of ViewConfig processing',
|
||||
expectedReleaseValue: true,
|
||||
purpose: 'experimentation',
|
||||
},
|
||||
ossReleaseStage: 'none',
|
||||
},
|
||||
enableNewBackgroundAndBorderDrawables: {
|
||||
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<<8d7bf5f009dd69371e661b29116eec65>>
|
||||
* @generated SignedSource<<7f675a8e759b564728cfc96c1a3af7b1>>
|
||||
* @flow strict
|
||||
*/
|
||||
|
||||
@@ -65,6 +65,7 @@ export type ReactNativeFeatureFlags = $ReadOnly<{
|
||||
enableLayoutAnimationsOnAndroid: Getter<boolean>,
|
||||
enableLayoutAnimationsOnIOS: Getter<boolean>,
|
||||
enableLongTaskAPI: Getter<boolean>,
|
||||
enableNativeCSSParsing: Getter<boolean>,
|
||||
enableNewBackgroundAndBorderDrawables: Getter<boolean>,
|
||||
enablePreciseSchedulingForPremountItemsOnAndroid: Getter<boolean>,
|
||||
enablePropsUpdateReconciliationAndroid: Getter<boolean>,
|
||||
@@ -236,6 +237,10 @@ export const enableLayoutAnimationsOnIOS: Getter<boolean> = createNativeFlagGett
|
||||
* Enables the reporting of long tasks through `PerformanceObserver`. Only works if the event loop is enabled.
|
||||
*/
|
||||
export const enableLongTaskAPI: Getter<boolean> = createNativeFlagGetter('enableLongTaskAPI', false);
|
||||
/**
|
||||
* Parse CSS strings using the Fabric CSS parser instead of ViewConfig processing
|
||||
*/
|
||||
export const enableNativeCSSParsing: Getter<boolean> = createNativeFlagGetter('enableNativeCSSParsing', false);
|
||||
/**
|
||||
* Use BackgroundDrawable and BorderDrawable instead of CSSBackgroundDrawable
|
||||
*/
|
||||
|
||||
+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<<caa58549cc5d5f8b5f690240af39c1d2>>
|
||||
* @generated SignedSource<<698e092ea2501b8d0c907f3b7085da3b>>
|
||||
* @flow strict
|
||||
*/
|
||||
|
||||
@@ -40,6 +40,7 @@ export interface Spec extends TurboModule {
|
||||
+enableLayoutAnimationsOnAndroid?: () => boolean;
|
||||
+enableLayoutAnimationsOnIOS?: () => boolean;
|
||||
+enableLongTaskAPI?: () => boolean;
|
||||
+enableNativeCSSParsing?: () => boolean;
|
||||
+enableNewBackgroundAndBorderDrawables?: () => boolean;
|
||||
+enablePreciseSchedulingForPremountItemsOnAndroid?: () => boolean;
|
||||
+enablePropsUpdateReconciliationAndroid?: () => boolean;
|
||||
|
||||
Reference in New Issue
Block a user