How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

fabien7474
Hi,

I would like to automatically minify my javascript and CSS files each time I run my  Grails application in production mode (i.e. 'grails war' command for instance).

I suppose that it is possible but how can I do it?

Thank you for your insights,

Fabien.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

Dan Lynn
Check these out:

http://www.grails.org/plugin/ui-performance
http://www.grails.org/jawr+plugin

Dan

fabien7474 wrote:

> Hi,
>
> I would like to automatically minify my javascript and CSS files each time I
> run my  Grails application in production mode (i.e. 'grails war' command for
> instance).
>
> I suppose that it is possible but how can I do it?
>
> Thank you for your insights,
>
> Fabien.
>  


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

fabien7474
Thanks!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

LWexler
In reply to this post by Dan Lynn
We can highly recommend jawr and the jawr plugin.  

jawr is very powerful, and is very easy to use with grails with the
plugin.
No problems...

-----Original Message-----
From: Dan Lynn [mailto:[hidden email]]
Sent: Thursday, February 11, 2010 2:06 PM
To: [hidden email]
Subject: Re: [grails-user] How to minify my JS and CSS files before
'grails war' or 'grails run-war' ?

Check these out:

http://www.grails.org/plugin/ui-performance
http://www.grails.org/jawr+plugin

Dan

fabien7474 wrote:
> Hi,
>
> I would like to automatically minify my javascript and CSS files each
time I
> run my  Grails application in production mode (i.e. 'grails war'
command for
> instance).
>
> I suppose that it is possible but how can I do it?
>
> Thank you for your insights,
>
> Fabien.
>  


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


--
_________________________________________________________
This communication is intended only for the addressee(s) and may contain confidential information. We do not waive any confidentiality by misdelivery. If you receive this communication in error, any use, dissemination, printing or copying is strictly prohibited; please destroy all electronic and paper copies and notify the sender immediately.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

basejump (Josh)
We can highly recommend the ui-performance plugin in production
never tried the jawr plugin so can't give a compare/contrast


On Feb 11, 2010, at 4:02 PM, Lee Wexler wrote:

> We can highly recommend jawr and the jawr plugin.  
>
> jawr is very powerful, and is very easy to use with grails with the
> plugin.
> No problems...
>
> -----Original Message-----
> From: Dan Lynn [mailto:[hidden email]]
> Sent: Thursday, February 11, 2010 2:06 PM
> To: [hidden email]
> Subject: Re: [grails-user] How to minify my JS and CSS files before
> 'grails war' or 'grails run-war' ?
>
> Check these out:
>
> http://www.grails.org/plugin/ui-performance
> http://www.grails.org/jawr+plugin
>
> Dan
>
> fabien7474 wrote:
>> Hi,
>>
>> I would like to automatically minify my javascript and CSS files each
> time I
>> run my  Grails application in production mode (i.e. 'grails war'
> command for
>> instance).
>>
>> I suppose that it is possible but how can I do it?
>>
>> Thank you for your insights,
>>
>> Fabien.
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
> --
> _________________________________________________________
> This communication is intended only for the addressee(s) and may contain confidential information. We do not waive any confidentiality by misdelivery. If you receive this communication in error, any use, dissemination, printing or copying is strictly prohibited; please destroy all electronic and paper copies and notify the sender immediately.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

fabien7474
Can we use both plugins (jawr and ui-performance) or are they redundant/not compatible ? 


On Fri, Feb 12, 2010 at 6:52 PM, Joshua Burnett <[hidden email]> wrote:
We can highly recommend the ui-performance plugin in production
never tried the jawr plugin so can't give a compare/contrast


On Feb 11, 2010, at 4:02 PM, Lee Wexler wrote:

