Skip to content

Commit cd2b384

Browse files
javacheMartin Konicek
authored and
Martin Konicek
committed
Remove deprecated RCTReloadNotification
Reviewed By: adamjernst Differential Revision: D4294180 fbshipit-source-id: 6837597df2a798661c993c6f63ec430989954de6
1 parent 63d5bcb commit cd2b384

File tree

6 files changed

+11
-20
lines changed

6 files changed

+11
-20
lines changed

React/Base/RCTBridge.h

+1-7
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@
2020
@class RCTEventDispatcher;
2121
@class RCTPerformanceLogger;
2222

23-
/**
24-
* This notification triggers a reload of all bridges currently running.
25-
* Deprecated, use RCTBridge::requestReload instead.
26-
*/
27-
RCT_EXTERN NSString *const RCTReloadNotification DEPRECATED_ATTRIBUTE;
28-
2923
/**
3024
* This notification fires when the bridge starts loading the JS bundle.
3125
*/
@@ -203,7 +197,7 @@ RCT_EXTERN NSString *RCTBridgeModuleNameForClass(Class bridgeModuleClass);
203197
/**
204198
* Inform the bridge, and anything subscribing to it, that it should reload.
205199
*/
206-
- (void)requestReload;
200+
- (void)requestReload __deprecated_msg("Call reload instead");
207201

208202
/**
209203
* Says whether bridge has started recieving calls from javascript.

React/Base/RCTBridge.m

+1-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#import "RCTProfile.h"
2222
#import "RCTUtils.h"
2323

24-
NSString *const RCTReloadNotification = @"RCTReloadNotification";
2524
NSString *const RCTJavaScriptWillStartLoadingNotification = @"RCTJavaScriptWillStartLoadingNotification";
2625
NSString *const RCTJavaScriptDidLoadNotification = @"RCTJavaScriptDidLoadNotification";
2726
NSString *const RCTJavaScriptDidFailToLoadNotification = @"RCTJavaScriptDidFailToLoadNotification";
@@ -200,7 +199,6 @@ - (void)dealloc
200199
* This runs only on the main thread, but crashes the subclass
201200
* RCTAssertMainQueue();
202201
*/
203-
[[NSNotificationCenter defaultCenter] removeObserver:self];
204202
[self invalidate];
205203
}
206204

@@ -216,7 +214,7 @@ - (void)bindKeys
216214
[commands registerKeyCommandWithInput:@"r"
217215
modifierFlags:UIKeyModifierCommand
218216
action:^(__unused UIKeyCommand *command) {
219-
[weakSelf requestReload];
217+
[weakSelf reload];
220218
}];
221219
#endif
222220
}
@@ -273,7 +271,6 @@ - (void)reload
273271

274272
- (void)requestReload
275273
{
276-
[[NSNotificationCenter defaultCenter] postNotificationName:RCTReloadNotification object:self];
277274
[self reload];
278275
}
279276

React/Modules/RCTDevMenu.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ - (RCTDevMenuAlertActionHandler)alertActionHandlerForDevItem:(RCTDevMenuItem *__
563563

564564
RCT_EXPORT_METHOD(reload)
565565
{
566-
[_bridge requestReload];
566+
[_bridge reload];
567567
}
568568

569569
RCT_EXPORT_METHOD(debugRemotely:(BOOL)enableDebug)

React/Modules/RCTExceptionsManager.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ - (instancetype)initWithDelegate:(id<RCTExceptionsManagerDelegate>)delegate
5656
static NSUInteger reloadRetries = 0;
5757
if (!RCT_DEBUG && reloadRetries < _maxReloadAttempts) {
5858
reloadRetries++;
59-
[_bridge requestReload];
59+
[_bridge reload];
6060
} else {
6161
NSString *description = [@"Unhandled JS Exception: " stringByAppendingString:message];
6262
NSDictionary *errorInfo = @{ NSLocalizedDescriptionKey: description, RCTJSStackTraceKey: stack };

React/Modules/RCTRedBox.m

+3-2
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,9 @@ - (void)redBoxWindow:(__unused RCTRedBoxWindow *)redBoxWindow openStackFrameInEd
451451
[[[NSURLSession sharedSession] dataTaskWithRequest:request] resume];
452452
}
453453

454-
- (void)reloadFromRedBoxWindow:(__unused RCTRedBoxWindow *)redBoxWindow {
455-
[_bridge requestReload];
454+
- (void)reloadFromRedBoxWindow:(__unused RCTRedBoxWindow *)redBoxWindow
455+
{
456+
[_bridge reload];
456457
}
457458

458459
@end

React/Profiler/RCTProfile.m

+4-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#import "RCTProfile.h"
1111

1212
#import <dlfcn.h>
13-
1413
#import <libkern/OSAtomic.h>
1514
#import <mach/mach.h>
1615
#import <objc/message.h>
@@ -19,15 +18,15 @@
1918
#import <UIKit/UIKit.h>
2019

2120
#import "RCTAssert.h"
22-
#import "RCTBridge.h"
2321
#import "RCTBridge+Private.h"
22+
#import "RCTBridge.h"
2423
#import "RCTComponentData.h"
2524
#import "RCTDefines.h"
25+
#import "RCTJSCExecutor.h"
2626
#import "RCTLog.h"
2727
#import "RCTModuleData.h"
28-
#import "RCTUtils.h"
2928
#import "RCTUIManager.h"
30-
#import "RCTJSCExecutor.h"
29+
#import "RCTUtils.h"
3130

3231
NSString *const RCTProfileDidStartProfiling = @"RCTProfileDidStartProfiling";
3332
NSString *const RCTProfileDidEndProfiling = @"RCTProfileDidEndProfiling";
@@ -363,7 +362,7 @@ + (void)vsync:(CADisplayLink *)displayLink
363362

364363
+ (void)reload
365364
{
366-
[RCTProfilingBridge() requestReload];
365+
[RCTProfilingBridge() reload];
367366
}
368367

369368
+ (void)toggle:(UIButton *)target

0 commit comments

Comments
 (0)