Quoting Antoine Beaupré (2014-01-30 05:24:51)
> On 2014-01-29 23:12:50, Jerome Charaoui wrote:
>> Le 2014-01-29 22:16, Antoine Beaupré a écrit :
>>> Jérome: what's wrong with sass? you seem to be looking through 
>>> heaven and earth for an alternative... :)
>>
>> I don't have any bias against it, it's only that pulling in ruby does 
>> seem a bit overkill. Plus, if we want PhotoFloat to use sass and 
>> handle css syntax errors I think that may require some adjustments 
>> upstream to the Makefile and/or patches, or at least a ship custom 
>> script with the package like Jonas suggests.
> 
> That's a good point. Ruby is huge, maybe we don't want to add that 
> extra dependency.
> 
> I am not sure we should worry about CSS syntax errors, that seems like 
> a nice feature anyways.

Using make, ruby-sass and node-uglify - no patching:

  make -C web css/styles.min.css JS_COMPILER=uglifyjs CSS_COMPILER='perl -e 
'\''system "sass --style compressed --no-cache $$ARGV[2] $$ARGV[1]"'\'' -- '

runtime filesize: 3650 + 18024 = 21674

runtime pkgsize bloat: ~1M + ~13M + ~7M = ~21M

***

Using ruby-sass and node-uglify - no make or patching:

  find web/css -name '*.css' -not -name '*.min.css' -exec cat {} + \
    | scss --style compressed --no-cache --stdin web/css/styles.min.css
  find web/js -name '*.js' -not -name '*.min.js' -exec cat {} + \
    > web/js/scripts.min.js~ \
    && uglifyjs -o web/js/scripts.min.js web/js/scripts.min.js~ \
    && rm web/js/scripts.min.js~

runtime filesize: 3648 + 13267 = 16915

runtime pkgsize bloat: ~13M + ~7M = ~20M

***

My favorite - uglify at build time and preserve CSS readable shipped 
below /etc to allow editing (why hardcode Palatino?):

  find web/css -name '*.css' -not -name '*.min.css' -exec cat {} + \
    | scss --style compact --no-cache --stdin web/css/styles.min.css
  find web/js -name '*.js' -not -name '*.min.js' -exec cat {} + \
    > web/js/scripts.min.js~ \
    && uglifyjs -o web/js/scripts.min.js web/js/scripts.min.js~ \
    && rm web/js/scripts.min.js~

runtime filesize: 4178 + 13267 = 17445

runtime pkgsize bloat: 0


If you insist on uglifying at runtime, then I still recommend compacting 
CSS at build time (300 bytes win is silly when using jQuery bloat!).

If you insist on uglifying _CSS_ at runtime, then I still recommend 
using ruby-sass, and switch to sassc later (see bug#694733,694730).

 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

Attachment: signature.asc
Description: signature

Reply via email to