mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Send only changed props on Insert of preallocated views with accumulated raw props (#58770)
Summary:
With `enableAccumulatedUpdatesInRawPropsAndroid`, `FabricMountingManager` handles every Insert by emitting `UpdateProps({}, new)`, which sends the view's full props again. The view already received those props at preallocation or from its Create item. So every inserted view's props are serialized and applied twice. The pull model (`enableMountingCoordinatorPullModelAndroid`) requires accumulated raw props and preallocates new views before the UI thread pulls the transaction, so under the pull model both happen on the UI thread.
For components with a Props 2.0 diff (`View`, with `enablePropsUpdateReconciliationAndroid`), this is also a correctness bug. The second payload is diffed against default props. If a prop goes back to its default between preallocation and mount, it is never sent, and the view keeps the preallocated value.
This PR adds `enablePreallocatedPropsDiffOnInsertAndroid`. It is off by default and only takes effect together with accumulated raw props.
- The allocated view registry also keeps the props each view was preallocated with, until the view's first Insert.
- That Insert sends only the difference between the preallocated and inserted props, or nothing when they are the same.
- A view created by a Create item already has its props, so its Insert sends nothing.
- A re-Insert of a mounted view (a move) also sends nothing. Its prop changes arrive through the Update mutation the differ emits with it.
- Held props are released on the first Insert, when an unmounted node is destroyed, or when the surface stops.
- With the flag off, the registry stores no props and the Insert path is unchanged.
In debug builds, Inserts of preallocated views now go through the Props 1.5 vs Props 2.0 validation in `getProps`. It can log props that Props 2.0 does not cover yet.
The flag keeps the change separately testable while `enableAccumulatedUpdatesInRawPropsAndroid` is being evaluated. The intent is to fold it into that flag once validated. I'm happy to make it unconditional now if that is preferred.
## Changelog:
[Internal] - Add `enablePreallocatedPropsDiffOnInsertAndroid`, which stops re-sending all props on Insert of preallocated views when `enableAccumulatedUpdatesInRawPropsAndroid` is on
Pull Request resolved: https://github.com/react/react-native/pull/58770
Test Plan:
- `yarn featureflags --verify-unchanged` and `yarn test packages/react-native/src/private/featureflags` pass. `yarn format-check-cpp` passes.
- `FabricMountingManager.cpp` compiles with the ReactAndroid arm64-v8a NDK flags. I did not run a full RNTester Android build of this exact revision.
- The runtime checks below used an earlier revision of this change with identical behaviour. The build also contained unrelated local fixes, present in both arms.
- Emulator, pull model and Props 2.0 flags on: a view whose `backgroundColor` and `opacity` are reset to their defaults between preallocation and mount keeps the old values with the flag off. With the flag on, it shows the defaults.
- OPPO A16 (low-end Android), release build, pull model and Props 2.0 flags on. The benchmark is a native screen that opens a React Native surface with placeholder cards, then a list of 24 cards. "First render" is the first React Native frame drawn. "Content drawn" is the first frame with the list. Flag on vs off in the same build:
| | flag off | flag on |
|---|---|---|
| Props updates on Insert, first render / content (Perfetto, 5 runs) | 90 / 100 | 2 / 0 |
| First render, median (35 runs per arm) | 384.8 ms | 364.2 ms |
| Content drawn, median (35 runs per arm) | 1209.6 ms | 1186.6 ms |
Paired within-round differences, 35 pairs: first render −20.6 ms [95% CI −26.8, −15.0], content drawn −22.0 ms [−43.4, −18.4]. Arms were interleaved.
Reviewed By: lenaic
Differential Revision: D122571252
Pulled By: bartlomiejbloniarz
fbshipit-source-id: 5922dd88f276ab41f0b57d851b89786fa4e3a6ec
This commit is contained in:
1 parent
db735cafb3
commit
7c007b3430
22 files changed
+226
-82
No files matched your search
+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<<a39494512e761e266940e5d1853f38fc>>
|
||||
* @generated SignedSource<<86390dbd6b2c57cb4f8cdd7cb73cc1f7>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -300,6 +300,12 @@ public object ReactNativeFeatureFlags {
|
||||
@JvmStatic
|
||||
public fun enableNativeCSSParsing(): Boolean = accessor.enableNativeCSSParsing()
|
||||
|
||||
/**
|
||||
* When enabled together with `enableAccumulatedUpdatesInRawPropsAndroid`, the Insert of a preallocated view only sends the difference between the props the view was preallocated with and the inserted props, instead of sending all props again on every Insert.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun enablePreallocatedPropsDiffOnInsertAndroid(): Boolean = accessor.enablePreallocatedPropsDiffOnInsertAndroid()
|
||||
|
||||
/**
|
||||
* Enables caching text layout artifacts for later reuse
|
||||
*/
|
||||
|
||||
+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<<cd1753241fa2f51c23cd4e01ffe3f18c>>
|
||||
* @generated SignedSource<<3e939eebe846d12cab15905db8efba18>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -65,6 +65,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
||||
private var enableMountingCoordinatorPullModelAndroidCache: Boolean? = null
|
||||
private var enableMutationObserverByDefaultCache: Boolean? = null
|
||||
private var enableNativeCSSParsingCache: Boolean? = null
|
||||
private var enablePreallocatedPropsDiffOnInsertAndroidCache: Boolean? = null
|
||||
private var enablePreparedTextLayoutCache: Boolean? = null
|
||||
private var enablePropsUpdateReconciliationAndroidCache: Boolean? = null
|
||||
private var enableResizeObserverByDefaultCache: Boolean? = null
|
||||
@@ -515,6 +516,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enablePreallocatedPropsDiffOnInsertAndroid(): Boolean {
|
||||
var cached = enablePreallocatedPropsDiffOnInsertAndroidCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.enablePreallocatedPropsDiffOnInsertAndroid()
|
||||
enablePreallocatedPropsDiffOnInsertAndroidCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enablePreparedTextLayout(): Boolean {
|
||||
var cached = enablePreparedTextLayoutCache
|
||||
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<<eb8737673aaec0b1eda6ae2ebc0b9970>>
|
||||
* @generated SignedSource<<da34d40665437b2901de2ca5f0bee7c1>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -118,6 +118,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableNativeCSSParsing(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enablePreallocatedPropsDiffOnInsertAndroid(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enablePreparedTextLayout(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enablePropsUpdateReconciliationAndroid(): 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<<890e204b6cf8afef481f64de44766edf>>
|
||||
* @generated SignedSource<<0f4c074c11c564f05950eab73a8fd452>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -113,6 +113,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
||||
|
||||
override fun enableNativeCSSParsing(): Boolean = false
|
||||
|
||||
override fun enablePreallocatedPropsDiffOnInsertAndroid(): Boolean = false
|
||||
|
||||
override fun enablePreparedTextLayout(): Boolean = false
|
||||
|
||||
override fun enablePropsUpdateReconciliationAndroid(): 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<<9044f0df865ba9d7668f9ff391d21911>>
|
||||
* @generated SignedSource<<013790bd2c3fa8b9ff03e8c5e924bf91>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -69,6 +69,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
||||
private var enableMountingCoordinatorPullModelAndroidCache: Boolean? = null
|
||||
private var enableMutationObserverByDefaultCache: Boolean? = null
|
||||
private var enableNativeCSSParsingCache: Boolean? = null
|
||||
private var enablePreallocatedPropsDiffOnInsertAndroidCache: Boolean? = null
|
||||
private var enablePreparedTextLayoutCache: Boolean? = null
|
||||
private var enablePropsUpdateReconciliationAndroidCache: Boolean? = null
|
||||
private var enableResizeObserverByDefaultCache: Boolean? = null
|
||||
@@ -564,6 +565,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enablePreallocatedPropsDiffOnInsertAndroid(): Boolean {
|
||||
var cached = enablePreallocatedPropsDiffOnInsertAndroidCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.enablePreallocatedPropsDiffOnInsertAndroid()
|
||||
accessedFeatureFlags.add("enablePreallocatedPropsDiffOnInsertAndroid")
|
||||
enablePreallocatedPropsDiffOnInsertAndroidCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enablePreparedTextLayout(): Boolean {
|
||||
var cached = enablePreparedTextLayoutCache
|
||||
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<<cfd99e53a077549124370e6bb123ba43>>
|
||||
* @generated SignedSource<<6607c8678df2693c361f6d8091483662>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -113,6 +113,8 @@ public interface ReactNativeFeatureFlagsProvider {
|
||||
|
||||
@DoNotStrip public fun enableNativeCSSParsing(): Boolean
|
||||
|
||||
@DoNotStrip public fun enablePreallocatedPropsDiffOnInsertAndroid(): Boolean
|
||||
|
||||
@DoNotStrip public fun enablePreparedTextLayout(): Boolean
|
||||
|
||||
@DoNotStrip public fun enablePropsUpdateReconciliationAndroid(): Boolean
|
||||
|
||||
+38
-16
@@ -46,7 +46,7 @@ FabricMountingManager::~FabricMountingManager() {
|
||||
void FabricMountingManager::onSurfaceStart(SurfaceId surfaceId) {
|
||||
std::lock_guard lock(allocatedViewsMutex_);
|
||||
allocatedViewRegistry_.emplace(
|
||||
surfaceId, std::unordered_set<Tag>({surfaceId}));
|
||||
surfaceId, std::unordered_map<Tag, Props::Shared>{{surfaceId, nullptr}});
|
||||
}
|
||||
|
||||
void FabricMountingManager::onSurfaceStop(SurfaceId surfaceId) {
|
||||
@@ -311,6 +311,11 @@ inline float scale(Float value, Float pointScaleFactor) {
|
||||
return result;
|
||||
}
|
||||
|
||||
bool shouldDiffInsertPropsAgainstPreallocatedProps() {
|
||||
return ReactNativeFeatureFlags::enableAccumulatedUpdatesInRawPropsAndroid() &&
|
||||
ReactNativeFeatureFlags::enablePreallocatedPropsDiffOnInsertAndroid();
|
||||
}
|
||||
|
||||
jni::local_ref<jobject> getProps(
|
||||
const ShadowView& oldShadowView,
|
||||
const ShadowView& newShadowView) {
|
||||
@@ -609,12 +614,12 @@ void FabricMountingManager::executeMount(
|
||||
std::lock_guard allocatedViewsLock(allocatedViewsMutex_);
|
||||
|
||||
auto allocatedViewsIterator = allocatedViewRegistry_.find(surfaceId);
|
||||
auto defaultAllocatedViews = std::unordered_set<Tag>{};
|
||||
auto defaultAllocatedViews = std::unordered_map<Tag, Props::Shared>{};
|
||||
// Do not remove `defaultAllocatedViews` or initialize
|
||||
// `std::unordered_set<Tag>{}` inline in below ternary expression - if falsy
|
||||
// operand is a value type, the compiler will decide the expression to be a
|
||||
// value type, an unnecessary (sometimes expensive) copy will happen as a
|
||||
// result.
|
||||
// `std::unordered_map<Tag, Props::Shared>{}` inline in below ternary
|
||||
// expression - if falsy operand is a value type, the compiler will decide
|
||||
// the expression to be a value type, an unnecessary (sometimes expensive)
|
||||
// copy will happen as a result.
|
||||
auto& allocatedViewTags =
|
||||
allocatedViewsIterator != allocatedViewRegistry_.end()
|
||||
? allocatedViewsIterator->second
|
||||
@@ -640,7 +645,7 @@ void FabricMountingManager::executeMount(
|
||||
if (shouldCreateView) {
|
||||
cppCommonMountItems.push_back(
|
||||
CppMountItem::CreateMountItem(newChildShadowView));
|
||||
allocatedViewTags.insert(newChildShadowView.tag);
|
||||
allocatedViewTags.emplace(newChildShadowView.tag, nullptr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -734,19 +739,34 @@ void FabricMountingManager::executeMount(
|
||||
CppMountItem::InsertMountItem(
|
||||
parentTag, newChildShadowView, index));
|
||||
|
||||
bool shouldCreateView =
|
||||
!allocatedViewTags.contains(newChildShadowView.tag);
|
||||
auto allocatedView = allocatedViewTags.find(newChildShadowView.tag);
|
||||
bool shouldCreateView = allocatedView == allocatedViewTags.end();
|
||||
if (ReactNativeFeatureFlags::
|
||||
enableAccumulatedUpdatesInRawPropsAndroid()) {
|
||||
if (shouldCreateView) {
|
||||
LOG(ERROR) << "Emitting insert for unallocated view "
|
||||
<< newChildShadowView.tag;
|
||||
}
|
||||
(maintainMutationOrder ? cppCommonMountItems
|
||||
: cppUpdatePropsMountItems)
|
||||
.push_back(
|
||||
CppMountItem::UpdatePropsMountItem(
|
||||
{}, newChildShadowView));
|
||||
if (shouldCreateView ||
|
||||
!shouldDiffInsertPropsAgainstPreallocatedProps()) {
|
||||
(maintainMutationOrder ? cppCommonMountItems
|
||||
: cppUpdatePropsMountItems)
|
||||
.push_back(
|
||||
CppMountItem::UpdatePropsMountItem(
|
||||
{}, newChildShadowView));
|
||||
} else if (auto& preallocatedProps = allocatedView->second;
|
||||
preallocatedProps != nullptr) {
|
||||
if (preallocatedProps != newChildShadowView.props) {
|
||||
auto preallocatedShadowView = newChildShadowView;
|
||||
preallocatedShadowView.props = preallocatedProps;
|
||||
(maintainMutationOrder ? cppCommonMountItems
|
||||
: cppUpdatePropsMountItems)
|
||||
.push_back(
|
||||
CppMountItem::UpdatePropsMountItem(
|
||||
preallocatedShadowView, newChildShadowView));
|
||||
}
|
||||
preallocatedProps = nullptr;
|
||||
}
|
||||
} else {
|
||||
if (shouldCreateView) {
|
||||
LOG(ERROR) << "Emitting insert for unallocated view "
|
||||
@@ -1107,8 +1127,10 @@ void FabricMountingManager::preallocateShadowView(
|
||||
if (allocatedViewsIterator == allocatedViewRegistry_.end()) {
|
||||
return;
|
||||
}
|
||||
const auto [_, inserted] =
|
||||
allocatedViewsIterator->second.insert(shadowView.tag);
|
||||
const auto [_, inserted] = allocatedViewsIterator->second.emplace(
|
||||
shadowView.tag,
|
||||
shouldDiffInsertPropsAgainstPreallocatedProps() ? shadowView.props
|
||||
: nullptr);
|
||||
if (!inserted) {
|
||||
return;
|
||||
}
|
||||
|
||||
+7
-2
@@ -9,10 +9,10 @@
|
||||
|
||||
#include <mutex>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
#include <fbjni/fbjni.h>
|
||||
#include <react/fabric/JFabricUIManager.h>
|
||||
#include <react/renderer/core/Props.h>
|
||||
#include <react/renderer/uimanager/primitives.h>
|
||||
|
||||
namespace facebook::react {
|
||||
@@ -109,7 +109,12 @@ class FabricMountingManager final {
|
||||
*/
|
||||
std::vector<ShadowView> preallocatedViewsQueue_{};
|
||||
|
||||
std::unordered_map<SurfaceId, std::unordered_set<Tag>> allocatedViewRegistry_{};
|
||||
/*
|
||||
* Allocated tags per surface. With enablePreallocatedPropsDiffOnInsertAndroid
|
||||
* a preallocated tag maps to the props it was preallocated with until its
|
||||
* first Insert; every other tag maps to nullptr.
|
||||
*/
|
||||
std::unordered_map<SurfaceId, std::unordered_map<Tag, Props::Shared>> allocatedViewRegistry_{};
|
||||
std::recursive_mutex allocatedViewsMutex_;
|
||||
};
|
||||
|
||||
|
||||
+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<<e6f56d60147d5c08e0b38549b9956e52>>
|
||||
* @generated SignedSource<<dad8d48d93f01fc5ec68f70dbd9a9e73>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -309,6 +309,12 @@ class ReactNativeFeatureFlagsJavaProvider
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool enablePreallocatedPropsDiffOnInsertAndroid() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enablePreallocatedPropsDiffOnInsertAndroid");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool enablePreparedTextLayout() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enablePreparedTextLayout");
|
||||
@@ -802,6 +808,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableNativeCSSParsing(
|
||||
return ReactNativeFeatureFlags::enableNativeCSSParsing();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::enablePreallocatedPropsDiffOnInsertAndroid(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::enablePreallocatedPropsDiffOnInsertAndroid();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::enablePreparedTextLayout(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::enablePreparedTextLayout();
|
||||
@@ -1188,6 +1199,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
||||
makeNativeMethod(
|
||||
"enableNativeCSSParsing",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableNativeCSSParsing),
|
||||
makeNativeMethod(
|
||||
"enablePreallocatedPropsDiffOnInsertAndroid",
|
||||
JReactNativeFeatureFlagsCxxInterop::enablePreallocatedPropsDiffOnInsertAndroid),
|
||||
makeNativeMethod(
|
||||
"enablePreparedTextLayout",
|
||||
JReactNativeFeatureFlagsCxxInterop::enablePreparedTextLayout),
|
||||
|
||||
+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<<25d66101785e737822e86d218789912d>>
|
||||
* @generated SignedSource<<7a9a9c1938c3e01f589e05fffe349ad3>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -165,6 +165,9 @@ class JReactNativeFeatureFlagsCxxInterop
|
||||
static bool enableNativeCSSParsing(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool enablePreallocatedPropsDiffOnInsertAndroid(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool enablePreparedTextLayout(
|
||||
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<<8b8b80ac3744a205b20cfd0627856fba>>
|
||||
* @generated SignedSource<<8b23b6ea5f2d377f8126adffd753dae7>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -206,6 +206,10 @@ bool ReactNativeFeatureFlags::enableNativeCSSParsing() {
|
||||
return getAccessor().enableNativeCSSParsing();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::enablePreallocatedPropsDiffOnInsertAndroid() {
|
||||
return getAccessor().enablePreallocatedPropsDiffOnInsertAndroid();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::enablePreparedTextLayout() {
|
||||
return getAccessor().enablePreparedTextLayout();
|
||||
}
|
||||
|
||||
@@ -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<<4c93a39dd2a8ee5ba24f3f8bc99ac1ae>>
|
||||
* @generated SignedSource<<aef7d6ac25fdeb2423ebf4a2a9ac6f2e>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -266,6 +266,11 @@ class ReactNativeFeatureFlags {
|
||||
*/
|
||||
RN_EXPORT static bool enableNativeCSSParsing();
|
||||
|
||||
/**
|
||||
* When enabled together with `enableAccumulatedUpdatesInRawPropsAndroid`, the Insert of a preallocated view only sends the difference between the props the view was preallocated with and the inserted props, instead of sending all props again on every Insert.
|
||||
*/
|
||||
RN_EXPORT static bool enablePreallocatedPropsDiffOnInsertAndroid();
|
||||
|
||||
/**
|
||||
* Enables caching text layout artifacts for later reuse
|
||||
*/
|
||||
|
||||
+63
-45
@@ -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<<fc4bc1fa9eb12f2e5a7c2af6defd7dff>>
|
||||
* @generated SignedSource<<c5d4c827384d9d0e678a5b93f1b6c23b>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -839,6 +839,24 @@ bool ReactNativeFeatureFlagsAccessor::enableNativeCSSParsing() {
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::enablePreallocatedPropsDiffOnInsertAndroid() {
|
||||
auto flagValue = enablePreallocatedPropsDiffOnInsertAndroid_.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(45, "enablePreallocatedPropsDiffOnInsertAndroid");
|
||||
|
||||
flagValue = currentProvider_->enablePreallocatedPropsDiffOnInsertAndroid();
|
||||
enablePreallocatedPropsDiffOnInsertAndroid_ = flagValue;
|
||||
}
|
||||
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::enablePreparedTextLayout() {
|
||||
auto flagValue = enablePreparedTextLayout_.load();
|
||||
|
||||
@@ -848,7 +866,7 @@ bool ReactNativeFeatureFlagsAccessor::enablePreparedTextLayout() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(45, "enablePreparedTextLayout");
|
||||
markFlagAsAccessed(46, "enablePreparedTextLayout");
|
||||
|
||||
flagValue = currentProvider_->enablePreparedTextLayout();
|
||||
enablePreparedTextLayout_ = flagValue;
|
||||
@@ -866,7 +884,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(46, "enablePropsUpdateReconciliationAndroid");
|
||||
markFlagAsAccessed(47, "enablePropsUpdateReconciliationAndroid");
|
||||
|
||||
flagValue = currentProvider_->enablePropsUpdateReconciliationAndroid();
|
||||
enablePropsUpdateReconciliationAndroid_ = flagValue;
|
||||
@@ -884,7 +902,7 @@ bool ReactNativeFeatureFlagsAccessor::enableResizeObserverByDefault() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(47, "enableResizeObserverByDefault");
|
||||
markFlagAsAccessed(48, "enableResizeObserverByDefault");
|
||||
|
||||
flagValue = currentProvider_->enableResizeObserverByDefault();
|
||||
enableResizeObserverByDefault_ = flagValue;
|
||||
@@ -902,7 +920,7 @@ bool ReactNativeFeatureFlagsAccessor::enableSwiftUIBasedFilters() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(48, "enableSwiftUIBasedFilters");
|
||||
markFlagAsAccessed(49, "enableSwiftUIBasedFilters");
|
||||
|
||||
flagValue = currentProvider_->enableSwiftUIBasedFilters();
|
||||
enableSwiftUIBasedFilters_ = flagValue;
|
||||
@@ -920,7 +938,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(49, "enableViewCulling");
|
||||
markFlagAsAccessed(50, "enableViewCulling");
|
||||
|
||||
flagValue = currentProvider_->enableViewCulling();
|
||||
enableViewCulling_ = flagValue;
|
||||
@@ -938,7 +956,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(50, "enableViewRecycling");
|
||||
markFlagAsAccessed(51, "enableViewRecycling");
|
||||
|
||||
flagValue = currentProvider_->enableViewRecycling();
|
||||
enableViewRecycling_ = flagValue;
|
||||
@@ -956,7 +974,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForImage() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(51, "enableViewRecyclingForImage");
|
||||
markFlagAsAccessed(52, "enableViewRecyclingForImage");
|
||||
|
||||
flagValue = currentProvider_->enableViewRecyclingForImage();
|
||||
enableViewRecyclingForImage_ = flagValue;
|
||||
@@ -974,7 +992,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForScrollView() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(52, "enableViewRecyclingForScrollView");
|
||||
markFlagAsAccessed(53, "enableViewRecyclingForScrollView");
|
||||
|
||||
flagValue = currentProvider_->enableViewRecyclingForScrollView();
|
||||
enableViewRecyclingForScrollView_ = flagValue;
|
||||
@@ -992,7 +1010,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(53, "enableViewRecyclingForText");
|
||||
markFlagAsAccessed(54, "enableViewRecyclingForText");
|
||||
|
||||
flagValue = currentProvider_->enableViewRecyclingForText();
|
||||
enableViewRecyclingForText_ = flagValue;
|
||||
@@ -1010,7 +1028,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(54, "enableViewRecyclingForView");
|
||||
markFlagAsAccessed(55, "enableViewRecyclingForView");
|
||||
|
||||
flagValue = currentProvider_->enableViewRecyclingForView();
|
||||
enableViewRecyclingForView_ = flagValue;
|
||||
@@ -1028,7 +1046,7 @@ bool ReactNativeFeatureFlagsAccessor::enableVirtualViewContainerStateExperimenta
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(55, "enableVirtualViewContainerStateExperimental");
|
||||
markFlagAsAccessed(56, "enableVirtualViewContainerStateExperimental");
|
||||
|
||||
flagValue = currentProvider_->enableVirtualViewContainerStateExperimental();
|
||||
enableVirtualViewContainerStateExperimental_ = flagValue;
|
||||
@@ -1046,7 +1064,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(56, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
|
||||
markFlagAsAccessed(57, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
|
||||
|
||||
flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact();
|
||||
fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue;
|
||||
@@ -1064,7 +1082,7 @@ bool ReactNativeFeatureFlagsAccessor::fixYogaFlexBasisFitContentInMainAxis() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(57, "fixYogaFlexBasisFitContentInMainAxis");
|
||||
markFlagAsAccessed(58, "fixYogaFlexBasisFitContentInMainAxis");
|
||||
|
||||
flagValue = currentProvider_->fixYogaFlexBasisFitContentInMainAxis();
|
||||
fixYogaFlexBasisFitContentInMainAxis_ = flagValue;
|
||||
@@ -1082,7 +1100,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxAssertSingleHostState() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(58, "fuseboxAssertSingleHostState");
|
||||
markFlagAsAccessed(59, "fuseboxAssertSingleHostState");
|
||||
|
||||
flagValue = currentProvider_->fuseboxAssertSingleHostState();
|
||||
fuseboxAssertSingleHostState_ = flagValue;
|
||||
@@ -1100,7 +1118,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(59, "fuseboxEnabledRelease");
|
||||
markFlagAsAccessed(60, "fuseboxEnabledRelease");
|
||||
|
||||
flagValue = currentProvider_->fuseboxEnabledRelease();
|
||||
fuseboxEnabledRelease_ = flagValue;
|
||||
@@ -1118,7 +1136,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxFrameRecordingEnabled() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(60, "fuseboxFrameRecordingEnabled");
|
||||
markFlagAsAccessed(61, "fuseboxFrameRecordingEnabled");
|
||||
|
||||
flagValue = currentProvider_->fuseboxFrameRecordingEnabled();
|
||||
fuseboxFrameRecordingEnabled_ = flagValue;
|
||||
@@ -1136,7 +1154,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxScreenshotCaptureEnabled() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(61, "fuseboxScreenshotCaptureEnabled");
|
||||
markFlagAsAccessed(62, "fuseboxScreenshotCaptureEnabled");
|
||||
|
||||
flagValue = currentProvider_->fuseboxScreenshotCaptureEnabled();
|
||||
fuseboxScreenshotCaptureEnabled_ = flagValue;
|
||||
@@ -1154,7 +1172,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxWebSocketEventsEnabled() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(62, "fuseboxWebSocketEventsEnabled");
|
||||
markFlagAsAccessed(63, "fuseboxWebSocketEventsEnabled");
|
||||
|
||||
flagValue = currentProvider_->fuseboxWebSocketEventsEnabled();
|
||||
fuseboxWebSocketEventsEnabled_ = flagValue;
|
||||
@@ -1172,7 +1190,7 @@ bool ReactNativeFeatureFlagsAccessor::optimizedAnimatedPropUpdates() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(63, "optimizedAnimatedPropUpdates");
|
||||
markFlagAsAccessed(64, "optimizedAnimatedPropUpdates");
|
||||
|
||||
flagValue = currentProvider_->optimizedAnimatedPropUpdates();
|
||||
optimizedAnimatedPropUpdates_ = flagValue;
|
||||
@@ -1190,7 +1208,7 @@ bool ReactNativeFeatureFlagsAccessor::overrideBySynchronousMountPropsAtMountingA
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(64, "overrideBySynchronousMountPropsAtMountingAndroid");
|
||||
markFlagAsAccessed(65, "overrideBySynchronousMountPropsAtMountingAndroid");
|
||||
|
||||
flagValue = currentProvider_->overrideBySynchronousMountPropsAtMountingAndroid();
|
||||
overrideBySynchronousMountPropsAtMountingAndroid_ = flagValue;
|
||||
@@ -1208,7 +1226,7 @@ bool ReactNativeFeatureFlagsAccessor::perfIssuesEnabled() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(65, "perfIssuesEnabled");
|
||||
markFlagAsAccessed(66, "perfIssuesEnabled");
|
||||
|
||||
flagValue = currentProvider_->perfIssuesEnabled();
|
||||
perfIssuesEnabled_ = flagValue;
|
||||
@@ -1226,7 +1244,7 @@ bool ReactNativeFeatureFlagsAccessor::perfMonitorV2Enabled() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(66, "perfMonitorV2Enabled");
|
||||
markFlagAsAccessed(67, "perfMonitorV2Enabled");
|
||||
|
||||
flagValue = currentProvider_->perfMonitorV2Enabled();
|
||||
perfMonitorV2Enabled_ = flagValue;
|
||||
@@ -1244,7 +1262,7 @@ double ReactNativeFeatureFlagsAccessor::preparedTextCacheSize() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(67, "preparedTextCacheSize");
|
||||
markFlagAsAccessed(68, "preparedTextCacheSize");
|
||||
|
||||
flagValue = currentProvider_->preparedTextCacheSize();
|
||||
preparedTextCacheSize_ = flagValue;
|
||||
@@ -1262,7 +1280,7 @@ bool ReactNativeFeatureFlagsAccessor::preventShadowTreeCommitExhaustion() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(68, "preventShadowTreeCommitExhaustion");
|
||||
markFlagAsAccessed(69, "preventShadowTreeCommitExhaustion");
|
||||
|
||||
flagValue = currentProvider_->preventShadowTreeCommitExhaustion();
|
||||
preventShadowTreeCommitExhaustion_ = flagValue;
|
||||
@@ -1280,7 +1298,7 @@ bool ReactNativeFeatureFlagsAccessor::redBoxV2Android() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(69, "redBoxV2Android");
|
||||
markFlagAsAccessed(70, "redBoxV2Android");
|
||||
|
||||
flagValue = currentProvider_->redBoxV2Android();
|
||||
redBoxV2Android_ = flagValue;
|
||||
@@ -1298,7 +1316,7 @@ bool ReactNativeFeatureFlagsAccessor::redBoxV2IOS() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(70, "redBoxV2IOS");
|
||||
markFlagAsAccessed(71, "redBoxV2IOS");
|
||||
|
||||
flagValue = currentProvider_->redBoxV2IOS();
|
||||
redBoxV2IOS_ = flagValue;
|
||||
@@ -1316,7 +1334,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldPressibilityUseW3CPointerEventsForHo
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(71, "shouldPressibilityUseW3CPointerEventsForHover");
|
||||
markFlagAsAccessed(72, "shouldPressibilityUseW3CPointerEventsForHover");
|
||||
|
||||
flagValue = currentProvider_->shouldPressibilityUseW3CPointerEventsForHover();
|
||||
shouldPressibilityUseW3CPointerEventsForHover_ = flagValue;
|
||||
@@ -1334,7 +1352,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldTriggerResponderTransferOnScrollAndr
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(72, "shouldTriggerResponderTransferOnScrollAndroid");
|
||||
markFlagAsAccessed(73, "shouldTriggerResponderTransferOnScrollAndroid");
|
||||
|
||||
flagValue = currentProvider_->shouldTriggerResponderTransferOnScrollAndroid();
|
||||
shouldTriggerResponderTransferOnScrollAndroid_ = flagValue;
|
||||
@@ -1352,7 +1370,7 @@ bool ReactNativeFeatureFlagsAccessor::skipActivityIdentityAssertionOnHostPause()
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(73, "skipActivityIdentityAssertionOnHostPause");
|
||||
markFlagAsAccessed(74, "skipActivityIdentityAssertionOnHostPause");
|
||||
|
||||
flagValue = currentProvider_->skipActivityIdentityAssertionOnHostPause();
|
||||
skipActivityIdentityAssertionOnHostPause_ = flagValue;
|
||||
@@ -1370,7 +1388,7 @@ bool ReactNativeFeatureFlagsAccessor::syncAndroidClipBoundsWithOverflow() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(74, "syncAndroidClipBoundsWithOverflow");
|
||||
markFlagAsAccessed(75, "syncAndroidClipBoundsWithOverflow");
|
||||
|
||||
flagValue = currentProvider_->syncAndroidClipBoundsWithOverflow();
|
||||
syncAndroidClipBoundsWithOverflow_ = flagValue;
|
||||
@@ -1388,7 +1406,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(75, "traceTurboModulePromiseRejectionsOnAndroid");
|
||||
markFlagAsAccessed(76, "traceTurboModulePromiseRejectionsOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid();
|
||||
traceTurboModulePromiseRejectionsOnAndroid_ = flagValue;
|
||||
@@ -1406,7 +1424,7 @@ bool ReactNativeFeatureFlagsAccessor::updateRuntimeShadowNodeReferencesOnCommit(
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(76, "updateRuntimeShadowNodeReferencesOnCommit");
|
||||
markFlagAsAccessed(77, "updateRuntimeShadowNodeReferencesOnCommit");
|
||||
|
||||
flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommit();
|
||||
updateRuntimeShadowNodeReferencesOnCommit_ = flagValue;
|
||||
@@ -1424,7 +1442,7 @@ bool ReactNativeFeatureFlagsAccessor::updateRuntimeShadowNodeReferencesOnCommitT
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(77, "updateRuntimeShadowNodeReferencesOnCommitThread");
|
||||
markFlagAsAccessed(78, "updateRuntimeShadowNodeReferencesOnCommitThread");
|
||||
|
||||
flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommitThread();
|
||||
updateRuntimeShadowNodeReferencesOnCommitThread_ = flagValue;
|
||||
@@ -1442,7 +1460,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(78, "useAlwaysAvailableJSErrorHandling");
|
||||
markFlagAsAccessed(79, "useAlwaysAvailableJSErrorHandling");
|
||||
|
||||
flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling();
|
||||
useAlwaysAvailableJSErrorHandling_ = flagValue;
|
||||
@@ -1460,7 +1478,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(79, "useFabricInterop");
|
||||
markFlagAsAccessed(80, "useFabricInterop");
|
||||
|
||||
flagValue = currentProvider_->useFabricInterop();
|
||||
useFabricInterop_ = flagValue;
|
||||
@@ -1478,7 +1496,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(80, "useNativeViewConfigsInBridgelessMode");
|
||||
markFlagAsAccessed(81, "useNativeViewConfigsInBridgelessMode");
|
||||
|
||||
flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
|
||||
useNativeViewConfigsInBridgelessMode_ = flagValue;
|
||||
@@ -1496,7 +1514,7 @@ bool ReactNativeFeatureFlagsAccessor::useNestedScrollViewAndroid() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(81, "useNestedScrollViewAndroid");
|
||||
markFlagAsAccessed(82, "useNestedScrollViewAndroid");
|
||||
|
||||
flagValue = currentProvider_->useNestedScrollViewAndroid();
|
||||
useNestedScrollViewAndroid_ = flagValue;
|
||||
@@ -1514,7 +1532,7 @@ bool ReactNativeFeatureFlagsAccessor::useSharedAnimatedBackend() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(82, "useSharedAnimatedBackend");
|
||||
markFlagAsAccessed(83, "useSharedAnimatedBackend");
|
||||
|
||||
flagValue = currentProvider_->useSharedAnimatedBackend();
|
||||
useSharedAnimatedBackend_ = flagValue;
|
||||
@@ -1532,7 +1550,7 @@ bool ReactNativeFeatureFlagsAccessor::useTraitHiddenOnAndroid() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(83, "useTraitHiddenOnAndroid");
|
||||
markFlagAsAccessed(84, "useTraitHiddenOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->useTraitHiddenOnAndroid();
|
||||
useTraitHiddenOnAndroid_ = flagValue;
|
||||
@@ -1550,7 +1568,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(84, "useTurboModuleInterop");
|
||||
markFlagAsAccessed(85, "useTurboModuleInterop");
|
||||
|
||||
flagValue = currentProvider_->useTurboModuleInterop();
|
||||
useTurboModuleInterop_ = flagValue;
|
||||
@@ -1568,7 +1586,7 @@ double ReactNativeFeatureFlagsAccessor::viewCullingOutsetRatio() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(85, "viewCullingOutsetRatio");
|
||||
markFlagAsAccessed(86, "viewCullingOutsetRatio");
|
||||
|
||||
flagValue = currentProvider_->viewCullingOutsetRatio();
|
||||
viewCullingOutsetRatio_ = flagValue;
|
||||
@@ -1586,7 +1604,7 @@ bool ReactNativeFeatureFlagsAccessor::viewTransitionEnabled() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(86, "viewTransitionEnabled");
|
||||
markFlagAsAccessed(87, "viewTransitionEnabled");
|
||||
|
||||
flagValue = currentProvider_->viewTransitionEnabled();
|
||||
viewTransitionEnabled_ = flagValue;
|
||||
@@ -1604,7 +1622,7 @@ bool ReactNativeFeatureFlagsAccessor::viewTransitionUseHardwareBitmapAndroid() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(87, "viewTransitionUseHardwareBitmapAndroid");
|
||||
markFlagAsAccessed(88, "viewTransitionUseHardwareBitmapAndroid");
|
||||
|
||||
flagValue = currentProvider_->viewTransitionUseHardwareBitmapAndroid();
|
||||
viewTransitionUseHardwareBitmapAndroid_ = flagValue;
|
||||
@@ -1622,7 +1640,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewPrerenderRatio() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(88, "virtualViewPrerenderRatio");
|
||||
markFlagAsAccessed(89, "virtualViewPrerenderRatio");
|
||||
|
||||
flagValue = currentProvider_->virtualViewPrerenderRatio();
|
||||
virtualViewPrerenderRatio_ = 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<<3e557788d6bd43975af8dcb392beef94>>
|
||||
* @generated SignedSource<<fb5339dabaffd95bde6e794c90d0aa28>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -79,6 +79,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
bool enableMountingCoordinatorPullModelAndroid();
|
||||
bool enableMutationObserverByDefault();
|
||||
bool enableNativeCSSParsing();
|
||||
bool enablePreallocatedPropsDiffOnInsertAndroid();
|
||||
bool enablePreparedTextLayout();
|
||||
bool enablePropsUpdateReconciliationAndroid();
|
||||
bool enableResizeObserverByDefault();
|
||||
@@ -134,7 +135,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
|
||||
bool wasOverridden_;
|
||||
|
||||
std::array<std::atomic<const char*>, 89> accessedFeatureFlags_;
|
||||
std::array<std::atomic<const char*>, 90> accessedFeatureFlags_;
|
||||
|
||||
std::atomic<std::optional<bool>> commonTestFlag_;
|
||||
std::atomic<std::optional<bool>> cdpInteractionMetricsEnabled_;
|
||||
@@ -181,6 +182,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::atomic<std::optional<bool>> enableMountingCoordinatorPullModelAndroid_;
|
||||
std::atomic<std::optional<bool>> enableMutationObserverByDefault_;
|
||||
std::atomic<std::optional<bool>> enableNativeCSSParsing_;
|
||||
std::atomic<std::optional<bool>> enablePreallocatedPropsDiffOnInsertAndroid_;
|
||||
std::atomic<std::optional<bool>> enablePreparedTextLayout_;
|
||||
std::atomic<std::optional<bool>> enablePropsUpdateReconciliationAndroid_;
|
||||
std::atomic<std::optional<bool>> enableResizeObserverByDefault_;
|
||||
|
||||
+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<<07754aa6f05f6219f95a7b9a2e83ba49>>
|
||||
* @generated SignedSource<<6abef654d3dd784b7211ac8874069020>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -209,6 +209,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool enablePreallocatedPropsDiffOnInsertAndroid() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool enablePreparedTextLayout() 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<<feee721a90dc8eb3371e87778bdbccc7>>
|
||||
* @generated SignedSource<<625c7c4f1d55e7ca5c226793fe982c7b>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -452,6 +452,15 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
|
||||
return ReactNativeFeatureFlagsDefaults::enableNativeCSSParsing();
|
||||
}
|
||||
|
||||
bool enablePreallocatedPropsDiffOnInsertAndroid() override {
|
||||
auto value = values_["enablePreallocatedPropsDiffOnInsertAndroid"];
|
||||
if (!value.isNull()) {
|
||||
return value.getBool();
|
||||
}
|
||||
|
||||
return ReactNativeFeatureFlagsDefaults::enablePreallocatedPropsDiffOnInsertAndroid();
|
||||
}
|
||||
|
||||
bool enablePreparedTextLayout() override {
|
||||
auto value = values_["enablePreparedTextLayout"];
|
||||
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<<bad95ec81f97c64414c52106fd0a1b7e>>
|
||||
* @generated SignedSource<<428c475acbb4baed380207f0b08b4e26>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -72,6 +72,7 @@ class ReactNativeFeatureFlagsProvider {
|
||||
virtual bool enableMountingCoordinatorPullModelAndroid() = 0;
|
||||
virtual bool enableMutationObserverByDefault() = 0;
|
||||
virtual bool enableNativeCSSParsing() = 0;
|
||||
virtual bool enablePreallocatedPropsDiffOnInsertAndroid() = 0;
|
||||
virtual bool enablePreparedTextLayout() = 0;
|
||||
virtual bool enablePropsUpdateReconciliationAndroid() = 0;
|
||||
virtual bool enableResizeObserverByDefault() = 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<<1bfe886891d4d195940b57548e3fcc6e>>
|
||||
* @generated SignedSource<<d032dbd4f066b7a8cf742b7f91f66c3b>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -269,6 +269,11 @@ bool NativeReactNativeFeatureFlags::enableNativeCSSParsing(
|
||||
return ReactNativeFeatureFlags::enableNativeCSSParsing();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::enablePreallocatedPropsDiffOnInsertAndroid(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::enablePreallocatedPropsDiffOnInsertAndroid();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::enablePreparedTextLayout(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::enablePreparedTextLayout();
|
||||
|
||||
+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<<dde6447659f81e2f474e857cdf2259d5>>
|
||||
* @generated SignedSource<<dff9379b2aa73e50088d4be72cd1c359>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -128,6 +128,8 @@ class NativeReactNativeFeatureFlags
|
||||
|
||||
bool enableNativeCSSParsing(jsi::Runtime& runtime);
|
||||
|
||||
bool enablePreallocatedPropsDiffOnInsertAndroid(jsi::Runtime& runtime);
|
||||
|
||||
bool enablePreparedTextLayout(jsi::Runtime& runtime);
|
||||
|
||||
bool enablePropsUpdateReconciliationAndroid(jsi::Runtime& runtime);
|
||||
|
||||
@@ -531,6 +531,17 @@ const definitions: FeatureFlagDefinitions = {
|
||||
},
|
||||
ossReleaseStage: 'none',
|
||||
},
|
||||
enablePreallocatedPropsDiffOnInsertAndroid: {
|
||||
defaultValue: false,
|
||||
metadata: {
|
||||
dateAdded: '2026-09-30',
|
||||
description:
|
||||
'When enabled together with `enableAccumulatedUpdatesInRawPropsAndroid`, the Insert of a preallocated view only sends the difference between the props the view was preallocated with and the inserted props, instead of sending all props again on every Insert.',
|
||||
expectedReleaseValue: true,
|
||||
purpose: 'experimentation',
|
||||
},
|
||||
ossReleaseStage: 'none',
|
||||
},
|
||||
enablePreparedTextLayout: {
|
||||
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<<6e73a99aafb36218e1d679637bb80c82>>
|
||||
* @generated SignedSource<<8075ab58916ce356d5acac15888aff7a>>
|
||||
* @flow strict
|
||||
* @noformat
|
||||
*/
|
||||
@@ -94,6 +94,7 @@ export type ReactNativeFeatureFlags = Readonly<{
|
||||
enableMountingCoordinatorPullModelAndroid: Getter<boolean>,
|
||||
enableMutationObserverByDefault: Getter<boolean>,
|
||||
enableNativeCSSParsing: Getter<boolean>,
|
||||
enablePreallocatedPropsDiffOnInsertAndroid: Getter<boolean>,
|
||||
enablePreparedTextLayout: Getter<boolean>,
|
||||
enablePropsUpdateReconciliationAndroid: Getter<boolean>,
|
||||
enableResizeObserverByDefault: Getter<boolean>,
|
||||
@@ -394,6 +395,10 @@ export const enableMutationObserverByDefault: Getter<boolean> = createNativeFlag
|
||||
* Parse CSS strings using the Fabric CSS parser instead of ViewConfig processing
|
||||
*/
|
||||
export const enableNativeCSSParsing: Getter<boolean> = createNativeFlagGetter('enableNativeCSSParsing', false);
|
||||
/**
|
||||
* When enabled together with `enableAccumulatedUpdatesInRawPropsAndroid`, the Insert of a preallocated view only sends the difference between the props the view was preallocated with and the inserted props, instead of sending all props again on every Insert.
|
||||
*/
|
||||
export const enablePreallocatedPropsDiffOnInsertAndroid: Getter<boolean> = createNativeFlagGetter('enablePreallocatedPropsDiffOnInsertAndroid', false);
|
||||
/**
|
||||
* Enables caching text layout artifacts for later reuse
|
||||
*/
|
||||
|
||||
+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<<ed20a4b386fd750fb9ff9bfb631a7181>>
|
||||
* @generated SignedSource<<b9152466bfb5787dd518feb9de5db821>>
|
||||
* @flow strict
|
||||
* @noformat
|
||||
*/
|
||||
@@ -70,6 +70,7 @@ export interface Spec extends TurboModule {
|
||||
readonly enableMountingCoordinatorPullModelAndroid?: () => boolean;
|
||||
readonly enableMutationObserverByDefault?: () => boolean;
|
||||
readonly enableNativeCSSParsing?: () => boolean;
|
||||
readonly enablePreallocatedPropsDiffOnInsertAndroid?: () => boolean;
|
||||
readonly enablePreparedTextLayout?: () => boolean;
|
||||
readonly enablePropsUpdateReconciliationAndroid?: () => boolean;
|
||||
readonly enableResizeObserverByDefault?: () => boolean;
|
||||
|
||||
Reference in new issue
Block a user