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

CSS minification/aggregation breaks percent measures #21

Closed
blutorange opened this issue Oct 14, 2018 · 9 comments
Closed

CSS minification/aggregation breaks percent measures #21

blutorange opened this issue Oct 14, 2018 · 9 comments
Labels
question Further information is requested

Comments

@blutorange
Copy link
Owner

Issue by nicStuff
Wednesday Mar 29, 2017 at 12:05 GMT
Originally opened as samaxes#140


With version 1.7.6, and the following configuration

{ "bundles": [ { "type": "css", "name": "aaa.css", "files": [ "percent.css" ] } ] }

And the file percent.css being body { font-family:Arial, Helvetica, sans-serif; font-size:75.0%; color:#000; background:#cdcdcd; }

the resulting file "aaa.css" is body{font-family:Arial,Helvetica,sans-serif;font-size:75.0;color:#000;background:#cdcdcd}.

The percent sign has been lost in the process.

@blutorange blutorange added the question Further information is requested label Oct 14, 2018
@blutorange
Copy link
Owner Author

Comment by nicStuff
Wednesday Mar 29, 2017 at 13:31 GMT


A quick look on the source code doesn't reveal problems to me. Maybe this depends on YUI compressor yui/yuicompressor#132

@blutorange
Copy link
Owner Author

Comment by samaxes
Wednesday Mar 29, 2017 at 14:24 GMT


Yes, it's probably related to a YUI Compressor bug.
Switching to Closure Compiler should fix your issue, can you please try?

@blutorange
Copy link
Owner Author

Comment by nicStuff
Wednesday Mar 29, 2017 at 15:08 GMT


By setting <cssEngine>CLOSURE</cssEngine> (it's the CSS the one involved) the final file is empty: this doesn't surprise me since in https://github.com/samaxes/minify-maven-plugin/blob/master/src/main/java/com/samaxes/maven/minify/plugin/ProcessCSSFilesTask.java the YUI compressor engine is the only one taken into account.

Anyway, I compiled the plugin after having changed the artifact com.yahoo.platform.yui-yuicompressor to the version 2.4.7 and the output is right. Furthermore, YUI compressor 2.4.7 has always worked well for me, since I've been using https://github.com/davidB/yuicompressor-maven-plugin/ for years, which uses that version (but your plugin gives the flexibility needed for creating css/js groups).

So, is it reasonable to go back to 2.4.7? Are there any options available only in 2.4.8 that this plugin uses?

@blutorange
Copy link
Owner Author

Comment by nicStuff
Wednesday Mar 29, 2017 at 15:27 GMT


I've created pull request samaxes#141

@blutorange
Copy link
Owner Author

Comment by samaxes
Wednesday Mar 29, 2017 at 16:03 GMT


The problem is that I got asked to update to version 1.4.8 to support the latest JavaScript versions which YUI compressor 2.4.7 do not support.
I would prefer if you can ask the YUI compressor team to release a new version with mentioned bug fixed. Then we can update the plugin to use that version.

@blutorange
Copy link
Owner Author

Comment by nicStuff
Thursday Mar 30, 2017 at 11:19 GMT


It looks like the official YUI is no longer mantained by looking at the status of recent open issues (https://github.com/yui/yuicompressor/issues): the last one has been resolved on october 2016. Besides the issues, the last release is from 4 years ago, a lot of time.

Would it be viable to enable the closure engine for CSS and disable YUI? This way you could keep YUI 2.4.8 for javascript and the closure engine only for CSS.

@blutorange
Copy link
Owner Author

Comment by samaxes
Thursday Mar 30, 2017 at 11:25 GMT


I tried that in the past, but there's a lot of work involved: google/closure-stylesheets#101
Are you interested in helping?

@blutorange
Copy link
Owner Author

Comment by nicStuff
Thursday Mar 30, 2017 at 11:38 GMT


Sure interested, but I wouldn't be able to give it the adequate time and effort to obtain a robust result. I'm just delaying the use of this plugin for seeing if we find a simple and quick and good solution: if we don't, I will simply use the version I installed locally in which I use YUI 2.4.7.

The point is that I really like this plugin and would like that CSS compression gets really resolved somehow. We could wrap the YUI 2.4.7 (or the bleeding edge of YUI or the commit that resolves that issue) in a new CSS compression engine, then use that engine here; we could take another CSS compression engine available on the market, but I struggle a bit to find one (this means that if it exists it's something not that tested/used, so something unreliable).

What do you think?

@blutorange
Copy link
Owner Author

CSS is out-of-scope now.

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

No branches or pull requests

1 participant