documentcloud / jammit

Industrial Strength Asset Packaging for Rails
http://documentcloud.github.com/jammit/
MIT License
1.16k stars 197 forks source link

added uglifier javascript compression support #132

Closed rwz closed 13 years ago

rwz commented 13 years ago

Six routing test are still failing on rails3, but compression works ok.

yfeldblum commented 13 years ago

Cool. Two comments.

  1. Enforce an interface on the JavaScript minifiers of #compress. If a class (such as Uglifier) doesn't have that interface, subclass it and in the subclass alias #compress to whatever method that class does have. For example, class Jammit::Uglifier < ::Uglifier; alias compress compile end. This gets rid of trying to figure out which method to call, and bows to some of the SOLID principles.
  2. uglifier depends explicitly on therubyracer, which does not compile on Heroku. Merging this now means jammit users cannot deploy to Heroku anymore. This merge needs to wait until uglifier removes it dependency on therubyracer or until Google or Heroku figures out why therubyracer doesn't compile on Heroku, so as not to surprise people using both jammit and Heroku.

Cheers!

rwz commented 13 years ago

first done.

yfeldblum commented 13 years ago

I like it!

A merge still needs to wait for the jammit <-> uglifier <-> therubyracer <-> Heroku quandary to be resolved one way or the other, so jammit users on Heroku don't get surprised.

brainopia commented 13 years ago

Yay, uglifier beats closure :)

jashkenas commented 13 years ago

Thanks for this -- it's a beautiful patch, and Uglify support has been much requested. Merged to master. It'll go out with the next release.