Move core components to iOS Plugins

Summary:
Move core components to iOS Plugins infra

Changelog:[internal]

Reviewed By: shergin

Differential Revision: D18749786

fbshipit-source-id: 910cff4ec4c8b6de0768605c8561c4a28d410a70
This commit is contained in:
Samuel Susla 2019-12-10 03:09:33 -08:00 коммит произвёл Facebook Github Bot
Родитель dd8e5f468a
Коммит 1051b59af6
10 изменённых файлов: 64 добавлений и 15 удалений

Просмотреть файл

@ -9,6 +9,8 @@
#import <react/uimanager/ComponentDescriptorProvider.h>
#import "RCTARTSurfaceViewComponentDescriptor.h"
#import "FBRCTFabricComponentsPlugins.h"
using namespace facebook::react;
@implementation RCTARTSurfaceViewComponentView {
@ -32,3 +34,8 @@ using namespace facebook::react;
}
@end
Class<RCTComponentViewProtocol> RCTARTSurfaceViewCls(void)
{
return RCTARTSurfaceViewComponentView.class;
}

Просмотреть файл

@ -11,6 +11,8 @@
#import <react/components/rncore/EventEmitters.h>
#import <react/components/rncore/Props.h>
#import "FBRCTFabricComponentsPlugins.h"
using namespace facebook::react;
static UIActivityIndicatorViewStyle convertActivityIndicatorViewStyle(const ActivityIndicatorViewSize &size)
@ -88,3 +90,8 @@ static UIActivityIndicatorViewStyle convertActivityIndicatorViewStyle(const Acti
}
@end
Class<RCTComponentViewProtocol> RCTActivityIndicatorViewCls(void)
{
return RCTActivityIndicatorViewComponentView.class;
}

Просмотреть файл

@ -13,6 +13,7 @@
#import <react/components/rncore/EventEmitters.h>
#import <react/components/rncore/Props.h>
#import "FBRCTFabricComponentsPlugins.h"
#import "RCTConversions.h"
#import "RCTFabricModalHostViewController.h"
@ -215,3 +216,8 @@ static ModalHostViewOnOrientationChangeStruct onOrientationChangeStruct(CGRect r
}
@end
Class<RCTComponentViewProtocol> RCTModalHostViewCls(void)
{
return RCTModalHostViewComponentView.class;
}

Просмотреть файл

@ -31,6 +31,13 @@ Class<RCTComponentViewProtocol> RCTFabricComponentsProvider(const char *name);
// Lookup functions
Class<RCTComponentViewProtocol> RCTSafeAreaViewCls(void) __attribute__((used));
Class<RCTComponentViewProtocol> RCTScrollViewCls(void) __attribute__((used));
Class<RCTComponentViewProtocol> RCTPullToRefreshViewCls(void) __attribute__((used));
Class<RCTComponentViewProtocol> RCTActivityIndicatorViewCls(void) __attribute__((used));
Class<RCTComponentViewProtocol> RCTSliderCls(void) __attribute__((used));
Class<RCTComponentViewProtocol> RCTSwitchCls(void) __attribute__((used));
Class<RCTComponentViewProtocol> RCTUnimplementedNativeViewCls(void) __attribute__((used));
Class<RCTComponentViewProtocol> RCTModalHostViewCls(void) __attribute__((used));
Class<RCTComponentViewProtocol> RCTARTSurfaceViewCls(void) __attribute__((used));
#ifdef __cplusplus
}

Просмотреть файл

@ -20,6 +20,13 @@ Class<RCTComponentViewProtocol> RCTFabricComponentsProvider(const char *name) {
static std::unordered_map<std::string, Class (*)(void)> sFabricComponentsClassMap = {
{"SafeAreaView", RCTSafeAreaViewCls},
{"ScrollView", RCTScrollViewCls},
{"PullToRefreshView", RCTPullToRefreshViewCls},
{"ActivityIndicatorView", RCTActivityIndicatorViewCls},
{"Slider", RCTSliderCls},
{"Switch", RCTSwitchCls},
{"UnimplementedNativeView", RCTUnimplementedNativeViewCls},
{"ModalHostView", RCTModalHostViewCls},
{"ARTSurfaceView", RCTARTSurfaceViewCls},
};
auto p = sFabricComponentsClassMap.find(name);

Просмотреть файл

@ -16,6 +16,8 @@
#import <React/RCTRefreshableProtocol.h>
#import <React/RCTScrollViewComponentView.h>
#import "FBRCTFabricComponentsPlugins.h"
using namespace facebook::react;
@interface RCTPullToRefreshViewComponentView () <RCTPullToRefreshViewViewProtocol, RCTRefreshableProtocol>
@ -181,3 +183,8 @@ using namespace facebook::react;
}
@end
Class<RCTComponentViewProtocol> RCTPullToRefreshViewCls(void)
{
return RCTPullToRefreshViewComponentView.class;
}

