Skip to content

Commit 88d0ac1

Browse files
cpojerfacebook-github-bot
authored andcommittedAug 16, 2019
Metro Bundler -> Metro
Summary: This bothers me, we renamed the project to drop the "Metro" a while ago. Reviewed By: rubennorte Differential Revision: D16831281 fbshipit-source-id: bb6de412eccda61b617580f3660e3e635f2d2815
1 parent bb625e5 commit 88d0ac1

File tree

5 files changed

+39
-40
lines changed

5 files changed

+39
-40
lines changed
 

‎RNTester/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ When developing E2E tests, you may want to run in development mode, so that chan
7070
detox build -c ios.sim.debug
7171
detox test -c ios.sim.debug
7272

73-
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`.
73+
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`.
7474

7575
## Building from source
7676

‎React/DevSupport/RCTInspectorDevServerHelper.mm

+35-36
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
#if RCT_DEV && !TARGET_OS_UIKITFORMAC
99

10-
#import <UIKit/UIKit.h>
1110
#import <React/RCTLog.h>
11+
#import <UIKit/UIKit.h>
1212

1313
#import <React/RCTDefines.h>
1414
#import <React/RCTInspectorPackagerConnection.h>
@@ -37,12 +37,14 @@
3737
if (inspectorProxyPortStr && [inspectorProxyPortStr length] > 0) {
3838
inspectorProxyPort = [NSNumber numberWithInt:[inspectorProxyPortStr intValue]];
3939
}
40-
NSString *escapedDeviceName = [[[UIDevice currentDevice] name] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet];
41-
NSString *escapedAppName = [[[NSBundle mainBundle] bundleIdentifier] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet];
40+
NSString *escapedDeviceName = [[[UIDevice currentDevice] name]
41+
stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet];
42+
NSString *escapedAppName = [[[NSBundle mainBundle] bundleIdentifier]
43+
stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet];
4244
return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/inspector/device?name=%@&app=%@",
43-
getServerHost(bundleURL, inspectorProxyPort),
44-
escapedDeviceName,
45-
escapedAppName]];
45+
getServerHost(bundleURL, inspectorProxyPort),
46+
escapedDeviceName,
47+
escapedAppName]];
4648
}
4749

4850
static NSURL *getAttachDeviceUrl(NSURL *bundleURL, NSString *title)
@@ -52,18 +54,20 @@
5254
if (metroBundlerPortStr && [metroBundlerPortStr length] > 0) {
5355
metroBundlerPort = [NSNumber numberWithInt:[metroBundlerPortStr intValue]];
5456
}
55-
NSString *escapedDeviceName = [[[UIDevice currentDevice] name] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLHostAllowedCharacterSet];
56-
NSString *escapedAppName = [[[NSBundle mainBundle] bundleIdentifier] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLHostAllowedCharacterSet];
57+
NSString *escapedDeviceName = [[[UIDevice currentDevice] name]
58+
stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLHostAllowedCharacterSet];
59+
NSString *escapedAppName = [[[NSBundle mainBundle] bundleIdentifier]
60+
stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLHostAllowedCharacterSet];
5761
return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/attach-debugger-nuclide?title=%@&device=%@&app=%@",
58-
getServerHost(bundleURL, metroBundlerPort),
59-
title,
60-
escapedDeviceName,
61-
escapedAppName]];
62+
getServerHost(bundleURL, metroBundlerPort),
63+
title,
64+
escapedDeviceName,
65+
escapedAppName]];
6266
}
6367

6468
@implementation RCTInspectorDevServerHelper
6569

66-
RCT_NOT_IMPLEMENTED(- (instancetype)init)
70+
RCT_NOT_IMPLEMENTED(-(instancetype)init)
6771

6872
static NSMutableDictionary<NSString *, RCTInspectorPackagerConnection *> *socketConnections = nil;
6973

@@ -74,39 +78,34 @@ static void sendEventToAllConnections(NSString *event)
7478
}
7579
}
7680

77-
static void displayErrorAlert(UIViewController *view, NSString *message) {
78-
UIAlertController *alert =
79-
[UIAlertController alertControllerWithTitle:nil
80-
message:message
81-
preferredStyle:UIAlertControllerStyleAlert];
81+
static void displayErrorAlert(UIViewController *view, NSString *message)
82+
{
83+
UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil
84+
message:message
85+
preferredStyle:UIAlertControllerStyleAlert];
8286
[view presentViewController:alert animated:YES completion:nil];
83-
dispatch_after(
84-
dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * 2.5),
85-
dispatch_get_main_queue(),
86-
^{
87-
[alert dismissViewControllerAnimated:YES completion:nil];
88-
});
87+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * 2.5), dispatch_get_main_queue(), ^{
88+
[alert dismissViewControllerAnimated:YES completion:nil];
89+
});
8990
}
9091

91-
+ (void)attachDebugger:(NSString *)owner
92-
withBundleURL:(NSURL *)bundleURL
93-
withView:(UIViewController *)view
92+
+ (void)attachDebugger:(NSString *)owner withBundleURL:(NSURL *)bundleURL withView:(UIViewController *)view
9493
{
9594
NSURL *url = getAttachDeviceUrl(bundleURL, owner);
9695

9796
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
9897
[request setHTTPMethod:@"GET"];
9998

10099
__weak UIViewController *viewCapture = view;
101-
[[[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:
102-
^(__unused NSData *_Nullable data,
103-
__unused NSURLResponse *_Nullable response,
104-
NSError *_Nullable error) {
105-
UIViewController *viewCaptureStrong = viewCapture;
106-
if (error != nullptr && viewCaptureStrong != nullptr) {
107-
displayErrorAlert(viewCaptureStrong, @"The request to attach Nuclide couldn't reach Metro Bundler!");
108-
}
109-
}] resume];
100+
[[[NSURLSession sharedSession]
101+
dataTaskWithRequest:request
102+
completionHandler:^(
103+
__unused NSData *_Nullable data, __unused NSURLResponse *_Nullable response, NSError *_Nullable error) {
104+
UIViewController *viewCaptureStrong = viewCapture;
105+
if (error != nullptr && viewCaptureStrong != nullptr) {
106+
displayErrorAlert(viewCaptureStrong, @"The request to attach Nuclide couldn't reach Metro!");
107+
}
108+
}] resume];
110109
}
111110

112111
+ (void)disableDebugger

‎scripts/launchPackager.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
:: LICENSE file in the root directory of this source tree.
55

66
@echo off
7-
title Metro Bundler
7+
title Metro
88
call .packager.bat
99
cd ../../../
1010
node "%~dp0..\cli.js" start

‎scripts/launchPackager.command

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# LICENSE file in the root directory of this source tree.
66

77
# Set terminal title
8-
echo -en "\\033]0;Metro Bundler\\a"
8+
echo -en "\\033]0;Metro\\a"
99
clear
1010

1111
THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)

‎scripts/react-native-xcode.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
set -x
1313
DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH
1414

15-
# Enables iOS devices to get the IP address of the machine running Metro Bundler
15+
# Enables iOS devices to get the IP address of the machine running Metro
1616
if [[ "$CONFIGURATION" = *Debug* && ! "$PLATFORM_NAME" == *simulator ]]; then
1717
IP=$(ipconfig getifaddr en0)
1818
if [ -z "$IP" ]; then

0 commit comments

Comments
 (0)