react-native icon indicating copy to clipboard operation
react-native copied to clipboard

chore(dev-middleware): add `localhost` as default host in `start` command config

Open szymonrybczak opened this issue 3 months ago • 1 comments

Summary:

Inside Re.Pack we consume command's options, to reduce the amount of assumptions that 3rd party tools need to make - we can move assigning default value to config command level, so default values will be aligned across tools.

For default start command this change doesn't change any behaviour.

Changelog:

[INTERNAL] [CHANGED] - Add localhost as default host in start command config

Test Plan:

start command should work the same way as before.

szymonrybczak avatar Apr 24 '24 20:04 szymonrybczak

cc @huntie

szymonrybczak avatar Apr 24 '24 20:04 szymonrybczak

@blakef has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Apr 25 '24 09:04 facebook-github-bot

@blakef merged this pull request in facebook/react-native@c402dcfe5738174d28ac6d00bc82dad99949e376.

facebook-github-bot avatar Apr 25 '24 10:04 facebook-github-bot

This pull request was successfully merged by @szymonrybczak in c402dcfe5738174d28ac6d00bc82dad99949e376.

When will my fix make it into a release? | How to file a pick request?

github-actions[bot] avatar Apr 25 '24 10:04 github-actions[bot]

Hey @szymonrybczak, there's one more line where args.host is referenced: https://github.com/facebook/react-native/blob/ed815fcd9da7c4d3d73d52960118bf37adba321e/packages/community-cli-plugin/src/commands/start/runServer.js#L145

Before your change, an empty string was passed there by default, but now it receives localhost. At least for me, this breaks the default behavior when running on an Android emulator, and it cannot connect to the dev server. We also tried on RN 0.74, and running dev server with --host localhost behaves differently than the default - android emulator cannot connect to the dev server then, though it works on a physical device.

j-piasecki avatar Apr 26 '24 09:04 j-piasecki