Remove unused websocket-executor-name and websocket-executor-port options

Reviewed By: davidaurelio

Differential Revision: D4745529

fbshipit-source-id: 2c69aca33c999ccf2af8dbf8d9af2c1d123b59cd
This commit is contained in:
Pieter De Baets 2017-03-22 05:27:58 -07:00 committed by Facebook Github Bot
parent f39ef36190
commit 0ea1ea5fb7
4 changed files with 6 additions and 32 deletions

View File

@ -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];
}

View File

@ -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;
}]];

View File

@ -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.

View File

@ -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];