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

'Support both csso v1 and v2' - Improved code in handling csso optimization function (justDoIt vs. minify) #226

Merged
merged 1 commit into from
Feb 19, 2017

Conversation

alundiak
Copy link
Collaborator

@alundiak alundiak commented Feb 19, 2017

csso releases review:

  • since 1.4.0 we have minify() and earlier (eg. 1.3.12) it was ONLY justDoIt()
  • in csso 1.8.0 csso.minify() and csso.justDoIt() both exists and they are functions.
  • in csso 2.0.0 and 2.3.1 has no justDoIt() AT ALL.

Tested with:

  • require-css 0.1.8 as a base.
  • csso 1.3.12, 1.4.0, 1.8.0, 2.0.0 and latest (checked 2017/02/18) 2.3.1.
  • requirejs 2.1.10 and 2.3.2
  • node 6.9.5 + npm 3.10.10
  • node 7.5.2 + npm 4.1.2
  • command r.js -o example/build.js with all possible values for optimizeCss

Compatibility Note: I realize, this change may be overthinking/overcomplex, but so far the fact is - there are end consumers of require-css who will upgrade to new require-css version, but remain old csso version --globalor as in my enterprise case (locally in project).
They will have errors like I mentioned in this PR and in #203 and #219.

A bit of automation :) in this boring life

  1. In scope of this PR, I added compatibility-test.sh.
  2. To use this script, you should change optimizeCss in example/build.jsfile from "none"to
  • optimizeCss: "standard.keepLines"
  • optimizeCss: "standard.keepWhitespace"
  • optimizeCss: "standard.keepComments"
  • optimizeCss: "standard.keepComments.keepLines"
  • optimizeCss: "standard.keepLines.keepWhitespace" - default by r.js
  1. At every execution time, script file generates compatibility.log. By searching value Compressed CSS output in that log file, u should see always all good, no Syntax Errors. Active for Feb-19-2017.

cc/ @guybedford @prantlf

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

Successfully merging this pull request may close these issues.

1 participant