From 47a9d1891236e5be372b7f5a5e2251bd0e894413 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Sat, 12 Dec 2020 03:37:50 -0800 Subject: [PATCH] Delete LayoutAnimations gating code and related dead code Summary: Ship LayoutAnimations to 100% of users by removing feature-flag gating. The `collapseDeleteCreateMountingInstructions_` stuff is always disabled for LayoutAnimations, so we can get rid of that too. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D25510740 fbshipit-source-id: 71bac44f829530458e4906ecd1e7e68e766de2ec --- .../java/com/facebook/react/fabric/jni/BUCK | 1 - .../com/facebook/react/fabric/jni/Binding.cpp | 61 +------------------ .../com/facebook/react/fabric/jni/Binding.h | 1 - 3 files changed, 2 insertions(+), 61 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK index 0d6dd21aaaa..8f9d8e9e479 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK @@ -27,7 +27,6 @@ rn_xplat_cxx_library( soname = "libfabricjni.$(ext)", visibility = ["PUBLIC"], deps = [ - react_native_xplat_target("better:better"), react_native_xplat_target("react/config:config"), react_native_xplat_target("react/renderer/animations:animations"), react_native_xplat_target("react/renderer/uimanager:uimanager"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp index 62571a1f701..3800b495bb5 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp @@ -11,7 +11,6 @@ #include "ReactNativeConfigHolder.h" #include "StateWrapperImpl.h" -#include #include #include #include @@ -437,13 +436,6 @@ void Binding::installFabricUIManager( // Keep reference to config object and cache some feature flags here reactNativeConfig_ = config; - collapseDeleteCreateMountingInstructions_ = - reactNativeConfig_->getBool( - "react_fabric:enabled_collapse_delete_create_mounting_instructions") && - !reactNativeConfig_->getBool( - "react_fabric:enable_reparenting_detection_android") && - !reactNativeConfig_->getBool( - "react_fabric:enabled_layout_animations_android"); useIntBufferBatchMountItem_ = reactNativeConfig_->getBool( "react_fabric:use_int_buffer_batch_mountitem_android"); @@ -451,9 +443,6 @@ void Binding::installFabricUIManager( disablePreallocateViews_ = reactNativeConfig_->getBool( "react_fabric:disabled_view_preallocation_android"); - bool enableLayoutAnimations = reactNativeConfig_->getBool( - "react_fabric:enabled_layout_animations_android"); - auto toolbox = SchedulerToolbox{}; toolbox.contextContainer = contextContainer; toolbox.componentRegistryFactory = componentsRegistry->buildRegistryFunction; @@ -467,10 +456,8 @@ void Binding::installFabricUIManager( toolbox.backgroundExecutor = backgroundExecutor_->get(); } - if (enableLayoutAnimations) { - animationDriver_ = - std::make_shared(runtimeExecutor, this); - } + animationDriver_ = + std::make_shared(runtimeExecutor, this); scheduler_ = std::make_shared( toolbox, (animationDriver_ ? animationDriver_.get() : nullptr), this); } @@ -1224,33 +1211,6 @@ void Binding::schedulerDidFinishTransaction( auto surfaceId = mountingTransaction->getSurfaceId(); auto &mutations = mountingTransaction->getMutations(); - facebook::better::set createAndDeleteTagsToProcess; - // When collapseDeleteCreateMountingInstructions_ is enabled, the - // createAndDeleteTagsToProcess set will contain all the tags belonging to - // CREATE and DELETE mutation instructions that needs to be processed. If a - // CREATE or DELETE mutation instruction does not belong in the set, it means - // that the we received a pair of mutation instructions: DELETE - CREATE and - // it is not necessary to create or delete on the screen. - if (collapseDeleteCreateMountingInstructions_) { - for (const auto &mutation : mutations) { - if (mutation.type == ShadowViewMutation::Delete) { - // TAG on 'Delete' mutation instructions are part of the - // oldChildShadowView - createAndDeleteTagsToProcess.insert(mutation.oldChildShadowView.tag); - } else if (mutation.type == ShadowViewMutation::Create) { - // TAG on 'Create' mutation instructions are part of the - // newChildShadowView - Tag tag = mutation.newChildShadowView.tag; - if (createAndDeleteTagsToProcess.find(tag) == - createAndDeleteTagsToProcess.end()) { - createAndDeleteTagsToProcess.insert(tag); - } else { - createAndDeleteTagsToProcess.erase(tag); - } - } - } - } - auto revisionNumber = telemetry.getRevisionNumber(); std::vector> queue; @@ -1270,23 +1230,6 @@ void Binding::schedulerDidFinishTransaction( for (const auto &mutation : mutations) { auto oldChildShadowView = mutation.oldChildShadowView; auto newChildShadowView = mutation.newChildShadowView; - auto mutationType = mutation.type; - - if (collapseDeleteCreateMountingInstructions_ && - (mutationType == ShadowViewMutation::Create || - mutationType == ShadowViewMutation::Delete) && - createAndDeleteTagsToProcess.size() > 0) { - // The TAG on 'Delete' mutation instructions are part of the - // oldChildShadowView. On the other side, the TAG on 'Create' mutation - // instructions are part of the newChildShadowView - Tag tag = mutationType == ShadowViewMutation::Create - ? mutation.newChildShadowView.tag - : mutation.oldChildShadowView.tag; - if (createAndDeleteTagsToProcess.find(tag) == - createAndDeleteTagsToProcess.end()) { - continue; - } - } bool isVirtual = newChildShadowView.layoutMetrics == EmptyLayoutMetrics && oldChildShadowView.layoutMetrics == EmptyLayoutMetrics; diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h index d0f13cc6e9b..61e2e2b783b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h @@ -170,7 +170,6 @@ class Binding : public jni::HybridClass, std::shared_ptr reactNativeConfig_{nullptr}; bool useIntBufferBatchMountItem_{false}; - bool collapseDeleteCreateMountingInstructions_{false}; bool disablePreallocateViews_{false}; bool disableVirtualNodePreallocation_{false}; bool enableFabricLogs_{false};