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 formatWebpackMessages to return all formatted messages instead of just one error. #2834

Merged
merged 2 commits into from
Aug 9, 2017

Conversation

onigoetz
Copy link
Contributor

Hi,

I propose this change to formatWebpackMessages that currently removes all errors but one to the places in which it is used.

I propose this change because it's really surprising that when you call a function that is supposed to format messages that actually formats and removes messages.

I moved the removal of messages where they're displayed. That makes it clearer why you see only one single error and not all the errors that occured.

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@Timer
Copy link
Contributor

Timer commented Aug 2, 2017

Great, nice catch!

@Timer Timer added this to the 1.0.11 milestone Aug 2, 2017
@Timer
Copy link
Contributor

Timer commented Aug 2, 2017

Actually, I think we need to change this in webpackHotDevClient too, could you please do that?

@onigoetz
Copy link
Contributor Author

onigoetz commented Aug 2, 2017 via email

@onigoetz
Copy link
Contributor Author

onigoetz commented Aug 7, 2017

Okay, I looked into it, and webpackHotDevClient doesn't need any change :

The first usage of formatWebpackMessages (https://github.com/facebookincubator/create-react-app/blob/master/packages/react-dev-utils/webpackHotDevClient.js#L225) doesn't send any errors to be formatted, so it doesn't matter.

And while the second call (https://github.com/facebookincubator/create-react-app/blob/master/packages/react-dev-utils/webpackHotDevClient.js#L268) is for errors, it already only takes the first error (https://github.com/facebookincubator/create-react-app/blob/master/packages/react-dev-utils/webpackHotDevClient.js#L274)

And then it wants to log the rest of errors, that's probably where you want to keep all of them as well.

@Timer
Copy link
Contributor

Timer commented Aug 9, 2017

Fantastic, thanks!

@Timer Timer merged commit badfc2a into facebook:master Aug 9, 2017
@Timer
Copy link
Contributor

Timer commented Aug 9, 2017

Hi there! This change is out in react-scripts@1.0.11; please give it a go! Thanks.

JohnNilsson referenced this pull request in JohnNilsson/create-react-app-typescript Aug 9, 2017
* Move the reduction of the messages to a single place in the place it is used.

* Fix variable name
zangrafx added a commit to absolvent/create-react-app that referenced this pull request Aug 13, 2017
* commit 'bfaee410c502a95076a6bd89721c76ca08e15f7b': (39 commits)
  Publish
  Prepare for 1.0.11 release (facebook#2924)
  Update dev deps (facebook#2923)
  Update README.md
  Use env variable to disable source maps (facebook#2818)
  Make formatWebpackMessages return all messages (facebook#2834)
  Adjust the `checkIfOnline` check if in a corporate proxy environment (facebook#2884)
  Fix the order of arguments in spawned child proc (facebook#2913)
  Feature/webpack 3 4 (facebook#2875)
  Allow importing package.json (facebook#2468)
  Re-enable flowtype warning (facebook#2718)
  Format UglifyJs error (facebook#2650)
  Unstage yarn.lock pre-commit (facebook#2700)
  Update README.md
  Update README.md
  Add Electrode to alternatives (facebook#2728)
  Fix parsing HTML/JSX tags to real elements (facebook#2796)
  Update webpack version note (facebook#2798)
  Use modern syntax feature (facebook#2873)
  Allow use of scoped packages with a pinned version (facebook#2853)
  ...

# Conflicts:
#	packages/react-scripts/config/webpack.config.dev.js
#	packages/react-scripts/config/webpack.config.prod.js
#	packages/react-scripts/package.json
matart15 pushed a commit to matart15/create-react-app that referenced this pull request Aug 29, 2017
…react-app

* 'master' of https://github.com/facebookincubator/create-react-app: (36 commits)
  Publish
  Changelog for 1.0.12 (facebook#3016)
  Relax React dep requirements
  Default Favicon lossless optimisation (facebook#2917)
  update babel-runtime dependency in react-error-overlay and react-scripts (facebook#2991)
  Convert react-error-overlay to React (facebook#2515)
  Bump react-dev-utils
  Fix module function name in error overlay (facebook#3012)
  Docs: debugging in WebStorm (facebook#2986)
  Fix docs for `printFileSizesAfterBuild` (facebook#2942)
  Remove Modulus from user guide (facebook#2948)
  Remove superfluous lodash usage (facebook#2938)
  Update README.md (facebook#2927)
  Publish
  Prepare for 1.0.11 release (facebook#2924)
  Update dev deps (facebook#2923)
  Update README.md
  Use env variable to disable source maps (facebook#2818)
  Make formatWebpackMessages return all messages (facebook#2834)
  Adjust the `checkIfOnline` check if in a corporate proxy environment (facebook#2884)
  ...
JohnNilsson referenced this pull request in JohnNilsson/create-react-app-typescript Sep 9, 2017
* Move the reduction of the messages to a single place in the place it is used.

* Fix variable name
kasperpeulen pushed a commit to kasperpeulen/create-react-app that referenced this pull request Sep 24, 2017
* Move the reduction of the messages to a single place in the place it is used.

* Fix variable name
swengorschewski referenced this pull request in swengorschewski/cra-typescript-electron Oct 16, 2017
* Move the reduction of the messages to a single place in the place it is used.

* Fix variable name
@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants