Skip to content

Commit

Permalink
Fabric: remove LocalData from mounting layer
Browse files Browse the repository at this point in the history
Summary:
Changelog: [Internal]

We are moving away from LocalData in favour of State.
LocalData isn't used on iOS anymore, this diff removes it so it can't be reintroduced

Reviewed By: shergin

Differential Revision: D19250731

fbshipit-source-id: aaa5d79b4d885b6bf9b2df2d67d80ecd3d6982bc
  • Loading branch information
sammy-SC authored and facebook-github-bot committed Jan 6, 2020
1 parent 0c64733 commit b920bf8
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#import <react/components/text/ParagraphState.h>
#import <react/components/text/RawTextComponentDescriptor.h>
#import <react/components/text/TextComponentDescriptor.h>
#import <react/core/LocalData.h>
#import <react/graphics/Geometry.h>
#import <react/textlayoutmanager/RCTTextLayoutManager.h>
#import <react/textlayoutmanager/TextLayoutManager.h>
Expand Down
11 changes: 1 addition & 10 deletions React/Fabric/Mounting/RCTComponentViewProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#import <React/RCTPrimitives.h>
#import <react/core/EventEmitter.h>
#import <react/core/LayoutMetrics.h>
#import <react/core/LocalData.h>
#import <react/core/Props.h>
#import <react/core/State.h>
#import <react/uimanager/ComponentDescriptorProvider.h>
Expand All @@ -24,12 +23,11 @@ typedef NS_OPTIONS(NSInteger, RNComponentViewUpdateMask) {
RNComponentViewUpdateMaskNone = 0,
RNComponentViewUpdateMaskProps = 1 << 0,
RNComponentViewUpdateMaskEventEmitter = 1 << 1,
RNComponentViewUpdateMaskLocalData = 1 << 2,
RNComponentViewUpdateMaskState = 1 << 3,
RNComponentViewUpdateMaskLayoutMetrics = 1 << 4,

RNComponentViewUpdateMaskAll = RNComponentViewUpdateMaskProps | RNComponentViewUpdateMaskEventEmitter |
RNComponentViewUpdateMaskLocalData | RNComponentViewUpdateMaskState | RNComponentViewUpdateMaskLayoutMetrics
RNComponentViewUpdateMaskState | RNComponentViewUpdateMaskLayoutMetrics
};

/*
Expand Down Expand Up @@ -73,13 +71,6 @@ typedef NS_OPTIONS(NSInteger, RNComponentViewUpdateMask) {
- (void)updateProps:(facebook::react::Props::Shared const &)props
oldProps:(facebook::react::Props::Shared const &)oldProps;

/*
* Called for updating component's local data.
* Receiver must update native view props accordingly changed local data.
*/
- (void)updateLocalData:(facebook::react::SharedLocalData)localData
oldLocalData:(facebook::react::SharedLocalData)oldLocalData;

/*
* Called for updating component's state.
* Receiver must update native view according to changed state.
Expand Down
14 changes: 0 additions & 14 deletions React/Fabric/Mounting/RCTMountingManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,6 @@ static void RNUpdateLayoutMetricsMountInstruction(
oldLayoutMetrics:oldShadowView.layoutMetrics];
}

// `Update LocalData` instruction
static void RNUpdateLocalDataMountInstruction(ShadowViewMutation const &mutation, RCTComponentViewRegistry *registry)
{
auto const &oldShadowView = mutation.oldChildShadowView;
auto const &newShadowView = mutation.newChildShadowView;
auto const &componentViewDescriptor = [registry componentViewDescriptorWithTag:newShadowView.tag];
[componentViewDescriptor.view updateLocalData:newShadowView.localData oldLocalData:oldShadowView.localData];
}

// `Update State` instruction
static void RNUpdateStateMountInstruction(ShadowViewMutation const &mutation, RCTComponentViewRegistry *registry)
{
Expand Down Expand Up @@ -157,7 +148,6 @@ static void RNPerformMountInstructions(
case ShadowViewMutation::Insert: {
RNUpdatePropsMountInstruction(mutation, registry);
RNUpdateEventEmitterMountInstruction(mutation, registry);
RNUpdateLocalDataMountInstruction(mutation, registry);
RNUpdateStateMountInstruction(mutation, registry);
RNUpdateLayoutMetricsMountInstruction(mutation, registry);
RNFinalizeUpdatesMountInstruction(mutation, RNComponentViewUpdateMaskAll, registry);
Expand All @@ -182,10 +172,6 @@ static void RNPerformMountInstructions(
RNUpdateEventEmitterMountInstruction(mutation, registry);
mask |= RNComponentViewUpdateMaskEventEmitter;
}
if (oldChildShadowView.localData != newChildShadowView.localData) {
RNUpdateLocalDataMountInstruction(mutation, registry);
mask |= RNComponentViewUpdateMaskLocalData;
}
if (oldChildShadowView.state != newChildShadowView.state) {
RNUpdateStateMountInstruction(mutation, registry);
mask |= RNComponentViewUpdateMaskState;
Expand Down
3 changes: 0 additions & 3 deletions React/Fabric/Mounting/UIView+ComponentViewProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ NS_ASSUME_NONNULL_BEGIN

- (void)updateEventEmitter:(facebook::react::EventEmitter::Shared const &)eventEmitter;

- (void)updateLocalData:(facebook::react::SharedLocalData)localData
oldLocalData:(facebook::react::SharedLocalData)oldLocalData;

- (void)updateState:(facebook::react::State::Shared const &)state
oldState:(facebook::react::State::Shared const &)oldState;

Expand Down
5 changes: 0 additions & 5 deletions React/Fabric/Mounting/UIView+ComponentViewProtocol.mm
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ - (void)updateEventEmitter:(EventEmitter::Shared const &)eventEmitter
// Default implementation does nothing.
}

- (void)updateLocalData:(SharedLocalData)localData oldLocalData:(SharedLocalData)oldLocalData
{
// Default implementation does nothing.
}

- (void)updateState:(facebook::react::State::Shared const &)state
oldState:(facebook::react::State::Shared const &)oldState
{
Expand Down

0 comments on commit b920bf8

Please sign in to comment.