Просмотреть файл

@ -14,6 +14,8 @@
#import <react/components/slider/SliderComponentDescriptor.h>
#import <react/components/slider/SliderLocalData.h>
#import "FBRCTFabricComponentsPlugins.h"
using namespace facebook::react;
@interface RCTSliderComponentView () <RCTImageResponseDelegate>
@ -333,3 +335,8 @@ using namespace facebook::react;
}
@end
Class<RCTComponentViewProtocol> RCTSliderCls(void)
{
return RCTSliderComponentView.class;
}

Просмотреть файл

@ -12,6 +12,8 @@
#import <react/components/rncore/Props.h>
#import <react/components/rncore/RCTComponentViewHelpers.h>
#import "FBRCTFabricComponentsPlugins.h"
using namespace facebook::react;
@interface RCTSwitchComponentView () <RCTSwitchViewProtocol>
@ -113,3 +115,8 @@ using namespace facebook::react;
}
@end
Class<RCTComponentViewProtocol> RCTSwitchCls(void)
{
return RCTSwitchComponentView.class;
}

Просмотреть файл

@ -16,6 +16,8 @@
#import <React/RCTConversions.h>
#import "FBRCTFabricComponentsPlugins.h"
using namespace facebook::react;
@implementation RCTUnimplementedViewComponentView {
@ -64,3 +66,8 @@ using namespace facebook::react;
}
@end
Class<RCTComponentViewProtocol> RCTUnimplementedNativeViewCls(void)
{
return RCTUnimplementedViewComponentView.class;
}

Просмотреть файл

@ -16,20 +16,14 @@
#import <react/core/ReactPrimitives.h>
#import <react/uimanager/ComponentDescriptorProviderRegistry.h>
#import "RCTARTSurfaceViewComponentView.h"
#import "RCTActivityIndicatorViewComponentView.h"
#import "RCTComponentViewClassDescriptor.h"
#import "RCTFabricComponentsPlugins.h"
#import "RCTImageComponentView.h"
#import "RCTLegacyViewManagerInteropComponentView.h"
#import "RCTModalHostViewComponentView.h"
#import "RCTMountingTransactionObserving.h"
#import "RCTParagraphComponentView.h"
#import "RCTPullToRefreshViewComponentView.h"
#import "RCTRootComponentView.h"
#import "RCTSliderComponentView.h"
#import "RCTSwitchComponentView.h"
#import "RCTUnimplementedNativeComponentView.h"
#import "RCTUnimplementedViewComponentView.h"
#import "RCTViewComponentView.h"
@ -47,17 +41,10 @@ using namespace facebook::react;
{
RCTComponentViewFactory *componentViewFactory = [[RCTComponentViewFactory alloc] init];
[componentViewFactory registerComponentViewClass:[RCTViewComponentView class]];
[componentViewFactory registerComponentViewClass:[RCTRootComponentView class]];
[componentViewFactory registerComponentViewClass:[RCTPullToRefreshViewComponentView class]];
[componentViewFactory registerComponentViewClass:[RCTViewComponentView class]];
[componentViewFactory registerComponentViewClass:[RCTImageComponentView class]];
[componentViewFactory registerComponentViewClass:[RCTParagraphComponentView class]];
[componentViewFactory registerComponentViewClass:[RCTActivityIndicatorViewComponentView class]];
[componentViewFactory registerComponentViewClass:[RCTSliderComponentView class]];
[componentViewFactory registerComponentViewClass:[RCTSwitchComponentView class]];
[componentViewFactory registerComponentViewClass:[RCTUnimplementedNativeComponentView class]];
[componentViewFactory registerComponentViewClass:[RCTModalHostViewComponentView class]];
[componentViewFactory registerComponentViewClass:[RCTARTSurfaceViewComponentView class]];
auto providerRegistry = &componentViewFactory->_providerRegistry;