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

Upstream parts of react-dev-utils #5409

Closed
edmorley opened this issue Oct 11, 2018 · 14 comments
Closed

Upstream parts of react-dev-utils #5409

edmorley opened this issue Oct 11, 2018 · 14 comments
Labels

Comments

@edmorley
Copy link

edmorley commented Oct 11, 2018

The react-dev-utils package currently includes a webpack message formatter that aims to clean up the console output, smoothing over some of its rough edges:
https://github.com/facebook/create-react-app/blob/master/packages/react-dev-utils/formatWebpackMessages.js
https://github.com/facebook/create-react-app/tree/master/test/fixtures/webpack-message-formatting

It would be great to upstream these fixes to webpack/the various loaders so the whole webpack community can benefit, whilst also reducing the maintenance burden for the CRA team - as mentioned in:
#5174 (comment)

CC @Timer :-)

@Timer
Copy link
Contributor

Timer commented Oct 11, 2018

I don't think it's likely, but we can try. We're very opinionated on how we strip down the errors.

Maybe if webpack added a pretty toggle...

IIRC, we were mostly talking about the ModuleNotFoundPlugin (packages/react-dev-utils/ModuleNotFoundPlugin.js).

@edmorley
Copy link
Author

I don't think it's likely, but we can try. We're very opinionated on how we strip down the errors.

Glancing at the formatter it seems a good start would be for webpack to add a stats option that controlled whether the "Module: ..." boilerplate was added or not, and perhaps even allow loaders to declare that their output should not be wrapped (which would allow eg eslint-loader to disable it, given the filepath etc is repeated within its own message).

IIRC, we were mostly talking about the ModuleNotFoundPlugin

Ah, yes. I'm happy to morph this issue into a general "upstream parts of react-dev-utils" issue - reading through the various files in there, many are really bug fixes that belong upstream (or in some cases might have been fixed already -- WatchMissingNodeModulesPlugin sounds related to the issue fixed in webpack/watchpack#69 for example).

It just would be a real shame for {CRA, Neutrino, vue-cli, ...} to all have to implement their own custom fixes for issues that could be upstreamed and benefit the community as a whole :-)

@edmorley edmorley changed the title Upstream parts of react-dev-utils/formatWebpackMessages.js Upstream parts of react-dev-utils Oct 11, 2018
@stale
Copy link

stale bot commented Nov 10, 2018

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Nov 10, 2018
@edmorley
Copy link
Author

(not stale)

@stale stale bot removed the stale label Nov 12, 2018
@stale
Copy link

stale bot commented Dec 12, 2018

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Dec 12, 2018
@edmorley
Copy link
Author

(not stale)

@stale stale bot removed the stale label Dec 12, 2018
@stale
Copy link

stale bot commented Jan 12, 2019

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Jan 12, 2019
@edmorley
Copy link
Author

(not stale)

@stale stale bot removed the stale label Jan 14, 2019
@stale
Copy link

stale bot commented Feb 13, 2019

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Feb 13, 2019
@Timer
Copy link
Contributor

Timer commented Feb 14, 2019

We're going to be shipping a package that does this soon. I'll close this issue b/c it's become noise at this point.

Will ping you, @edmorley!

@Timer Timer closed this as completed Feb 14, 2019
@edmorley
Copy link
Author

Awesome - thank you :-)

@edmorley
Copy link
Author

By shipping a package, do you mean "try where possible to fix things upstream (or at least file issues against them), and only then ship a package"? ;-)

@Timer
Copy link
Contributor

Timer commented Feb 14, 2019

Will start with a webpack plugin that completely massages the messages (likely) then upstream from there.

@Timer
Copy link
Contributor

Timer commented Feb 14, 2019

Remember, a lot of what we format is super opinionated and not a good fit for all projects. We'll play it by ear!

@lock lock bot locked and limited conversation to collaborators Feb 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants