diff --git a/RNTester/README.md b/RNTester/README.md index 33dfed103e0796..14133712cafcf1 100644 --- a/RNTester/README.md +++ b/RNTester/README.md @@ -70,7 +70,7 @@ When developing E2E tests, you may want to run in development mode, so that chan detox build -c ios.sim.debug detox test -c ios.sim.debug -You will also need to have Metro Bundler running in another terminal. Note that if you've previously run the E2E tests in release mode, you may need to delete the `RNTester/build` folder before rerunning `detox build`. +You will also need to have Metro running in another terminal. Note that if you've previously run the E2E tests in release mode, you may need to delete the `RNTester/build` folder before rerunning `detox build`. ## Building from source diff --git a/React/DevSupport/RCTInspectorDevServerHelper.mm b/React/DevSupport/RCTInspectorDevServerHelper.mm index ab339f5da14195..466eb8f543659d 100644 --- a/React/DevSupport/RCTInspectorDevServerHelper.mm +++ b/React/DevSupport/RCTInspectorDevServerHelper.mm @@ -7,8 +7,8 @@ #if RCT_DEV && !TARGET_OS_UIKITFORMAC -#import #import +#import #import #import @@ -37,12 +37,14 @@ if (inspectorProxyPortStr && [inspectorProxyPortStr length] > 0) { inspectorProxyPort = [NSNumber numberWithInt:[inspectorProxyPortStr intValue]]; } - NSString *escapedDeviceName = [[[UIDevice currentDevice] name] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet]; - NSString *escapedAppName = [[[NSBundle mainBundle] bundleIdentifier] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet]; + NSString *escapedDeviceName = [[[UIDevice currentDevice] name] + stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet]; + NSString *escapedAppName = [[[NSBundle mainBundle] bundleIdentifier] + stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet]; return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/inspector/device?name=%@&app=%@", - getServerHost(bundleURL, inspectorProxyPort), - escapedDeviceName, - escapedAppName]]; + getServerHost(bundleURL, inspectorProxyPort), + escapedDeviceName, + escapedAppName]]; } static NSURL *getAttachDeviceUrl(NSURL *bundleURL, NSString *title) @@ -52,18 +54,20 @@ if (metroBundlerPortStr && [metroBundlerPortStr length] > 0) { metroBundlerPort = [NSNumber numberWithInt:[metroBundlerPortStr intValue]]; } - NSString *escapedDeviceName = [[[UIDevice currentDevice] name] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLHostAllowedCharacterSet]; - NSString *escapedAppName = [[[NSBundle mainBundle] bundleIdentifier] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLHostAllowedCharacterSet]; + NSString *escapedDeviceName = [[[UIDevice currentDevice] name] + stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLHostAllowedCharacterSet]; + NSString *escapedAppName = [[[NSBundle mainBundle] bundleIdentifier] + stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLHostAllowedCharacterSet]; return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/attach-debugger-nuclide?title=%@&device=%@&app=%@", - getServerHost(bundleURL, metroBundlerPort), - title, - escapedDeviceName, - escapedAppName]]; + getServerHost(bundleURL, metroBundlerPort), + title, + escapedDeviceName, + escapedAppName]]; } @implementation RCTInspectorDevServerHelper -RCT_NOT_IMPLEMENTED(- (instancetype)init) +RCT_NOT_IMPLEMENTED(-(instancetype)init) static NSMutableDictionary *socketConnections = nil; @@ -74,23 +78,18 @@ static void sendEventToAllConnections(NSString *event) } } -static void displayErrorAlert(UIViewController *view, NSString *message) { - UIAlertController *alert = - [UIAlertController alertControllerWithTitle:nil - message:message - preferredStyle:UIAlertControllerStyleAlert]; +static void displayErrorAlert(UIViewController *view, NSString *message) +{ + UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil + message:message + preferredStyle:UIAlertControllerStyleAlert]; [view presentViewController:alert animated:YES completion:nil]; - dispatch_after( - dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * 2.5), - dispatch_get_main_queue(), - ^{ - [alert dismissViewControllerAnimated:YES completion:nil]; - }); + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * 2.5), dispatch_get_main_queue(), ^{ + [alert dismissViewControllerAnimated:YES completion:nil]; + }); } -+ (void)attachDebugger:(NSString *)owner - withBundleURL:(NSURL *)bundleURL - withView:(UIViewController *)view ++ (void)attachDebugger:(NSString *)owner withBundleURL:(NSURL *)bundleURL withView:(UIViewController *)view { NSURL *url = getAttachDeviceUrl(bundleURL, owner); @@ -98,15 +97,15 @@ + (void)attachDebugger:(NSString *)owner [request setHTTPMethod:@"GET"]; __weak UIViewController *viewCapture = view; - [[[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler: - ^(__unused NSData *_Nullable data, - __unused NSURLResponse *_Nullable response, - NSError *_Nullable error) { - UIViewController *viewCaptureStrong = viewCapture; - if (error != nullptr && viewCaptureStrong != nullptr) { - displayErrorAlert(viewCaptureStrong, @"The request to attach Nuclide couldn't reach Metro Bundler!"); - } - }] resume]; + [[[NSURLSession sharedSession] + dataTaskWithRequest:request + completionHandler:^( + __unused NSData *_Nullable data, __unused NSURLResponse *_Nullable response, NSError *_Nullable error) { + UIViewController *viewCaptureStrong = viewCapture; + if (error != nullptr && viewCaptureStrong != nullptr) { + displayErrorAlert(viewCaptureStrong, @"The request to attach Nuclide couldn't reach Metro!"); + } + }] resume]; } + (void)disableDebugger diff --git a/scripts/launchPackager.bat b/scripts/launchPackager.bat index 83bfb8dc138a57..ce71959a16d046 100644 --- a/scripts/launchPackager.bat +++ b/scripts/launchPackager.bat @@ -4,7 +4,7 @@ :: LICENSE file in the root directory of this source tree. @echo off -title Metro Bundler +title Metro call .packager.bat cd ../../../ node "%~dp0..\cli.js" start diff --git a/scripts/launchPackager.command b/scripts/launchPackager.command index 1c1278deb129a3..4a7748141bb639 100755 --- a/scripts/launchPackager.command +++ b/scripts/launchPackager.command @@ -5,7 +5,7 @@ # LICENSE file in the root directory of this source tree. # Set terminal title -echo -en "\\033]0;Metro Bundler\\a" +echo -en "\\033]0;Metro\\a" clear THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd) diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index 8192eb94bc749e..3cee642678315e 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -12,7 +12,7 @@ set -x DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH -# Enables iOS devices to get the IP address of the machine running Metro Bundler +# Enables iOS devices to get the IP address of the machine running Metro if [[ "$CONFIGURATION" = *Debug* && ! "$PLATFORM_NAME" == *simulator ]]; then IP=$(ipconfig getifaddr en0) if [ -z "$IP" ]; then