Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 8562 invoked from network); 13 Jul 2008 21:54:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Jul 2008 21:54:43 -0000 Received: (qmail 22270 invoked by uid 500); 13 Jul 2008 21:54:42 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 22208 invoked by uid 500); 13 Jul 2008 21:54:42 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 22197 invoked by uid 99); 13 Jul 2008 21:54:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Jul 2008 14:54:42 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [203.9.33.3] (HELO mail0.tt.com.au) (203.9.33.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Jul 2008 21:53:47 +0000 Received: from mail0.tt.com.au (localhost [127.0.0.1]) by postfix.imss70 (Postfix) with ESMTP id 20E9618F81C for ; Mon, 14 Jul 2008 07:53:55 +1000 (EST) Received: from imap.tt.com.au (imap.tt.com.au [10.2.0.9]) by mail0.tt.com.au (Postfix) with ESMTP id 0C0D618F81B for ; Mon, 14 Jul 2008 07:53:55 +1000 (EST) Received: from [127.0.0.1] (bhatt-1.tt.com.au [10.5.0.124]) by imap.tt.com.au (8.13.4/8.13.4) with ESMTP id m6DLmxJE008948 for ; Mon, 14 Jul 2008 07:48:59 +1000 (EST) Message-ID: <487A7920.8090701@tt.com.au> Date: Mon, 14 Jul 2008 07:52:32 +1000 From: Kamal Bhatt User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: Proposal - JS Reader References: <487831E8.7060805@tt.com.au> <487A0AED.8040903@apache.org> In-Reply-To: <487A0AED.8040903@apache.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-Product-Ver: IMSS-7.0.0.8028-5.5.0.1026-16030.000 X-TM-AS-Result: No--3.499-7.0-31-1 X-imss-scan-details: No--3.499-7.0-31-1 X-Virus-Checked: Checked by ClamAV on apache.org Reinhard P�tz wrote: > Kamal wrote: >> Hi, >> It occured to me that Cocoon could probably benefit from a Javascript >> Reader. This JS Reader would do what a normal resource reader would, >> unless the user specifies a compression-method parameter. If the >> compression method is supported, then the JS will be compressed. >> Right now, I think we can only use JSMin[1] or Package[4], as Dojo >> ShrinkSafe[2] and YUI compressor [3] rely on custom version of Rhino. >> Packer [4] is written in plain old javascript. JSMin and Packer are >> open source, but it is not distributed on any Maven repositories that >> I can see, so we would need to include them in source. > > Have you had a look at > http://alchim.sourceforge.net/yuicompressor-maven-plugin/overview.html? > This plugin could be used as part of the build process. Then you could > use the uncompressed Javascript files for development and then when > the module is packaged, the Javascript and CSS files could be compressed. > > And, AFAICS, this plugin uses standard Rhino (1.6R7). See > http://repo1.maven.org/maven2/net/sf/alchim/yuicompressor-maven-plugin/0.7.1/yuicompressor-maven-plugin-0.7.1.pom > Hmmm... Don't know how they did that. I will look into it. > >> This would be useful for the (very large) JS dependencies in CForms >> (though, it could be argued that we should be bundling the already >> compressed version of Dojo and the other Cocoon JS files). >> >> I, personally, would find something like this really useful as we >> have lots of code that we like to keep uncompressed for development, >> but compress at runtime. >> >> What does everyone think? I don't mind coding this up (using just >> JSMin). > > I'm not sure if it is really good idea to compress Javascript files at > runtime. I guess that depends (in part) on whether people generate javascript at run time. If so, then it would be useful to create this reader. > > If you write the plugin, it would also be possible to reuse the > yuicompressor-maven-plugin but not as Maven plugin but as a normal > dependency. By doing it this way you wouldn't have to pull in any > third-party code into our code base. I don't follow this, can you elaborate? -- Kamal Bhatt