> We can highly recommend jawr and the jawr plugin.
>
> jawr is very powerful, and is very easy to use with grails with the
> plugin.
> No problems...
>
> -----Original Message-----
> From: Dan Lynn [mailto:[hidden email]]
> Sent: Thursday, February 11, 2010 2:06 PM
> To: [hidden email]
> Subject: Re: [grails-user] How to minify my JS and CSS files before
> 'grails war' or 'grails run-war' ?
>
> Check these out:
>
> http://www.grails.org/plugin/ui-performance
> http://www.grails.org/jawr+plugin
>
> Dan
>
> fabien7474 wrote:
>> Hi,
>>
>> I would like to automatically minify my javascript and CSS files each
> time I
>> run my  Grails application in production mode (i.e. 'grails war'
> command for
>> instance).
>>
>> I suppose that it is possible but how can I do it?
>>
>> Thank you for your insights,
>>
>> Fabien.
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
> --
> _________________________________________________________
> This communication is intended only for the addressee(s) and may contain confidential information. We do not waive any confidentiality by misdelivery. If you receive this communication in error, any use, dissemination, printing or copying is strictly prohibited; please destroy all electronic and paper copies and notify the sender immediately.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

basejump (Josh)
shouldn't need to use both for the need you laid out. either one should do the trick

On Feb 12, 2010, at 1:37 PM, Fabien Benichou wrote:

Can we use both plugins (jawr and ui-performance) or are they redundant/not compatible ? 


On Fri, Feb 12, 2010 at 6:52 PM, Joshua Burnett <[hidden email]> wrote:
We can highly recommend the ui-performance plugin in production
never tried the jawr plugin so can't give a compare/contrast


On Feb 11, 2010, at 4:02 PM, Lee Wexler wrote:

> We can highly recommend jawr and the jawr plugin.
>
> jawr is very powerful, and is very easy to use with grails with the
> plugin.
> No problems...
>
> -----Original Message-----
> From: Dan Lynn [mailto:[hidden email]]
> Sent: Thursday, February 11, 2010 2:06 PM
> To: [hidden email]
> Subject: Re: [grails-user] How to minify my JS and CSS files before
> 'grails war' or 'grails run-war' ?
>
> Check these out:
>
> http://www.grails.org/plugin/ui-performance
> http://www.grails.org/jawr+plugin
>
> Dan
>
> fabien7474 wrote:
>> Hi,
>>
>> I would like to automatically minify my javascript and CSS files each
> time I
>> run my  Grails application in production mode (i.e. 'grails war'
> command for
>> instance).
>>
>> I suppose that it is possible but how can I do it?
>>
>> Thank you for your insights,
>>
>> Fabien.
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
> --
> _________________________________________________________
> This communication is intended only for the addressee(s) and may contain confidential information. We do not waive any confidentiality by misdelivery. If you receive this communication in error, any use, dissemination, printing or copying is strictly prohibited; please destroy all electronic and paper copies and notify the sender immediately.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

burtbeckwith
In reply to this post by fabien7474
The plugins are similar, so you wouldn't use both. UI Performance works with images in addition to css and js files, whereas jawr only works with css and js files. jawr has a feature for adding i18n support for JavaScript that UI Performance doesn't.

See the plugin pages for more info: http://grails.org/plugin/ui-performance and http://grails.org/plugin/jawr

Burt

> Can we use both plugins (jawr and ui-performance) or are they redundant/not
> compatible ?

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

Dan Lynn
Regardless of which you choose, beware bundling jQuery and Prototype
into the same file. I just got done pounding my head against the wall
trying to figure out why bundling resulted in javascript errors with
jQuery 1.4.1 and Prototype 1.6.1.

Cheers,
Dan

Burt Beckwith wrote:

> The plugins are similar, so you wouldn't use both. UI Performance works with images in addition to css and js files, whereas jawr only works with css and js files. jawr has a feature for adding i18n support for JavaScript that UI Performance doesn't.
>
> See the plugin pages for more info: http://grails.org/plugin/ui-performance and http://grails.org/plugin/jawr
>
> Burt
>
>  
>> Can we use both plugins (jawr and ui-performance) or are they redundant/not
>> compatible ?
>>    
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>  


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

