Skip to content

fix: Replace calling internal React Native scripts for launching Metro with CLI's script#1812

Merged
thymikee merged 11 commits into
react-native-community:mainfrom
szymonrybczak:fix/change-way-calling-metro
Mar 23, 2023
Merged

fix: Replace calling internal React Native scripts for launching Metro with CLI's script#1812
thymikee merged 11 commits into
react-native-community:mainfrom
szymonrybczak:fix/change-way-calling-metro

Conversation

@szymonrybczak

@szymonrybczak szymonrybczak commented Jan 31, 2023

Copy link
Copy Markdown
Collaborator

Summary:

Closes #1799

Replace calling internal React Native scripts for launching Metro with CLI's script.

Also this PR, changes the logic and right now it isn't starting packager from relative path, but it launches packager from config.root.
CleanShot 2023-02-06 at 10 44 13@2x

Test Plan:

  1. yarn react-native run-android - should run correctly metro

@MateWW MateWW left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for opening this PR! 🚀🥳
It's something I cannot wait for!

Comment thread packages/cli-platform-android/src/commands/buildAndroid/index.ts Outdated
Comment thread packages/cli-platform-android/src/commands/buildAndroid/startServerInNewWindow.ts Outdated
Comment thread packages/cli-platform-android/src/commands/buildAndroid/startServerInNewWindow.ts Outdated
Comment thread packages/cli-plugin-metro/launchPackager.bat
@szymonrybczak szymonrybczak force-pushed the fix/change-way-calling-metro branch from e364ad1 to d6d00ee Compare February 1, 2023 08:41
@MateWW

MateWW commented Feb 13, 2023

Copy link
Copy Markdown
Contributor

Can we verify if moving process.env does not break anything inside react-native?
Are there any parts in react-native that are depending on it?

@szymonrybczak szymonrybczak marked this pull request as ready for review March 1, 2023 10:36
Comment thread packages/cli-platform-android/src/commands/buildAndroid/startServerInNewWindow.ts Outdated
Comment thread packages/cli-plugin-metro/launchPackager.sh Outdated
@szymonrybczak

Copy link
Copy Markdown
Collaborator Author

Hey @tido64, I updated my code. Could you please take a look at it again? 🙏

@tido64 tido64 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks for fixing this, @szymonrybczak ❤️

Comment thread packages/cli-plugin-metro/launchPackager.command Outdated
Comment thread .gitignore Outdated
Comment thread packages/cli-platform-android/src/commands/buildAndroid/startServerInNewWindow.ts Outdated
@szymonrybczak szymonrybczak force-pushed the fix/change-way-calling-metro branch from 8b93fc8 to d35714c Compare March 8, 2023 08:39

@kelset kelset left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Comment thread packages/cli-plugin-metro/launchPackager.sh
Comment thread packages/cli-platform-android/src/commands/buildAndroid/startServerInNewWindow.ts Outdated
@thymikee

Copy link
Copy Markdown
Member

Looks good. This creates a discrepancy between running packager from CLI vs Xcode. Let's make sure we followup with changes to .xcode.env in the future to make it work ubiquitously

@szymonrybczak szymonrybczak force-pushed the fix/change-way-calling-metro branch from ca41ad7 to a3f8681 Compare March 22, 2023 07:55
@thymikee thymikee changed the title fix: change way calling metro fix: Replace calling internal React Native scripts for launching Metro with CLI's script Mar 23, 2023
@thymikee thymikee merged commit 07c526f into react-native-community:main Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is running packager by calling react-native internal script still necessary for run-android?

5 participants