Delete local data from Fabric android

Summary:
LocalData was fully replaced by State, this diff removes dead code thas was previously used to update local Data
changelog: [Internal] Internal cleanup on Fabric Android code

Reviewed By: shergin

Differential Revision: D21621481

fbshipit-source-id: a3e38300a54a85adff9145cdeea1e89dad09103f
This commit is contained in:
David Vacca
2020-05-18 17:57:28 -07:00
committed by Facebook GitHub Bot
parent 1f95c9b62e
commit 04b8c9c925
5 changed files with 0 additions and 93 deletions
@@ -33,7 +33,6 @@ import com.facebook.react.fabric.mounting.mountitems.RemoveMountItem;
import com.facebook.react.fabric.mounting.mountitems.SendAccessibilityEvent;
import com.facebook.react.fabric.mounting.mountitems.UpdateEventEmitterMountItem;
import com.facebook.react.fabric.mounting.mountitems.UpdateLayoutMountItem;
import com.facebook.react.fabric.mounting.mountitems.UpdateLocalDataMountItem;
import com.facebook.react.fabric.mounting.mountitems.UpdatePaddingMountItem;
import com.facebook.react.fabric.mounting.mountitems.UpdatePropsMountItem;
import com.facebook.react.fabric.mounting.mountitems.UpdateStateMountItem;
@@ -123,7 +122,6 @@ public class FabricJSIModuleProvider implements JSIModuleProvider<UIManager> {
SendAccessibilityEvent.class.getClass();
UpdateEventEmitterMountItem.class.getClass();
UpdateLayoutMountItem.class.getClass();
UpdateLocalDataMountItem.class.getClass();
UpdatePaddingMountItem.class.getClass();
UpdatePropsMountItem.class.getClass();
UpdateStateMountItem.class.getClass();
@@ -63,7 +63,6 @@ import com.facebook.react.fabric.mounting.mountitems.RemoveMountItem;
import com.facebook.react.fabric.mounting.mountitems.SendAccessibilityEvent;
import com.facebook.react.fabric.mounting.mountitems.UpdateEventEmitterMountItem;
import com.facebook.react.fabric.mounting.mountitems.UpdateLayoutMountItem;
import com.facebook.react.fabric.mounting.mountitems.UpdateLocalDataMountItem;
import com.facebook.react.fabric.mounting.mountitems.UpdatePaddingMountItem;
import com.facebook.react.fabric.mounting.mountitems.UpdatePropsMountItem;
import com.facebook.react.fabric.mounting.mountitems.UpdateStateMountItem;
@@ -395,14 +394,6 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
return new UpdatePropsMountItem(reactTag, map);
}
@DoNotStrip
@SuppressWarnings("unused")
@AnyThread
@ThreadConfined(ANY)
private MountItem updateLocalDataMountItem(int reactTag, ReadableMap newLocalData) {
return new UpdateLocalDataMountItem(reactTag, newLocalData);
}
@DoNotStrip
@SuppressWarnings("unused")
@AnyThread
@@ -373,37 +373,6 @@ public class MountingManager {
}
}
@UiThread
public void updateLocalData(int reactTag, @NonNull ReadableMap newLocalData) {
UiThreadUtil.assertOnUiThread();
ViewState viewState = getViewState(reactTag);
if (viewState.mCurrentProps == null) {
throw new IllegalStateException(
"Can not update local data to view without props: " + reactTag);
}
if (viewState.mCurrentLocalData != null
&& newLocalData.hasKey("hash")
&& viewState.mCurrentLocalData.getDouble("hash") == newLocalData.getDouble("hash")
&& viewState.mCurrentLocalData.equals(newLocalData)) {
return;
}
viewState.mCurrentLocalData = newLocalData;
ViewManager viewManager = viewState.mViewManager;
if (viewManager == null) {
throw new IllegalStateException("Unable to find ViewManager for view: " + viewState);
}
Object extraData =
viewManager.updateLocalData(
viewState.mView,
viewState.mCurrentProps,
new ReactStylesDiffMap(viewState.mCurrentLocalData));
if (extraData != null) {
viewManager.updateExtraData(viewState.mView, extraData);
}
}
@UiThread
public void updateState(final int reactTag, @Nullable StateWrapper stateWrapper) {
UiThreadUtil.assertOnUiThread();
@@ -1,46 +0,0 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.fabric.mounting.mountitems;
import static com.facebook.react.fabric.FabricUIManager.IS_DEVELOPMENT_ENVIRONMENT;
import androidx.annotation.NonNull;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.fabric.mounting.MountingManager;
public class UpdateLocalDataMountItem implements MountItem {
private final int mReactTag;
@NonNull private final ReadableMap mNewLocalData;
public UpdateLocalDataMountItem(int reactTag, @NonNull ReadableMap newLocalData) {
mReactTag = reactTag;
mNewLocalData = newLocalData;
}
@Override
public void execute(@NonNull MountingManager mountingManager) {
mountingManager.updateLocalData(mReactTag, mNewLocalData);
}
public @NonNull ReadableMap getNewLocalData() {
return mNewLocalData;
}
@Override
public String toString() {
StringBuilder result =
new StringBuilder("UpdateLocalDataMountItem [").append(mReactTag).append("]");
if (IS_DEVELOPMENT_ENVIRONMENT) {
result.append(" localData: ").append(mNewLocalData);
}
return result.toString();
}
}
@@ -273,11 +273,6 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode>
return ViewManagerPropertyUpdater.getNativeProps(getClass(), getShadowNodeClass());
}
public @Nullable Object updateLocalData(
@NonNull T view, ReactStylesDiffMap props, ReactStylesDiffMap localData) {
return null;
}
/**
* Subclasses can implement this method to receive state updates shared between all instances of
* this component type.