Skip to content

Commit 6d6c68c

Browse files
cpojerfacebook-github-bot
authored andcommitted
"The Metro Server" -> Metro
Summary: Pet Peeve: Metro is a brand name. You don't say "the Metro server" just like you don't say "the iPhone phone". This is a leftover from when it used to be called "the packager server". Note: It makes sense to refer to "the Metro server" when talking about it in the context of Metro's features, like if you are discussing "Metro's bundling" and "Metro's server". However, when talking about the tool itself, just Metro is enough. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D22330966 fbshipit-source-id: 667618363c641884df543d88cac65d1e44956ad3
1 parent c4de0c7 commit 6d6c68c

File tree

11 files changed

+27
-27
lines changed

11 files changed

+27
-27
lines changed

.circleci/Dockerfiles/scripts/run-ci-e2e-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ function e2e_suite() {
199199
return 1
200200
fi
201201

202-
echo "Starting packager server"
202+
echo "Starting Metro"
203203
npm start >> /dev/null &
204204
SERVER_PID=$!
205205
sleep 15

Libraries/Utilities/HMRClient.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,14 @@ const HMRClient: HMRClientNativeInterface = {
172172
);
173173

174174
client.on('connection-error', e => {
175-
let error = `Cannot connect to the Metro server.
175+
let error = `Cannot connect to Metro.
176176
177177
Try the following to fix the issue:
178-
- Ensure that the Metro server is running and available on the same network`;
178+
- Ensure that Metro is running and available on the same network`;
179179

180180
if (Platform.OS === 'ios') {
181181
error += `
182-
- Ensure that the Metro server URL is correctly set in AppDelegate`;
182+
- Ensure that the Metro URL is correctly set in AppDelegate`;
183183
} else {
184184
error += `
185185
- Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run 'adb devices' to see a list of connected devices
@@ -222,12 +222,12 @@ Error: ${e.message}`;
222222
if (data.type === 'GraphNotFoundError') {
223223
client.close();
224224
setHMRUnavailableReason(
225-
'The Metro server has restarted since the last edit. Reload to reconnect.',
225+
'Metro has restarted since the last edit. Reload to reconnect.',
226226
);
227227
} else if (data.type === 'RevisionNotFoundError') {
228228
client.close();
229229
setHMRUnavailableReason(
230-
'The Metro server and the client are out of sync. Reload to reconnect.',
230+
'Metro and the client are out of sync. Reload to reconnect.',
231231
);
232232
} else {
233233
currentCompileErrorMessage = `${data.type} ${data.message}`;
@@ -239,7 +239,7 @@ Error: ${e.message}`;
239239

240240
client.on('close', data => {
241241
LoadingView.hide();
242-
setHMRUnavailableReason('Disconnected from the Metro server.');
242+
setHMRUnavailableReason('Disconnected from Metro.');
243243
});
244244

245245
if (isEnabled) {

React/CoreModules/RCTWebSocketExecutor.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ - (void)setUp
9898
[self invalidate];
9999
NSString *error =
100100
@"Runtime is not ready for debugging.\n "
101-
"- Make sure Packager server is running.\n"
101+
"- Make sure Metro is running.\n"
102102
"- Make sure the JavaScript Debugger is running and not paused on a "
103103
"breakpoint or exception and try reloading again.";
104104
_setupError = RCTErrorWithMessage(error);
@@ -165,7 +165,7 @@ - (void)sendMessage:(NSDictionary<NSString *, id> *)message onReply:(RCTWSMessag
165165

166166
dispatch_async(_jsQueue, ^{
167167
if (!self.valid) {
168-
callback(RCTErrorWithMessage(@"Runtime is not ready for debugging. Make sure Packager server is running."), nil);
168+
callback(RCTErrorWithMessage(@"Runtime is not ready for debugging. Make sure Metro is running."), nil);
169169
return;
170170
}
171171

ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public interface ReactInstanceEventListener {
152152
private final JavaScriptExecutorFactory mJavaScriptExecutorFactory;
153153

154154
private final @Nullable JSBundleLoader mBundleLoader;
155-
private final @Nullable String mJSMainModulePath; /* path to JS bundle root on packager server */
155+
private final @Nullable String mJSMainModulePath; /* path to JS bundle root on Metro */
156156
private final List<ReactPackage> mPackages;
157157
private final DevSupportManager mDevSupportManager;
158158
private final boolean mUseDeveloperSupport;

ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ public ReactInstanceManagerBuilder setJSBundleLoader(JSBundleLoader jsBundleLoad
118118
}
119119

120120
/**
121-
* Path to your app's main module on the packager server. This is used when reloading JS during
122-
* development. All paths are relative to the root folder the packager is serving files from.
123-
* Examples: {@code "index.android"} or {@code "subdirectory/index.android"}
121+
* Path to your app's main module on Metro. This is used when reloading JS during development. All
122+
* paths are relative to the root folder the packager is serving files from. Examples: {@code
123+
* "index.android"} or {@code "subdirectory/index.android"}
124124
*/
125125
public ReactInstanceManagerBuilder setJSMainModulePath(String jsMainModulePath) {
126126
mJSMainModulePath = jsMainModulePath;

ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ protected UIImplementationProvider getUIImplementationProvider() {
118118
}
119119

120120
/**
121-
* Returns the name of the main module. Determines the URL used to fetch the JS bundle from the
122-
* packager server. It is only used when dev support is enabled. This is the first file to be
123-
* executed once the {@link ReactInstanceManager} is created. e.g. "index.android"
121+
* Returns the name of the main module. Determines the URL used to fetch the JS bundle from Metro.
122+
* It is only used when dev support is enabled. This is the first file to be executed once the
123+
* {@link ReactInstanceManager} is created. e.g. "index.android"
124124
*/
125125
protected String getJSMainModuleName() {
126126
return "index.android";
@@ -138,7 +138,7 @@ protected String getJSMainModuleName() {
138138
/**
139139
* Returns the name of the bundle in assets. If this is null, and no file path is specified for
140140
* the bundle, the app will only work with {@code getUseDeveloperSupport} enabled and will always
141-
* try to load the JS bundle from the packager server. e.g. "index.android.bundle"
141+
* try to load the JS bundle from Metro. e.g. "index.android.bundle"
142142
*/
143143
protected @Nullable String getBundleAssetName() {
144144
return "index.android.bundle";

ReactAndroid/src/main/java/com/facebook/react/common/DebugServerException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
public class DebugServerException extends RuntimeException {
2222
private static final String GENERIC_ERROR_MESSAGE =
2323
"\n\nTry the following to fix the issue:\n"
24-
+ "\u2022 Ensure that the packager server is running\n"
24+
+ "\u2022 Ensure that Metro is running\n"
2525
+ "\u2022 Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run 'adb devices' to see a list of connected devices\n"
2626
+ "\u2022 Ensure Airplane Mode is disabled\n"
2727
+ "\u2022 If you're on a physical device connected to the same machine, run 'adb reverse tcp:<PORT> tcp:<PORT>' to forward requests from your device\n"

ReactAndroid/src/main/java/com/facebook/react/devsupport/HMRClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
/**
1313
* JS module interface for HMRClient
1414
*
15-
* <p>The HMR(Hot Module Replacement)Client allows for the application to receive updates from the
16-
* packager server (over a web socket), allowing for injection of JavaScript to the running
17-
* application (without a refresh).
15+
* <p>The HMR(Hot Module Replacement)Client allows for the application to receive updates from Metro
16+
* (over a web socket), allowing for injection of JavaScript to the running application (without a
17+
* refresh).
1818
*/
1919
public interface HMRClient extends JavaScriptModule {
2020

2121
/**
22-
* Enable the HMRClient so that the client will receive updates from the packager server.
22+
* Enable the HMRClient so that the client will receive updates from Metro.
2323
*
2424
* @param platform The platform in which HMR updates will be enabled. Should be "android".
2525
* @param bundleEntry The path to the bundle entry file (e.g. index.ios.bundle).

ReactAndroid/src/main/jni/react/jni/JSLoader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ loadScriptFromAssets(AAssetManager *manager, const std::string &assetName) {
6666

6767
throw std::runtime_error(folly::to<std::string>(
6868
"Unable to load script. Make sure you're "
69-
"either running a Metro server (run 'react-native start') or that your bundle '",
69+
"either running Metro (run 'react-native start') or that your bundle '",
7070
assetName,
7171
"' is packaged correctly for release."));
7272
}

scripts/android-e2e-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ describe('Android Test App', function() {
8484
};
8585

8686
// React Native in dev mode often starts with Red Box "Can't fibd variable __fbBatchedBridge..."
87-
// This is fixed by clicking Reload JS which will trigger a request to packager server
87+
// This is fixed by clicking Reload JS which will trigger a request to Metro
8888
return driver
8989
.init(desired)
9090
.setImplicitWaitTimeout(5000)

0 commit comments

Comments
 (0)