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
This commit is contained in:
Родитель
9948fbdeec
Коммит
6a128bd810
|
@ -426,29 +426,6 @@ local_ref<JMountItem::javaobject> createInsertMountItem(
|
|||
mutation.index);
|
||||
}
|
||||
|
||||
local_ref<JMountItem::javaobject> createUpdateLocalData(
|
||||
const jni::global_ref<jobject> &javaUIManager,
|
||||
const ShadowViewMutation &mutation) {
|
||||
static auto updateLocalDataInstruction =
|
||||
jni::findClassStatic(UIManagerJavaDescriptor)
|
||||
->getMethod<alias_ref<JMountItem>(jint, ReadableMap::javaobject)>(
|
||||
"updateLocalDataMountItem");
|
||||
|
||||
auto localData = mutation.newChildShadowView.localData;
|
||||
|
||||
folly::dynamic newLocalData = folly::dynamic::object();
|
||||
if (localData) {
|
||||
newLocalData = localData->getDynamic();
|
||||
}
|
||||
|
||||
local_ref<ReadableNativeMap::jhybridobject> readableNativeMap =
|
||||
ReadableNativeMap::newObjectCxxArgs(newLocalData);
|
||||
return updateLocalDataInstruction(
|
||||
javaUIManager,
|
||||
mutation.newChildShadowView.tag,
|
||||
castReadableMap(readableNativeMap).get());
|
||||
}
|
||||
|
||||
local_ref<JMountItem::javaobject> createUpdateStateMountItem(
|
||||
const jni::global_ref<jobject> &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);
|
||||
|
|
|
@ -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<DebugStringConvertibleObject> 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)},
|
||||
};
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include <folly/Hash.h>
|
||||
#include <react/core/EventEmitter.h>
|
||||
#include <react/core/LayoutMetrics.h>
|
||||
#include <react/core/LocalData.h>
|
||||
#include <react/core/Props.h>
|
||||
#include <react/core/ReactPrimitives.h>
|
||||
#include <react/core/ShadowNode.h>
|
||||
|
@ -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<facebook::react::ShadowView> {
|
|||
shadowView.tag,
|
||||
shadowView.props,
|
||||
shadowView.eventEmitter,
|
||||
shadowView.localData,
|
||||
shadowView.state);
|
||||
}
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче