Skip to content

Commit

Permalink
Remove deprecated RCTReloadNotification
Browse files Browse the repository at this point in the history
Reviewed By: adamjernst

Differential Revision: D4294180

fbshipit-source-id: 6837597df2a798661c993c6f63ec430989954de6
  • Loading branch information
javache authored and Martin Konicek committed Dec 12, 2016
1 parent 63d5bcb commit cd2b384
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 20 deletions.
8 changes: 1 addition & 7 deletions React/Base/RCTBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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.
Expand Down
5 changes: 1 addition & 4 deletions React/Base/RCTBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -200,7 +199,6 @@ - (void)dealloc
* This runs only on the main thread, but crashes the subclass
* RCTAssertMainQueue();
*/
[[NSNotificationCenter defaultCenter] removeObserver:self];
[self invalidate];
}

Expand All @@ -216,7 +214,7 @@ - (void)bindKeys
[commands registerKeyCommandWithInput:@"r"
modifierFlags:UIKeyModifierCommand
action:^(__unused UIKeyCommand *command) {
[weakSelf requestReload];
[weakSelf reload];
}];
#endif
}
Expand Down Expand Up @@ -273,7 +271,6 @@ - (void)reload

- (void)requestReload
{
[[NSNotificationCenter defaultCenter] postNotificationName:RCTReloadNotification object:self];
[self reload];
}

Expand Down
2 changes: 1 addition & 1 deletion React/Modules/RCTDevMenu.m
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ - (RCTDevMenuAlertActionHandler)alertActionHandlerForDevItem:(RCTDevMenuItem *__

RCT_EXPORT_METHOD(reload)
{
[_bridge requestReload];
[_bridge reload];
}

RCT_EXPORT_METHOD(debugRemotely:(BOOL)enableDebug)
Expand Down
2 changes: 1 addition & 1 deletion React/Modules/RCTExceptionsManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ - (instancetype)initWithDelegate:(id<RCTExceptionsManagerDelegate>)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 };
Expand Down
5 changes: 3 additions & 2 deletions React/Modules/RCTRedBox.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions React/Profiler/RCTProfile.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#import "RCTProfile.h"

#import <dlfcn.h>

#import <libkern/OSAtomic.h>
#import <mach/mach.h>
#import <objc/message.h>
Expand All @@ -19,15 +18,15 @@
#import <UIKit/UIKit.h>

#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";
Expand Down Expand Up @@ -363,7 +362,7 @@ + (void)vsync:(CADisplayLink *)displayLink

+ (void)reload
{
[RCTProfilingBridge() requestReload];
[RCTProfilingBridge() reload];
}

+ (void)toggle:(UIButton *)target
Expand Down

0 comments on commit cd2b384

Please sign in to comment.