Skip to content

Commit

Permalink
Upgrade CLI and Metro, update status check refs
Browse files Browse the repository at this point in the history
Summary:
Update `cli-commands` package to reflect latest source `react-native-community/cli-plugin-metro` changes.

- react-native-community/cli#2043
- react-native-community/cli#2021
- react-native-community/cli#2024

Changelog: [Internal]

Differential Revision: D48311214

fbshipit-source-id: 986264a7cc23f3e6adee05781946d57d0c579081
  • Loading branch information
huntie authored and facebook-github-bot committed Aug 14, 2023
1 parent e44fdfe commit 9922266
Show file tree
Hide file tree
Showing 7 changed files with 197 additions and 313 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
"jest": "^29.2.1",
"jest-junit": "^10.0.0",
"jscodeshift": "^0.14.0",
"metro-babel-register": "0.77.0",
"metro-memory-fs": "0.77.0",
"metro-babel-register": "0.78.0",
"metro-memory-fs": "0.78.0",
"micromatch": "^4.0.4",
"mkdirp": "^0.5.1",
"mock-fs": "^5.1.4",
Expand Down
14 changes: 8 additions & 6 deletions packages/community-cli-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,19 @@
"launchPackager.command"
],
"dependencies": {
"@react-native-community/cli-server-api": "12.0.0-alpha.7",
"@react-native-community/cli-tools": "12.0.0-alpha.7",
"@react-native-community/cli-server-api": "12.0.0-alpha.9",
"@react-native-community/cli-tools": "12.0.0-alpha.9",
"@react-native/metro-babel-transformer": "^0.73.11",
"chalk": "^4.0.0",
"execa": "^5.1.1",
"metro": "0.77.0",
"metro-config": "0.77.0",
"metro-core": "0.77.0",
"metro-resolver": "0.77.0",
"metro": "0.78.0",
"metro-config": "0.78.0",
"metro-core": "0.78.0",
"readline": "^1.3.0"
},
"devDependencies": {
"metro-resolver": "0.78.0"
},
"engines": {
"node": ">=18"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/metro-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dependencies": {
"@react-native/metro-babel-transformer": "^0.73.11",
"@react-native/js-polyfills": "^0.73.0",
"metro-config": "0.77.0",
"metro-runtime": "0.77.0"
"metro-config": "0.78.0",
"metro-runtime": "0.78.0"
}
}
2 changes: 1 addition & 1 deletion packages/react-native/React/Base/RCTBundleURLProvider.mm
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ + (BOOL)isPackagerRunning:(NSString *)hostPort scheme:(NSString *)scheme
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);

NSString *status = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
return [status isEqualToString:@"packager-status:running"];
return [status containsString:@"status: \"running\""];
}

- (NSString *)guessPackagerHost
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/** Use this class to check if the JavaScript packager is running on the provided host. */
public class PackagerStatusCheck {

private static final String PACKAGER_OK_STATUS = "packager-status:running";
private static final String PACKAGER_OK_STATUS = "status: \"running\"";
private static final int HTTP_CONNECT_TIMEOUT_MS = 5000;
private static final String PACKAGER_STATUS_URL_TEMPLATE = "http://%s/status";

Expand Down Expand Up @@ -81,7 +81,7 @@ public void onResponse(Call call, Response response) throws IOException {
String bodyString =
body.string(); // cannot call body.string() twice, stored it into variable.
// https://github.com/square/okhttp/issues/1240#issuecomment-68142603
if (!PACKAGER_OK_STATUS.equals(bodyString)) {
if (!bodyString.contains(PACKAGER_OK_STATUS)) {
FLog.e(
ReactConstants.TAG,
"Got unexpected response from packager when requesting status: "
Expand Down
10 changes: 5 additions & 5 deletions packages/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@
},
"dependencies": {
"@jest/create-cache-key-function": "^29.2.1",
"@react-native-community/cli": "12.0.0-alpha.7",
"@react-native-community/cli-platform-android": "12.0.0-alpha.7",
"@react-native-community/cli-platform-ios": "12.0.0-alpha.7",
"@react-native-community/cli": "12.0.0-alpha.9",
"@react-native-community/cli-platform-android": "12.0.0-alpha.9",
"@react-native-community/cli-platform-ios": "12.0.0-alpha.9",
"@react-native/assets-registry": "^0.73.0",
"@react-native/codegen": "^0.73.0",
"@react-native/gradle-plugin": "^0.73.0",
Expand All @@ -112,8 +112,8 @@
"jest-environment-node": "^29.2.1",
"jsc-android": "^250231.0.0",
"memoize-one": "^5.0.0",
"metro-runtime": "0.76.7",
"metro-source-map": "0.76.7",
"metro-runtime": "0.78.0",
"metro-source-map": "0.78.0",
"mkdirp": "^0.5.1",
"nullthrows": "^1.1.1",
"pretty-format": "^26.5.2",
Expand Down
Loading

0 comments on commit 9922266

Please sign in to comment.