fabien7474
I have taken  Prototype away from my bundle for exactly the same problems. Almost whatever you can do with Prototype is available with jQuery or jQuery plugins.

Do jawr or UI-Performance use Prototype? 

Fabien 

On Fri, Feb 12, 2010 at 8:57 PM, Dan Lynn <[hidden email]> wrote:
Regardless of which you choose, beware bundling jQuery and Prototype into the same file. I just got done pounding my head against the wall trying to figure out why bundling resulted in javascript errors with jQuery 1.4.1 and Prototype 1.6.1.

Cheers,
Dan


Burt Beckwith wrote:
The plugins are similar, so you wouldn't use both. UI Performance works with images in addition to css and js files, whereas jawr only works with css and js files. jawr has a feature for adding i18n support for JavaScript that UI Performance doesn't.

See the plugin pages for more info: http://grails.org/plugin/ui-performance and http://grails.org/plugin/jawr

Burt

 
Can we use both plugins (jawr and ui-performance) or are they redundant/not
compatible ?
   

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


 


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

burtbeckwith
They don't use any JavaScript library, just support minification, compression, bundling, etc. for them.

Burt

> I have taken  Prototype away from my bundle for exactly the same problems.
> Almost whatever you can do with Prototype is available with jQuery or jQuery
> plugins.
>
> Do jawr or UI-Performance use Prototype?
>
> Fabien

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

fabien7474
@Burt,

Thanks for all this information.

Concerning Performance-UI plugin, do you know if I need to set up Apache configuration such that incoming requests to /images, /css, /js are cached by apache or does the plugin enable this automatically?

Thanks,

Fabien
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

burtbeckwith
That's one of the features of the plugin - a far-future expires header is set on all processed resources (you can optionally configure exclusions).

Burt

> @Burt,
>
> Thanks for all this information.
>
> Concerning Performance-UI plugin, do you know if I need to set up Apache
> configuration such that incoming requests to /images, /css, /js are cached
> by apache or does the plugin enable this automatically?
>
> Thanks,
>
> Fabien
 

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

fabien7474
If I understand  the expires header  feature, it will allow the client browser to cache resources which will avoid HTTP request for subsequent page views, right? Or does Apache cache the resources as well?

 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

burtbeckwith
Right, you shouldn't need Apache at all. The plugin sets a 10-year expires header. Since this will effectively keep clients from ever downloading genuinely changed files (after a redeploy) it renames all resources with a build number (auto-generated or user-supplied) to guarantee unique names. When you deploy a new build clients will get the latest versions since the names will have changed, but will keep cached versions locally in-between redeployments.

Burt

>
> If I understand  the expires header  feature, it will allow the client
> browser to cache resources which will avoid HTTP request for subsequent page
> views, right? Or does Apache cache the resources as well?

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

Marc Palmer Local

On 13 Feb 2010, at 00:33, Burt Beckwith wrote:

> Right, you shouldn't need Apache at all. The plugin sets a 10-year expires header. Since this will effectively keep clients from ever downloading genuinely changed files (after a redeploy) it renames all resources with a build number (auto-generated or user-supplied) to guarantee unique names. When you deploy a new build clients will get the latest versions since the names will have changed, but will keep cached versions locally in-between redeployments.
>

I'm really looking forward to trying out ui-performance plugin Burt, I've not used it yet but will need to soon.

Marc


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

Sebastian Hohns
Ui-Performance is great. Massive improvements with very little time effort. We have many guys out there in the field working with UMTS connections, every request is expansive (ping times around 300ms ). I reduced most of my pages to <5 Requests  which improved things a lot for everyone but especially for these guys.
UI-Performance, in combination with YSlow, is just great for optimizing these kind of things, thanks Burt.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to minify my JS and CSS files before 'grails war' or 'grails run-war' ?

mikelilin
In reply to this post by fabien7474
you can try this free online service to minify js and compress css, so it will reduce the size of web page.
Loading...