From 6a128bd8104c04e74a39da39cc808e6616205b63 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 20 Jan 2020 05:46:03 -0800 Subject: [PATCH] Fabric: remove LocalData from ShadowView Summary: LocalData isn't used by any components. We've moved towards State. Changelog: [internal] Reviewed By: mdvacca Differential Revision: D19250737 fbshipit-source-id: 10bf0b62ffad01ad10b07d029e84df4f312780a1 --- .../com/facebook/react/fabric/jni/Binding.cpp | 34 ------------------- ReactCommon/fabric/mounting/ShadowView.cpp | 4 --- ReactCommon/fabric/mounting/ShadowView.h | 3 -- 3 files changed, 41 deletions(-) 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 4e88dda6af..a83a714043 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 @@ -426,29 +426,6 @@ local_ref createInsertMountItem( mutation.index); } -local_ref createUpdateLocalData( - const jni::global_ref &javaUIManager, - const ShadowViewMutation &mutation) { - static auto updateLocalDataInstruction = - jni::findClassStatic(UIManagerJavaDescriptor) - ->getMethod(jint, ReadableMap::javaobject)>( - "updateLocalDataMountItem"); - - auto localData = mutation.newChildShadowView.localData; - - folly::dynamic newLocalData = folly::dynamic::object(); - if (localData) { - newLocalData = localData->getDynamic(); - } - - local_ref readableNativeMap = - ReadableNativeMap::newObjectCxxArgs(newLocalData); - return updateLocalDataInstruction( - javaUIManager, - mutation.newChildShadowView.tag, - castReadableMap(readableNativeMap).get()); -} - local_ref createUpdateStateMountItem( const jni::global_ref &javaUIManager, const ShadowViewMutation &mutation) { @@ -737,11 +714,6 @@ void Binding::schedulerDidFinishTransaction( mountItems[position++] = createUpdatePropsMountItem(localJavaUIManager, mutation); } - if (mutation.oldChildShadowView.localData != - mutation.newChildShadowView.localData) { - mountItems[position++] = - createUpdateLocalData(localJavaUIManager, mutation); - } if (mutation.oldChildShadowView.state != mutation.newChildShadowView.state) { mountItems[position++] = @@ -791,12 +763,6 @@ void Binding::schedulerDidFinishTransaction( createUpdateStateMountItem(localJavaUIManager, mutation); } - // LocalData - if (mutation.newChildShadowView.localData) { - mountItems[position++] = - createUpdateLocalData(localJavaUIManager, mutation); - } - // Layout auto updateLayoutMountItem = createUpdateLayoutMountItem(localJavaUIManager, mutation); diff --git a/ReactCommon/fabric/mounting/ShadowView.cpp b/ReactCommon/fabric/mounting/ShadowView.cpp index e78e765ba1..0bf2e57cd1 100644 --- a/ReactCommon/fabric/mounting/ShadowView.cpp +++ b/ReactCommon/fabric/mounting/ShadowView.cpp @@ -26,7 +26,6 @@ ShadowView::ShadowView(const ShadowNode &shadowNode) props(shadowNode.getProps()), eventEmitter(shadowNode.getEventEmitter()), layoutMetrics(layoutMetricsFromShadowNode(shadowNode)), - localData({}), state(shadowNode.getState()) {} bool ShadowView::operator==(const ShadowView &rhs) const { @@ -36,7 +35,6 @@ bool ShadowView::operator==(const ShadowView &rhs) const { this->props, this->eventEmitter, this->layoutMetrics, - this->localData, this->state) == std::tie( rhs.tag, @@ -44,7 +42,6 @@ bool ShadowView::operator==(const ShadowView &rhs) const { rhs.props, rhs.eventEmitter, rhs.layoutMetrics, - rhs.localData, rhs.state); } @@ -66,7 +63,6 @@ std::vector getDebugProps( {"props", getDebugDescription(object.props, options)}, {"eventEmitter", getDebugDescription(object.eventEmitter, options)}, {"layoutMetrics", getDebugDescription(object.layoutMetrics, options)}, - {"localData", getDebugDescription(object.localData, options)}, {"state", getDebugDescription(object.state, options)}, }; } diff --git a/ReactCommon/fabric/mounting/ShadowView.h b/ReactCommon/fabric/mounting/ShadowView.h index dce82f2fb7..1372b44928 100644 --- a/ReactCommon/fabric/mounting/ShadowView.h +++ b/ReactCommon/fabric/mounting/ShadowView.h @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -44,7 +43,6 @@ struct ShadowView final { Props::Shared props{}; EventEmitter::Shared eventEmitter{}; LayoutMetrics layoutMetrics{EmptyLayoutMetrics}; - LocalData::Shared localData{}; State::Shared state{}; }; @@ -88,7 +86,6 @@ struct hash { shadowView.tag, shadowView.props, shadowView.eventEmitter, - shadowView.localData, shadowView.state); } };