From 5a94471650c48269d452fd8692a89031caff0ece 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 ShadowNodeFragment Summary: LocalData isn't used by any components. We've moved towards State. Changelog: [internal] Reviewed By: mdvacca Differential Revision: D19250603 fbshipit-source-id: f95da375117dcb8f6540a6c75d3a80bba630672c --- ReactCommon/fabric/core/shadownode/ShadowNode.cpp | 3 --- ReactCommon/fabric/core/shadownode/ShadowNodeFragment.cpp | 8 +------- ReactCommon/fabric/core/shadownode/ShadowNodeFragment.h | 4 ---- .../fabric/uimanager/ComponentDescriptorRegistry.cpp | 1 - ReactCommon/fabric/uimanager/UIManager.cpp | 3 --- 5 files changed, 1 insertion(+), 18 deletions(-) diff --git a/ReactCommon/fabric/core/shadownode/ShadowNode.cpp b/ReactCommon/fabric/core/shadownode/ShadowNode.cpp index 1178933848f..27281d9fc45 100644 --- a/ReactCommon/fabric/core/shadownode/ShadowNode.cpp +++ b/ReactCommon/fabric/core/shadownode/ShadowNode.cpp @@ -66,9 +66,6 @@ ShadowNode::ShadowNode( props_(fragment.props ? fragment.props : sourceShadowNode.props_), children_( fragment.children ? fragment.children : sourceShadowNode.children_), - localData_( - fragment.localData ? fragment.localData - : sourceShadowNode.localData_), state_( fragment.state ? fragment.state : sourceShadowNode.getMostRecentState()), diff --git a/ReactCommon/fabric/core/shadownode/ShadowNodeFragment.cpp b/ReactCommon/fabric/core/shadownode/ShadowNodeFragment.cpp index 64ea2bb63ac..e70e79b6be3 100644 --- a/ReactCommon/fabric/core/shadownode/ShadowNodeFragment.cpp +++ b/ReactCommon/fabric/core/shadownode/ShadowNodeFragment.cpp @@ -21,11 +21,6 @@ ShadowNodeFragment::childrenPlaceholder() { return instance; } -LocalData::Shared const &ShadowNodeFragment::localDataPlaceholder() { - static auto &instance = *new LocalData::Shared(); - return instance; -} - State::Shared const &ShadowNodeFragment::statePlaceholder() { static auto &instance = *new State::Shared(); return instance; @@ -36,11 +31,10 @@ using Value = ShadowNodeFragment::Value; Value::Value(ShadowNodeFragment const &fragment) : props_(fragment.props), children_(fragment.children), - localData_(fragment.localData), state_(fragment.state) {} Value::operator ShadowNodeFragment() const { - return ShadowNodeFragment{props_, children_, localData_, state_}; + return ShadowNodeFragment{props_, children_, state_}; } } // namespace react diff --git a/ReactCommon/fabric/core/shadownode/ShadowNodeFragment.h b/ReactCommon/fabric/core/shadownode/ShadowNodeFragment.h index 208479122fb..5cec5dde8d0 100644 --- a/ReactCommon/fabric/core/shadownode/ShadowNodeFragment.h +++ b/ReactCommon/fabric/core/shadownode/ShadowNodeFragment.h @@ -8,7 +8,6 @@ #pragma once #include -#include #include #include #include @@ -29,7 +28,6 @@ namespace react { struct ShadowNodeFragment { Props::Shared const &props = propsPlaceholder(); ShadowNode::SharedListOfShared const &children = childrenPlaceholder(); - LocalData::Shared const &localData = localDataPlaceholder(); State::Shared const &state = statePlaceholder(); /* @@ -39,7 +37,6 @@ struct ShadowNodeFragment { */ static Props::Shared const &propsPlaceholder(); static ShadowNode::SharedListOfShared const &childrenPlaceholder(); - static LocalData::Shared const &localDataPlaceholder(); static State::Shared const &statePlaceholder(); /* @@ -62,7 +59,6 @@ struct ShadowNodeFragment { private: Props::Shared const props_; ShadowNode::SharedListOfShared const children_; - LocalData::Shared const localData_; State::Shared const state_; }; }; diff --git a/ReactCommon/fabric/uimanager/ComponentDescriptorRegistry.cpp b/ReactCommon/fabric/uimanager/ComponentDescriptorRegistry.cpp index 583e657aa5b..298d6d5b218 100644 --- a/ReactCommon/fabric/uimanager/ComponentDescriptorRegistry.cpp +++ b/ReactCommon/fabric/uimanager/ComponentDescriptorRegistry.cpp @@ -183,7 +183,6 @@ SharedShadowNode ComponentDescriptorRegistry::createNode( { /* .props = */ props, /* .children = */ ShadowNodeFragment::childrenPlaceholder(), - /* .localData = */ ShadowNodeFragment::localDataPlaceholder(), /* .state = */ state, }, {tag, surfaceId, eventEmitter}); diff --git a/ReactCommon/fabric/uimanager/UIManager.cpp b/ReactCommon/fabric/uimanager/UIManager.cpp index e8f1a54d826..ba322cbe42f 100644 --- a/ReactCommon/fabric/uimanager/UIManager.cpp +++ b/ReactCommon/fabric/uimanager/UIManager.cpp @@ -49,7 +49,6 @@ SharedShadowNode UIManager::createNode( props, RawProps(folly::dynamic::object("name", name))) : props, /* .children = */ ShadowNodeFragment::childrenPlaceholder(), - /* .localData = */ ShadowNodeFragment::localDataPlaceholder(), /* .state = */ state, }, ShadowNodeFamilyFragment{tag, surfaceId, eventEmitter}); @@ -209,8 +208,6 @@ void UIManager::updateState( return oldShadowNode.clone({ /* .props = */ ShadowNodeFragment::propsPlaceholder(), /* .children = */ ShadowNodeFragment::childrenPlaceholder(), - /* .localData = */ - ShadowNodeFragment::localDataPlaceholder(), /* .state = */ state, }); });