-
Notifications
You must be signed in to change notification settings - Fork 23
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
[INTERNAL] Use clean-css for compression instead of less.js with compress #360
base: v2
Are you sure you want to change the base?
Conversation
Could you add some context for those who where not involved in the discussion? (like me 🥺) Questions: Is file size reduction the only motivation for this change? What is the reason for for having two parameters, |
You're right, let's discuss this again with all. This is also more trying out this solution. It was taken into account because:
|
As discussed, closing this PR. |
As it turnes out, the less compression feature has serious bugs. See SAP/less-openui5#112 Switching to clean-css might resolve those with little performance penalty. |
Rebased onto current master and resolved conflicts. There are still failing tests (different CSS output than expected) however, an expert should check for the correctness of the new output. |
"/* Inline theming parameters */" comment is hard coded in less-openui5, but should not be present when compressed.
Add test to ensure css statements are valid with regards to "calc"-function being called with "0px". Compression should not transform "0px" to "0" within calc statement.
Increases coverage
Add color optimization example to compressiontheme test.
compress parameter should not be used but rather a combination of cssOptimizer on CSS resources and compressJSON parameter should be used instead.
@@ -30,9 +30,12 @@ class ThemeBuilder { | |||
* @param {module:@ui5/fs.Resource[]} resources Library files | |||
* @param {Object} [options] Build options | |||
* @param {boolean} [options.compress=false] Compress build output (CSS / JSON) | |||
* DEPRECATED: Use [cssOptimizer]{@link module:@ui5/builder.processors.cssOptimizer} to compress CSS output. |
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.
A warning log in the code would also be reasonable. Similar to https://github.com/SAP/ui5-fs/blob/master/lib/resourceFactory.js#L72
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.
done with 75c54b9
Introduce separate CSS optimization processor such that it can be used standalone, e.g. when serving files in ui5 server and to have a better css compression
Fixes shortcomings of less.js css compression. Compiler option
compress
was deprecated and produced invalid css when usingcalc
with0px
.