-
-
Notifications
You must be signed in to change notification settings - Fork 609
chore(package): use cssnano 4 and PostCSS 6 #739
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
Conversation
@@ -192,11 +192,11 @@ module.exports = function processCss(inputSource, inputMap, options, callback) { | |||
if(minimize) { | |||
var cssnano = require("cssnano"); | |||
var minimizeOptions = assign({}, query.minimize); | |||
["zindex", "normalizeUrl", "discardUnused", "mergeIdents", "reduceIdents", "autoprefixer"].forEach(function(name) { | |||
["cssDeclarationSorter", "normalizeUrl"].forEach(function(name) { |
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.
cssDeclarationSorter should be safe
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.
We can enable it back when cssnano/cssnano#535 was fixed. Anyway, it is safer to start from CSSNano 3 optimization and after some tests, enable more optimizations.
@ai |
@evilebottnawi I just need to update Browserslist for webpack users. What can we do to update it? |
Should we also remove Node.js 4 support in It will require the major release. But anyway everyone dropped Node.js 4 support right now. |
@ai It is a lot of work 😞
But we can do this with 1-2 majors release. We already try to upgrade any related to postcss and it is break loader due postcss modules plugins (they are very buggy). |
Unfortunately no |
Yeap, let’s update cssnano and PostCSS in next major release. And then let’s do all your tasks in next major releases.
How I can repeat these issues. Browserslist update is very critical for me. I will fix postcss modules |
Or we can return Node.js 4 support to cssnano 4. What do you think about it? I sent PR for dropping Node.js 4 just because I already did it (before your comment). I am still OK with not dropping Node.js 4 (but, to be honest, I think it is better to do it, anyway everyone dropped it) #740 |
@evilebottnawi great tasks. Why do we need to do them only in the single major release? What do you think about fixing few things fast and release them? |
|
@ai because one thing broke other thing, we already try do it |
Can you give me a list of thing, which will be broken by PostCSS and cssnano update? I really need Browserslist update. Babel 7 will promote it, but I understand that you have a big plan and don’t want to release small steps instead of fixing them all. But could you please consider again (maybe after few hours)? Node.js 4 support dropping of will not break anything. All css modules incompatibility with PostCSS 6 can be fixed soon. What other problems we could have? |
@ai it is not my solution what Fast way is drop css modules (add docs how they can be using through postcss-loader or other loader/tool), update deps and do major release. |
@evilebottnawi OK, what you will do on my place if you need to update Browserslist ASAP? Maybe we should continue talking in webpack Slack if other webpack developers are related? |
@ai you can talk about this here https://webpack.slack.com/messages/C1LUX2DS9/, but looks more unavailable or css outside their competence, i try to solve this problem about 6 months ago. I do not think that we can solve this ASAP, sorry /cc @sokra |
Did I understand correctly, that problem is with incompatibility between CSS Module plugins in PostCSS 6? How can I get the list of errors? |
@ai between postcss and other postcss css modules plugins, try to update deps and run tests |
@evilebottnawi I did run tests and everything was fine (maybe I forgot to update something?) |
@ai why just remove |
I like this plan =^_^= |
@ai send PR with remove this option and we can release major release without pain |
Done #741 |
Close for #742 |
What kind of change does this PR introduce?
Dependencies update
Did you add tests for your changes?
It is better to keep old tests for dependencies update
If relevant, did you update the README?
Not relevant
Summary
CSSnano 3 uses very old Autoprefixer with old Browerslist. At result, it block any new Browserslist queries (like
not dead
) from being wildly usage (since old Browserslist will throw “unknown query” error). This is why updating CSSNano is critical for the ecosystem, since Browerslist is used in Autoprefixer and Babel 7.Does this PR introduce a breaking change?
All options should work. But in another hand, CSSNano 4 has a lot of changes inside.
Other information
I disabled
cssDeclarationSorter
, because I found a bug there. Also, this feature was not part of the previouscss-loader
. I removed all other disabled plugins (likezindex
) because they are already disabled indefault
preset./cc @michael-ciniawsky @evilebottnawi