Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove unused --verbose option from start command #1394

Conversation

liamjones
Copy link
Contributor

Summary:

While investigating #1391 I discovered that the start command had a --verbose option that didn't do anything. You do get extra logging with --verbose but this comes from the parent react-native command, where it is already documented.

I had a look through the metro functions being called to see if verbose was meant to be passed to one of them and had been missed but couldn't find anywhere it would be relevant. The only one I could see that it would potentially apply to is the loadMetroConfig call. While loadMetroConfig doesn't document a verbose parameter of its own, it calls loadConfig in the metro-config package which does take a verbose parameter. However, all that does is kill the reporter if verbose === false (see https://github.com/facebook/metro/blob/master/packages/metro-config/src/loadConfig.js#L256), which would mean you get no output from the start command whatsoever. Currently, the loadMetroConfig code is reliant on the fact that verbose is undefined when calling loadConfig so its custom reporter isn't overwritten.

Test Plan:

  • Ran react-native start --verbose before making this change and observed extra logging
  • Removed verbose option from the start command
  • Ran react-native start --verbose again and still observed extra logging

The start command had a `--verbose` option that didn't do anything. You _do_ get extra logging with `--verbose` but this comes from the parent react-native command, where it is already documented.
Copy link
Member

@thymikee thymikee left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup!

@grabbou
Copy link
Member

grabbou commented Jul 6, 2021

Nice catch, thanks!

@grabbou grabbou merged commit 4463ac6 into react-native-community:master Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants