From aa4428cd132bb0d0dbc950b66d3b5f2a3c5b9322 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Thu, 27 Oct 2016 06:54:28 -0700 Subject: [PATCH] Remove customDirectEventTypes Summary: This method has been deprecated for a while and there are no internal use-cases left (customBubblingEventTypes is still used by RCTViewManager though). Reviewed By: fkgozali Differential Revision: D4083327 fbshipit-source-id: 261e0dce3b41714d13b46d146f87fc415eb9e817 --- .../RCTModuleInitNotificationRaceTests.m | 2 +- React/Views/RCTComponentData.m | 18 +++--------------- React/Views/RCTViewManager.h | 13 ------------- React/Views/RCTViewManager.m | 5 ----- 4 files changed, 4 insertions(+), 34 deletions(-) diff --git a/Examples/UIExplorer/UIExplorerUnitTests/RCTModuleInitNotificationRaceTests.m b/Examples/UIExplorer/UIExplorerUnitTests/RCTModuleInitNotificationRaceTests.m index 05d73709713..374b88a93a3 100644 --- a/Examples/UIExplorer/UIExplorerUnitTests/RCTModuleInitNotificationRaceTests.m +++ b/Examples/UIExplorer/UIExplorerUnitTests/RCTModuleInitNotificationRaceTests.m @@ -45,7 +45,7 @@ RCT_EXPORT_MODULE() #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-implementations" -- (NSArray *)customDirectEventTypes +- (NSArray *)customBubblingEventTypes { return @[@"foo"]; } diff --git a/React/Views/RCTComponentData.m b/React/Views/RCTComponentData.m index 0b9d8414cca..0010cde1b7d 100644 --- a/React/Views/RCTComponentData.m +++ b/React/Views/RCTComponentData.m @@ -395,17 +395,11 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init) - (NSDictionary *)viewConfig { + NSMutableArray *bubblingEvents = [NSMutableArray new]; + NSMutableArray *directEvents = [NSMutableArray new]; + #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - NSMutableArray *directEvents = [NSMutableArray new]; - if (RCTClassOverridesInstanceMethod(_managerClass, @selector(customDirectEventTypes))) { - NSArray *events = [self.manager customDirectEventTypes]; - for (NSString *event in events) { - [directEvents addObject:RCTNormalizeInputEventName(event)]; - } - } - - NSMutableArray *bubblingEvents = [NSMutableArray new]; if (RCTClassOverridesInstanceMethod(_managerClass, @selector(customBubblingEventTypes))) { NSArray *events = [self.manager customBubblingEventTypes]; for (NSString *event in events) { @@ -444,12 +438,6 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init) free(methods); #if RCT_DEBUG - for (NSString *event in directEvents) { - if ([bubblingEvents containsObject:event]) { - RCTLogError(@"Component '%@' registered '%@' as both a bubbling event " - "and a direct event", _name, event); - } - } for (NSString *event in bubblingEvents) { if ([directEvents containsObject:event]) { RCTLogError(@"Component '%@' registered '%@' as both a bubbling event " diff --git a/React/Views/RCTViewManager.h b/React/Views/RCTViewManager.h index 568cd867baa..d4ff7192b1d 100644 --- a/React/Views/RCTViewManager.h +++ b/React/Views/RCTViewManager.h @@ -63,19 +63,6 @@ typedef void (^RCTViewManagerUIBlock)(RCTUIManager *uiManager, NSDictionary *)customBubblingEventTypes __deprecated_msg("Use RCTBubblingEventBlock props instead."); -/** - * DEPRECATED: declare properties of type RCTDirectEventBlock instead - * - * Returns an array of names of events that can be sent by native views. This - * should return non-bubbling, directly-dispatched event types. The event name - * should not include a prefix such as 'on' or 'top', as this will be applied - * as needed. - * - * Note that this method is not inherited when you subclass a view module, and - * you should not call [super customDirectEventTypes] when overriding it. - */ -- (NSArray *)customDirectEventTypes __deprecated_msg("Use RCTDirectEventBlock props instead."); - /** * Called to notify manager that layout has finished, in case any calculated * properties need to be copied over from shadow view to view. diff --git a/React/Views/RCTViewManager.m b/React/Views/RCTViewManager.m index 794f1b1e417..e9448d92075 100644 --- a/React/Views/RCTViewManager.m +++ b/React/Views/RCTViewManager.m @@ -86,11 +86,6 @@ RCT_EXPORT_MODULE() ]; } -- (NSArray *)customDirectEventTypes -{ - return @[]; -} - - (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(__unused RCTShadowView *)shadowView { return nil;