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

Allow to suppress warning when used with happypack #179

Closed
ertrzyiks opened this issue Feb 28, 2017 · 11 comments
Closed

Allow to suppress warning when used with happypack #179

ertrzyiks opened this issue Feb 28, 2017 · 11 comments

Comments

@ertrzyiks
Copy link
Contributor

There is a warning, which warns happypack user about lack of support for postcss-loader-before-processing event to prevent potential failure with no clear reason.

Once the problem is acknowledged / resolved on the user side, we may not need that warning in the build output anymore. How could we achieve that?

My ideas:

  • introduce an option to explicitly disable postcss-loader-before-processing event
  • introduce an option to ignore this particular warning

If you are happy about any of those solutions or know better one, I'm willing to help to make it happen.

@ai
Copy link
Contributor

ai commented Feb 28, 2017

@jantimon maybe we could remove whole warning? Or make it more smarter?

@jantimon
Copy link
Contributor

jantimon commented Mar 1, 2017

Why would a loader have no access to its current compilation?

What about firing the event from the compiler instead?

@ertrzyiks
Copy link
Contributor Author

@jantimon it is unavailable if you use happypack

@jantimon
Copy link
Contributor

jantimon commented Mar 1, 2017

@ertrzyiks why? it is the general purpose intermodule communication protocol and used by many plugins..
what would be the workaround?

@michael-ciniawsky
Copy link
Member

@ertrzyiks Is it possible to detect Happypack usage somehow ?

@ai
Copy link
Contributor

ai commented Mar 1, 2017

Maybe we should remove this warning? Event is very rare and I don’t think warning is very useful.

@ertrzyiks
Copy link
Contributor Author

I don't know details behind missing _compilation, I can only guess that it was difficult to parallelize it in a reliable way. Maybe @amireh could jump in and share some thoughts.

Having the guard condition enable people to use postcss-loader with happypack. On the other hand, the warning in the else block is just for information and can be removed.

@michael-ciniawsky
Copy link
Member

Done #180

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Mar 1, 2017

But if @amireh could give a insight nevertheless, would be appreciated 😛

@ai ai closed this as completed in #180 Mar 1, 2017
@ai
Copy link
Contributor

ai commented Mar 1, 2017

Released in 1.3.3

@amireh
Copy link

amireh commented Mar 2, 2017

The reason is because this._compilation and this._compiler can not be serialized for distributing to other processes since they're constructed and meant to be used in the main webpack process, which is a different "process" than the one that the loaders run in when using happypack.

In the docs for webpack 1 they dubbed it as "hacky access" to these constructs, simply because there was no better way (and I get it that the use cases are usually valid). It's just a limitation we need to live with until webpack (hopefully in v3) starts substituting their use with proper APIs.

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

No branches or pull requests

5 participants