[rails-oceania] Re: Ruby Javascript minifier

2009-07-14 Thread cornflakesuperstar
Hey Brian, asset_packager is probably out of date now that rails 2 has a 'cache' attribute available for the javascript_include_tag. To replicate the minification, all you need to do is monkey-patch in a call to jsmin. Check out: http://github.com/cornflakesuperstar/minified_cache/ On Jul 13, 5

[rails-oceania] Re: Ruby Javascript minifier

2009-07-13 Thread Lawrence Pit
> But the tricky part is the caching only happens when a request is made > for the first time, so you've got to invoke another task which make a > wget request to a page This method is problematic if you need to get your assets on a CDN. I think asset packer got it right: in your rails code

[rails-oceania] Re: Ruby Javascript minifier

2009-07-13 Thread Myles Eftos
egroups.com [mailto:rails- > ocea...@googlegroups.com] On Behalf Of Nathan > Sent: Tuesday, 14 July 2009 10:45 AM > To: Ruby or Rails Oceania > Subject: [rails-oceania] Re: Ruby Javascript minifier > > > > Something as simple as caching all the js/css files into a single file

[rails-oceania] Re: Ruby Javascript minifier

2009-07-13 Thread Nathan
Something as simple as caching all the js/css files into a single file not only makes it lighter on the number of requests, but also makes a single target for creating a cap task to minify/compress each of these. There's a blog post on this somewhere around, but I can't find it. So, we tackle i

[rails-oceania] Re: Ruby Javascript minifier

2009-07-13 Thread Nathan de Vries
On 14/07/2009, at 10:51 AM, Chris Lloyd wrote: > The only sort of minifier worth its weight is one that does some > sort of lexical analysis of the JS source tree. Are you saying that the extra 10% compression gained from using a minifier like YUI Compressor is noticeably better than a reduct

[rails-oceania] Re: Ruby Javascript minifier

2009-07-13 Thread Josh Price
Just to be clear, "packaging" tools for JS fall into in 2 distinct camps: 1) Minification - removing comments, whitespace, etc. Doesn't change any of your code, just squishes it up. 2) Compression/Packing - Minification plus identifier replacement, code optimization, etc. Could do all sort

[rails-oceania] Re: Ruby Javascript minifier

2009-07-13 Thread Lachlan Hardy
you could, in fact, go straight to the source: http://www.crockford.com/javascript/jsmin.rb --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group. To post to this group, send email to rails-oce

[rails-oceania] Re: Ruby Javascript minifier

2009-07-13 Thread Mark Mansour
I don't have the references, but I was just looking at some ruby tasks to push your .js against the YUI Compressor service. just do a search on github for yui. On Tue, Jul 14, 2009 at 10:51 AM, Chris Lloyd wrote: > 2009/7/14 Brian Chiha >> >> I'm at the tail end of an RoR project with a heap of

[rails-oceania] Re: Ruby Javascript minifier

2009-07-13 Thread Chris Lloyd
2009/7/14 Brian Chiha > I'm at the tail end of an RoR project with a heap of Javascript files > (ExtJS). Has anyone used a JS Minifier written in Ruby (Preferable), > that can minify and join files? We use Deprec, so getting in working > via a release shouldn't be a hassle... > Brian, The onl

[rails-oceania] Re: Ruby Javascript minifier

2009-07-13 Thread Josh Price
Have been meaning to try out Sprocket: http://getsprockets.org/ On 14/07/2009, at 10:44 AM, Robbie Shepherd wrote: > I like asset_packager. Includes rake tasks that you can build into > your capistrano recipes to generate fresh, cache-busted js and css > on each deploy. > > http://synthesis.

[rails-oceania] Re: Ruby Javascript minifier

2009-07-13 Thread Gareth Townsend
I've used asset_packager before (http://github.com/sbecker/asset_packager/tree/master ) to minify and join css and js files. On 14/07/2009, at 10:37 , Brian Chiha wrote: > > Hi All, > > I'm at the tail end of an RoR project with a heap of Javascript files > (ExtJS). Has anyone used a JS Minif

[rails-oceania] Re: Ruby Javascript minifier

2009-07-13 Thread Robbie Shepherd
I like asset_packager. Includes rake tasks that you can build into your capistrano recipes to generate fresh, cache-busted js and css on each deploy. http://synthesis.sbecker.net/pages/asset_packager On Tue, Jul 14, 2009 at 10:37 AM, Brian Chiha wrote: > > Hi All, > > I'm at the tail end of