From 0ea1ea5fb7cdcd8c47ccf08d94fdce2f49f3b819 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Wed, 22 Mar 2017 05:27:58 -0700 Subject: [PATCH] Remove unused websocket-executor-name and websocket-executor-port options Reviewed By: davidaurelio Differential Revision: D4745529 fbshipit-source-id: 2c69aca33c999ccf2af8dbf8d9af2c1d123b59cd --- Libraries/WebSocket/RCTWebSocketExecutor.m | 14 ++------------ React/Modules/RCTDevMenu.m | 11 ++++------- React/Modules/RCTDevSettings.h | 6 ------ React/Modules/RCTDevSettings.mm | 7 ------- 4 files changed, 6 insertions(+), 32 deletions(-) diff --git a/Libraries/WebSocket/RCTWebSocketExecutor.m b/Libraries/WebSocket/RCTWebSocketExecutor.m index 7534181bd..b256374fc 100644 --- a/Libraries/WebSocket/RCTWebSocketExecutor.m +++ b/Libraries/WebSocket/RCTWebSocketExecutor.m @@ -54,18 +54,8 @@ RCT_EXPORT_MODULE() - (void)setUp { if (!_url) { - NSUserDefaults *standardDefaults = [NSUserDefaults standardUserDefaults]; - - // TODO t16297016: this seems to be unused, remove? - NSInteger port = [standardDefaults integerForKey:@"websocket-executor-port"]; - if (!port) { - port = [[[_bridge bundleURL] port] integerValue] ?: 8081; - } - - NSString *host = [[_bridge bundleURL] host]; - if (!host) { - host = @"localhost"; - } + NSInteger port = [[[_bridge bundleURL] port] integerValue] ?: 8081; + NSString *host = [[_bridge bundleURL] host] ?: @"localhost"; NSString *URLString = [NSString stringWithFormat:@"http://%@:%zd/debugger-proxy?role=client", host, port]; _url = [RCTConvert NSURL:URLString]; } diff --git a/React/Modules/RCTDevMenu.m b/React/Modules/RCTDevMenu.m index 2c0ce3883..7dcce131c 100644 --- a/React/Modules/RCTDevMenu.m +++ b/React/Modules/RCTDevMenu.m @@ -193,20 +193,17 @@ RCT_EXPORT_MODULE() [bridge reload]; }]]; - NSString *executorName = devSettings.websocketExecutorName ?: @"Remote JS"; if (!devSettings.isRemoteDebuggingAvailable) { - [items addObject:[RCTDevMenuItem buttonItemWithTitle:[NSString stringWithFormat:@"%@ Debugger Unavailable", executorName] handler:^{ + [items addObject:[RCTDevMenuItem buttonItemWithTitle:@"Remote JS Debugger Unavailable" handler:^{ UIAlertController *alertController = [UIAlertController - alertControllerWithTitle:[NSString stringWithFormat:@"%@ Debugger Unavailable", executorName] - message:[NSString stringWithFormat:@"You need to include the RCTWebSocket library to enable %@ debugging", executorName] + alertControllerWithTitle:@"Remote JS Debugger Unavailable" + message:@"You need to include the RCTWebSocket library to enable remote JS debugging" preferredStyle:UIAlertControllerStyleAlert]; [RCTPresentedViewController() presentViewController:alertController animated:YES completion:NULL]; }]]; } else { [items addObject:[RCTDevMenuItem buttonItemWithTitleBlock:^NSString *{ - return devSettings.isDebuggingRemotely ? - [NSString stringWithFormat:@"Stop %@ Debugging", executorName] : - [NSString stringWithFormat:@"Debug %@", executorName]; + return devSettings.isDebuggingRemotely ? @"Stop Remote JS Debugging" : @"Debug JS Remotely"; } handler:^{ devSettings.isDebuggingRemotely = !devSettings.isDebuggingRemotely; }]]; diff --git a/React/Modules/RCTDevSettings.h b/React/Modules/RCTDevSettings.h index d8ffd7c90..cfecfa5d5 100644 --- a/React/Modules/RCTDevSettings.h +++ b/React/Modules/RCTDevSettings.h @@ -42,12 +42,6 @@ */ @property (nonatomic, assign) BOOL isDebuggingRemotely; -/** - * Alternate name for the websocket executor, if not the generic term "remote". - * TODO t16297016: this seems to be unused, remove? - */ -@property (nonatomic, readonly) NSString *websocketExecutorName; - /* * Whether shaking will show RCTDevMenu. The menu is enabled by default if RCT_DEV=1, but * you may wish to disable it so that you can provide your own shake handler. diff --git a/React/Modules/RCTDevSettings.mm b/React/Modules/RCTDevSettings.mm index d97aa6031..241838b0d 100644 --- a/React/Modules/RCTDevSettings.mm +++ b/React/Modules/RCTDevSettings.mm @@ -28,7 +28,6 @@ NSString *const kRCTDevSettingHotLoadingEnabled = @"hotLoadingEnabled"; NSString *const kRCTDevSettingLiveReloadEnabled = @"liveReloadEnabled"; NSString *const kRCTDevSettingIsInspectorShown = @"showInspector"; NSString *const kRCTDevSettingIsDebuggingRemotely = @"isDebuggingRemotely"; -NSString *const kRCTDevSettingWebsocketExecutorName = @"websocket-executor-name"; NSString *const kRCTDevSettingExecutorOverrideClass = @"executor-override"; NSString *const kRCTDevSettingShakeToShowDevMenu = @"shakeToShow"; NSString *const kRCTDevSettingIsPerfMonitorShown = @"RCTPerfMonitorKey"; @@ -197,12 +196,6 @@ RCT_EXPORT_METHOD(reload) [_bridge reload]; } -- (NSString *)websocketExecutorName -{ - // This value is passed as a command-line argument, so fall back to reading from NSUserDefaults directly - return [[NSUserDefaults standardUserDefaults] stringForKey:kRCTDevSettingWebsocketExecutorName]; -} - - (void)setIsShakeToShowDevMenuEnabled:(BOOL)isShakeToShowDevMenuEnabled { [self _updateSettingWithValue:@(isShakeToShowDevMenuEnabled) forKey:kRCTDevSettingShakeToShowDevMenu];