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

CLI: Pass --quiet to disable HMR logging in browser console #11087

Merged
merged 2 commits into from Jun 10, 2020
Merged

CLI: Pass --quiet to disable HMR logging in browser console #11087

merged 2 commits into from Jun 10, 2020

Conversation

niedzielski
Copy link
Contributor

@niedzielski niedzielski commented Jun 9, 2020

Issue: #8461

Pass the CLI --quiet option to the hot module replacement client
instead of hardcoding it in development builds. A minor improvement to
60961d3 (#9535).

#8461 (comment)

What I did

Pass --quiet to webpack-hot-middleware/client. Default to true.

How to test

Pass --quiet to start-storybook and HMR messages should disappear.

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

Pass the CLI `--quiet` option to the hot module replacement client
instead of hardcoding it in development builds. A minor improvement to
60961d3 (#9535).

#8461 (comment)
@niedzielski
Copy link
Contributor Author

I believe this is a false positive:

npm notice created a lockfile as package-lock.json. You should commit this file.


Failing the build, there is 1 fail.
Request failed [403]: https://api.github.com/repos/storybookjs/storybook/issues/11087/comments
Response: {
  "message": "Resource not accessible by integration",
  "documentation_url": "https://developer.github.com/v3/issues/comments/#create-a-comment"
}
Feedback: undefined

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me. I'm assuming errors still show up?

@shilman shilman requested a review from ndelangen June 9, 2020 23:38
@niedzielski
Copy link
Contributor Author

@shilman, I should have done more research. Sorry about that. What I'm seeing is that this will suppress all warnings too. I believe errors are always logged but there's some inconsistencies in the logging (e.g., see the warning checking in process-update).

There's a noInfo option I could use instead that will still present warnings. Would that be preferable?

@shilman
Copy link
Member

shilman commented Jun 10, 2020

Try it? As long as it’s opt in, we can do whatever you think is most useful

Revise --quiet to allow hot module replacement warnings to be logged.
webpack-hot-middleware's `quiet` parameter suppress warnings so `noInfo`
is used instead.
@niedzielski
Copy link
Contributor Author

Thanks, @shilman! I've passed the quiet option to noInfo instead in a new commit as both warnings and errors are useful to me. Feel free to revert if that's ultimately unwanted.

@shilman shilman changed the title Pass --quiet to HMR logging in browser console (#8461) CLI: Pass --quiet to disable HMR logging in browser console Jun 10, 2020
@shilman
Copy link
Member

shilman commented Jun 10, 2020

Looks good @niedzielski! I'll let @ndelangen take a look before merging

@ndelangen ndelangen merged commit 4b18fb6 into storybookjs:next Jun 10, 2020
@niedzielski niedzielski deleted the 8461-hmr-quiet branch June 10, 2020 13:24
@niedzielski
Copy link
Contributor Author

Yay! Thank you, @shilman and @ndelangen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants