-
Notifications
You must be signed in to change notification settings - Fork 637
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
Conversation
cc @huntie |
Codecov ReportAttention: Patch coverage is
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. |
@@ -49,7 +49,7 @@ async function saveBundleAndMap( | |||
... | |||
}, | |||
options: OutputOptions, | |||
log: (...args: Array<string>) => void, |
There was a problem hiding this comment.
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 ,
.
- Happy with the other changes, which make this behaviour the most predictable wherever Metro is integrated.
- I'd prefer an upstream alignment in
@react-native-community/cli-tools
to(...message: Array<string>) => void
. Our current types indev-middleware
assume this: https://github.com/facebook/react-native/blob/c0b5e2e031f0e471b57640be13fe086d36c48a99/packages/dev-middleware/src/types/Logger.js#L12-L15.
There was a problem hiding this comment.
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 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in 6f86b48
@huntie has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary
When using
community-cli-plugin
, output when saving bundle looks like this:There's a useless comma in log, because
community-cli-plugin
useslogger.info
from@react-native-community/cli-tools
which separates each item with,
separator.Test plan
Saving bundle output should contain correctly formatted log: