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: correctly format logs when saving bundle #1300

Closed
wants to merge 2 commits into from

Conversation

szymonrybczak
Copy link
Contributor

Summary

When using community-cli-plugin, output when saving bundle looks like this:

❯ npx react-native bundle --platform android --entry-file index.js --dev=false --bundle-output dist/
                Welcome to Metro v0.80.9
              Fast - Scalable - Integrated

info Writing bundle output to:, dist/

There's a useless comma in log, because community-cli-plugin uses logger.info from @react-native-community/cli-tools which separates each item with , separator.

Test plan

Saving bundle output should contain correctly formatted log:

info Writing bundle output to: dist/

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 26, 2024
@szymonrybczak
Copy link
Contributor Author

cc @huntie

@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jun 26, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 83.80%. Comparing base (9b295e5) to head (6f86b48).

Files Patch % Lines
packages/metro/src/shared/output/bundle.flow.js 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1300   +/-   ##
=======================================
  Coverage   83.80%   83.80%           
=======================================
  Files         207      207           
  Lines       10883    10883           
  Branches     2733     2733           
=======================================
  Hits         9121     9121           
  Misses       1762     1762           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -49,7 +49,7 @@ async function saveBundleAndMap(
...
},
options: OutputOptions,
log: (...args: Array<string>) => void,
Copy link
Member

@huntie huntie Jun 27, 2024

Choose a reason for hiding this comment

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

@szymonrybczak Hmm, can we drop this change? Rest looks good!

The interface here is that we expect a logger that is similar to console.log()'s API, which accepts multiple args that will be concatenated without a ,.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I'm good with deleting this change. We just need to be careful when adding more logging to check if they're correctly formatted 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in 6f86b48

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

@huntie merged this pull request in 2f1801a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants