Skip to content

Commit dc68457

Browse files
huntiefacebook-github-bot
authored andcommitted
Remove run Metro hook from Xcode build, remove launchPackager scripts (#38242)
Summary: Pull Request resolved: #38242 See proposal: react-native-community/discussions-and-proposals#681 **Removed script files** I searched GitHub (and specifically `react-native-windows/macos`) to confirm these files are not referenced: - `scripts/launchPackager.bat` - `scripts/launchPackager.command` - `scripts/.packager.env` Interestingly, React Native CLI refers to a `.packager.env` at a different location (`node_modules/.bin/`), and includes modified copies of `launchPackager.command/bat`. This PR removes duplication with these. Changelog: [iOS][Breaking] Metro will no longer be started when running builds via Xcode Reviewed By: cortinico Differential Revision: D47297469 fbshipit-source-id: 06c3602d58b21ed693c3daa763d99947a70bfc5a
1 parent 20dba39 commit dc68457

File tree

6 files changed

+0
-85
lines changed

6 files changed

+0
-85
lines changed

packages/react-native/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@
6262
"scripts/hermes/prepare-hermes-for-build.js",
6363
"scripts/ios-configure-glog.sh",
6464
"scripts/xcode/with-environment.sh",
65-
"scripts/launchPackager.bat",
66-
"scripts/launchPackager.command",
6765
"scripts/native_modules.rb",
6866
"scripts/node-binary.sh",
6967
"scripts/packager.sh",

packages/react-native/scripts/.packager.env

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/react-native/scripts/launchPackager.bat

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/react-native/scripts/launchPackager.command

Lines changed: 0 additions & 34 deletions
This file was deleted.

packages/react-native/template/ios/HelloWorld.xcodeproj/project.pbxproj

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@
177177
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "HelloWorld" */;
178178
buildPhases = (
179179
C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */,
180-
FD10A7F022414F080027D42C /* Start Packager */,
181180
13B07F871A680F5B00A75B9A /* Sources */,
182181
13B07F8C1A680F5B00A75B9A /* Frameworks */,
183182
13B07F8E1A680F5B00A75B9A /* Resources */,
@@ -378,25 +377,6 @@
378377
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests-resources.sh\"\n";
379378
showEnvVarsInLog = 0;
380379
};
381-
FD10A7F022414F080027D42C /* Start Packager */ = {
382-
isa = PBXShellScriptBuildPhase;
383-
buildActionMask = 2147483647;
384-
files = (
385-
);
386-
inputFileListPaths = (
387-
);
388-
inputPaths = (
389-
);
390-
name = "Start Packager";
391-
outputFileListPaths = (
392-
);
393-
outputPaths = (
394-
);
395-
runOnlyForDeploymentPostprocessing = 0;
396-
shellPath = /bin/sh;
397-
shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
398-
showEnvVarsInLog = 0;
399-
};
400380
/* End PBXShellScriptBuildPhase section */
401381

402382
/* Begin PBXSourcesBuildPhase section */

packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,6 @@
409409
13B07F8C1A680F5B00A75B9A /* Frameworks */,
410410
13B07F8E1A680F5B00A75B9A /* Resources */,
411411
68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */,
412-
5CF0FD27207FC6EC00C13D65 /* Start Metro */,
413412
79E8BE2B119D4C5CCD2F04B3 /* [RN] Copy Hermes Framework */,
414413
4E5A5A192F46F13B14A915AF /* [CP] Embed Pods Frameworks */,
415414
4E2AB2EE08A8E6F86E659152 /* [CP] Copy Pods Resources */,
@@ -627,21 +626,6 @@
627626
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks.sh\"\n";
628627
showEnvVarsInLog = 0;
629628
};
630-
5CF0FD27207FC6EC00C13D65 /* Start Metro */ = {
631-
isa = PBXShellScriptBuildPhase;
632-
buildActionMask = 2147483647;
633-
files = (
634-
);
635-
inputPaths = (
636-
);
637-
name = "Start Metro";
638-
outputPaths = (
639-
);
640-
runOnlyForDeploymentPostprocessing = 0;
641-
shellPath = /bin/sh;
642-
shellScript = "set -x\n\n# RN-Tester does not have an iOS directory. The PROJECT_ROOT should \n# point to the folder where the `metro.config.js` file lives.\nexport PROJECT_ROOT=$(pwd)\nexport RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open -n \"$SRCROOT/../react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
643-
showEnvVarsInLog = 0;
644-
};
645629
68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */ = {
646630
isa = PBXShellScriptBuildPhase;
647631
buildActionMask = 2147483647;

0 commit comments

Comments
 (0)