mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Revert QE for ReactFeatureFlags.reduceDeleteCreateMutation (#42339)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/42339 This diff cleans up the code added in D41900201 to run QE: https://fburl.com/qe2/ovgxlayy More context: https://fb.workplace.com/groups/react.technologies.discussions/permalink/3479283292303384/ Changelog: [Android][Internal] - Revert internal optimizations Reviewed By: mdvacca Differential Revision: D52750975 fbshipit-source-id: 675a3d0bb05094e35e47b35e6840fb2e5a24b9a1
This commit is contained in:
committed by
Facebook GitHub Bot
parent
4e92f87dfd
commit
0e90cd46f1
@@ -1911,7 +1911,6 @@ public class com/facebook/react/config/ReactFeatureFlags {
|
||||
public static field enableViewRecycling Z
|
||||
public static field excludeYogaFromRawProps Z
|
||||
public static field fixStoppedSurfaceTagSetLeak Z
|
||||
public static field reduceDeleteCreateMutation Z
|
||||
public static field reduceDeleteCreateMutationLayoutAnimation Z
|
||||
public static field rejectTurboModulePromiseOnNativeError Z
|
||||
public static field traceTurboModulePromiseRejections Z
|
||||
|
||||
-6
@@ -112,12 +112,6 @@ public class ReactFeatureFlags {
|
||||
*/
|
||||
public static boolean reduceDeleteCreateMutationLayoutAnimation = true;
|
||||
|
||||
/**
|
||||
* Allow fix to drop delete...create mutations which could cause missing view state in Fabric
|
||||
* SurfaceMountingManager.
|
||||
*/
|
||||
public static boolean reduceDeleteCreateMutation = false;
|
||||
|
||||
/** Report mount operations from the host platform to notify mount hooks. */
|
||||
public static boolean enableMountHooks = false;
|
||||
|
||||
|
||||
+1
-37
@@ -30,22 +30,10 @@
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
constexpr static auto kReactFeatureFlagsJavaDescriptor =
|
||||
"com/facebook/react/config/ReactFeatureFlags";
|
||||
|
||||
static bool getFeatureFlagValue(const char* name) {
|
||||
static const auto reactFeatureFlagsClass =
|
||||
jni::findClassStatic(kReactFeatureFlagsJavaDescriptor);
|
||||
const auto field = reactFeatureFlagsClass->getStaticField<jboolean>(name);
|
||||
return reactFeatureFlagsClass->getStaticFieldValue(field);
|
||||
}
|
||||
|
||||
FabricMountingManager::FabricMountingManager(
|
||||
std::shared_ptr<const ReactNativeConfig>& config,
|
||||
jni::global_ref<JFabricUIManager::javaobject>& javaUIManager)
|
||||
: javaUIManager_(javaUIManager),
|
||||
reduceDeleteCreateMutation_(
|
||||
getFeatureFlagValue("reduceDeleteCreateMutation")) {}
|
||||
: javaUIManager_(javaUIManager) {}
|
||||
|
||||
void FabricMountingManager::onSurfaceStart(SurfaceId surfaceId) {
|
||||
std::lock_guard lock(allocatedViewsMutex_);
|
||||
@@ -288,30 +276,6 @@ void FabricMountingManager::executeMount(
|
||||
case ShadowViewMutation::Create: {
|
||||
bool shouldCreateView =
|
||||
!allocatedViewTags.contains(newChildShadowView.tag);
|
||||
if (reduceDeleteCreateMutation_) {
|
||||
// Detect DELETE...CREATE situation on the same node and do NOT push
|
||||
// back to the mount items. This is an edge case that may happen
|
||||
// when for example animation runs while commit happened, and we
|
||||
// want to filter them out here to capture all possible sources of
|
||||
// such mutations. The re-ordering logic here assumes no
|
||||
// DELETE...CREATE in the mutations, as we will re-order mutations
|
||||
// and batch all DELETE instructions in the end.
|
||||
auto it = std::remove_if(
|
||||
cppDeleteMountItems.begin(),
|
||||
cppDeleteMountItems.end(),
|
||||
[&](auto& deletedMountItem) -> bool {
|
||||
return deletedMountItem.oldChildShadowView.tag ==
|
||||
newChildShadowView.tag;
|
||||
});
|
||||
bool hasDeletedViewsWithSameTag = it != cppDeleteMountItems.end();
|
||||
cppDeleteMountItems.erase(it, cppDeleteMountItems.end());
|
||||
|
||||
if (hasDeletedViewsWithSameTag) {
|
||||
shouldCreateView = false;
|
||||
LOG(ERROR)
|
||||
<< "XIN: Detect DELETE...CREATE on the same tag from mutations in the same batch. The DELETE and CREATE mutations are removed before sending to the native platforms";
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldCreateView) {
|
||||
cppCommonMountItems.push_back(
|
||||
|
||||
@@ -63,8 +63,6 @@ class FabricMountingManager final {
|
||||
allocatedViewRegistry_{};
|
||||
std::recursive_mutex allocatedViewsMutex_;
|
||||
|
||||
const bool reduceDeleteCreateMutation_{false};
|
||||
|
||||
jni::local_ref<jobject> getProps(
|
||||
const ShadowView& oldShadowView,
|
||||
const ShadowView& newShadowView);
|
||||
|
||||
Reference in New Issue
Block a user