From cd2b384ec42843c1f68fcaef344ffd2f17dd0a5d Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Wed, 7 Dec 2016 16:27:55 -0800 Subject: [PATCH] Remove deprecated RCTReloadNotification Reviewed By: adamjernst Differential Revision: D4294180 fbshipit-source-id: 6837597df2a798661c993c6f63ec430989954de6 --- React/Base/RCTBridge.h | 8 +------- React/Base/RCTBridge.m | 5 +---- React/Modules/RCTDevMenu.m | 2 +- React/Modules/RCTExceptionsManager.m | 2 +- React/Modules/RCTRedBox.m | 5 +++-- React/Profiler/RCTProfile.m | 9 ++++----- 6 files changed, 11 insertions(+), 20 deletions(-) diff --git a/React/Base/RCTBridge.h b/React/Base/RCTBridge.h index e7f76ffba3079c..4ef04131815457 100644 --- a/React/Base/RCTBridge.h +++ b/React/Base/RCTBridge.h @@ -20,12 +20,6 @@ @class RCTEventDispatcher; @class RCTPerformanceLogger; -/** - * This notification triggers a reload of all bridges currently running. - * Deprecated, use RCTBridge::requestReload instead. - */ -RCT_EXTERN NSString *const RCTReloadNotification DEPRECATED_ATTRIBUTE; - /** * This notification fires when the bridge starts loading the JS bundle. */ @@ -203,7 +197,7 @@ RCT_EXTERN NSString *RCTBridgeModuleNameForClass(Class bridgeModuleClass); /** * Inform the bridge, and anything subscribing to it, that it should reload. */ -- (void)requestReload; +- (void)requestReload __deprecated_msg("Call reload instead"); /** * Says whether bridge has started recieving calls from javascript. diff --git a/React/Base/RCTBridge.m b/React/Base/RCTBridge.m index 4876bd2fd93364..80ef81ffab6b08 100644 --- a/React/Base/RCTBridge.m +++ b/React/Base/RCTBridge.m @@ -21,7 +21,6 @@ #import "RCTProfile.h" #import "RCTUtils.h" -NSString *const RCTReloadNotification = @"RCTReloadNotification"; NSString *const RCTJavaScriptWillStartLoadingNotification = @"RCTJavaScriptWillStartLoadingNotification"; NSString *const RCTJavaScriptDidLoadNotification = @"RCTJavaScriptDidLoadNotification"; NSString *const RCTJavaScriptDidFailToLoadNotification = @"RCTJavaScriptDidFailToLoadNotification"; @@ -200,7 +199,6 @@ - (void)dealloc * This runs only on the main thread, but crashes the subclass * RCTAssertMainQueue(); */ - [[NSNotificationCenter defaultCenter] removeObserver:self]; [self invalidate]; } @@ -216,7 +214,7 @@ - (void)bindKeys [commands registerKeyCommandWithInput:@"r" modifierFlags:UIKeyModifierCommand action:^(__unused UIKeyCommand *command) { - [weakSelf requestReload]; + [weakSelf reload]; }]; #endif } @@ -273,7 +271,6 @@ - (void)reload - (void)requestReload { - [[NSNotificationCenter defaultCenter] postNotificationName:RCTReloadNotification object:self]; [self reload]; } diff --git a/React/Modules/RCTDevMenu.m b/React/Modules/RCTDevMenu.m index 35a8e96ae76d84..43d59f340ba121 100644 --- a/React/Modules/RCTDevMenu.m +++ b/React/Modules/RCTDevMenu.m @@ -563,7 +563,7 @@ - (RCTDevMenuAlertActionHandler)alertActionHandlerForDevItem:(RCTDevMenuItem *__ RCT_EXPORT_METHOD(reload) { - [_bridge requestReload]; + [_bridge reload]; } RCT_EXPORT_METHOD(debugRemotely:(BOOL)enableDebug) diff --git a/React/Modules/RCTExceptionsManager.m b/React/Modules/RCTExceptionsManager.m index aff7501828f10f..55048e6c0e1168 100644 --- a/React/Modules/RCTExceptionsManager.m +++ b/React/Modules/RCTExceptionsManager.m @@ -56,7 +56,7 @@ - (instancetype)initWithDelegate:(id)delegate static NSUInteger reloadRetries = 0; if (!RCT_DEBUG && reloadRetries < _maxReloadAttempts) { reloadRetries++; - [_bridge requestReload]; + [_bridge reload]; } else { NSString *description = [@"Unhandled JS Exception: " stringByAppendingString:message]; NSDictionary *errorInfo = @{ NSLocalizedDescriptionKey: description, RCTJSStackTraceKey: stack }; diff --git a/React/Modules/RCTRedBox.m b/React/Modules/RCTRedBox.m index 8c78c377e02ce8..62c9a3c6a17490 100644 --- a/React/Modules/RCTRedBox.m +++ b/React/Modules/RCTRedBox.m @@ -451,8 +451,9 @@ - (void)redBoxWindow:(__unused RCTRedBoxWindow *)redBoxWindow openStackFrameInEd [[[NSURLSession sharedSession] dataTaskWithRequest:request] resume]; } -- (void)reloadFromRedBoxWindow:(__unused RCTRedBoxWindow *)redBoxWindow { - [_bridge requestReload]; +- (void)reloadFromRedBoxWindow:(__unused RCTRedBoxWindow *)redBoxWindow +{ + [_bridge reload]; } @end diff --git a/React/Profiler/RCTProfile.m b/React/Profiler/RCTProfile.m index 4d022ca24afa16..8ee0a410d7b273 100644 --- a/React/Profiler/RCTProfile.m +++ b/React/Profiler/RCTProfile.m @@ -10,7 +10,6 @@ #import "RCTProfile.h" #import - #import #import #import @@ -19,15 +18,15 @@ #import #import "RCTAssert.h" -#import "RCTBridge.h" #import "RCTBridge+Private.h" +#import "RCTBridge.h" #import "RCTComponentData.h" #import "RCTDefines.h" +#import "RCTJSCExecutor.h" #import "RCTLog.h" #import "RCTModuleData.h" -#import "RCTUtils.h" #import "RCTUIManager.h" -#import "RCTJSCExecutor.h" +#import "RCTUtils.h" NSString *const RCTProfileDidStartProfiling = @"RCTProfileDidStartProfiling"; NSString *const RCTProfileDidEndProfiling = @"RCTProfileDidEndProfiling"; @@ -363,7 +362,7 @@ + (void)vsync:(CADisplayLink *)displayLink + (void)reload { - [RCTProfilingBridge() requestReload]; + [RCTProfilingBridge() reload]; } + (void)toggle:(UIButton *)target