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
This commit is contained in:
Родитель
933cef6d9a
Коммит
47a9d18912
|
@ -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"),
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "ReactNativeConfigHolder.h"
|
||||
#include "StateWrapperImpl.h"
|
||||
|
||||
#include <better/set.h>
|
||||
#include <fbjni/fbjni.h>
|
||||
#include <jsi/JSIDynamic.h>
|
||||
#include <jsi/jsi.h>
|
||||
|
@ -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<LayoutAnimationDriver>(runtimeExecutor, this);
|
||||
}
|
||||
animationDriver_ =
|
||||
std::make_shared<LayoutAnimationDriver>(runtimeExecutor, this);
|
||||
scheduler_ = std::make_shared<Scheduler>(
|
||||
toolbox, (animationDriver_ ? animationDriver_.get() : nullptr), this);
|
||||
}
|
||||
|
@ -1224,33 +1211,6 @@ void Binding::schedulerDidFinishTransaction(
|
|||
auto surfaceId = mountingTransaction->getSurfaceId();
|
||||
auto &mutations = mountingTransaction->getMutations();
|
||||
|
||||
facebook::better::set<Tag> 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<local_ref<jobject>> 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;
|
||||
|
|
|
@ -170,7 +170,6 @@ class Binding : public jni::HybridClass<Binding>,
|
|||
|
||||
std::shared_ptr<const ReactNativeConfig> reactNativeConfig_{nullptr};
|
||||
bool useIntBufferBatchMountItem_{false};
|
||||
bool collapseDeleteCreateMountingInstructions_{false};
|
||||
bool disablePreallocateViews_{false};
|
||||
bool disableVirtualNodePreallocation_{false};
|
||||
bool enableFabricLogs_{false};
|
||||
|
|
Загрузка…
Ссылка в новой задаче