Is there a good windows-based JavaScript compressor which will reliably compress script aculo and prototype? Sam _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Hi Sam, I used the compressor that ships with Dojo on a biggish codebase that uses prototype and scriptaculous, and it worked. Knocked 500K of code down to 340K if I remember right, but your mileage may vary. It is Java-based, so should run on windows without a problem. It isn''t a polished GUI at the moment, you''ll need to do a bit of scripting to get it set up. More details here: http://dojotoolkit.org/docs/compressor_system.html HTH Dave On Sunday 25 June 2006 15:19, Sam wrote:> Is there a good windows-based JavaScript compressor which will reliably > compress script aculo and prototype? > > Sam > > > > -- > This email has been verified as Virus free > Virus Protection and more available at http://www.plus.net
http://dojotoolkit.org/docs/compressor_system.html Sounds promising. I''ll see if I can survive the setup ! ;-) Sam
Am Sonntag, 25. Juni 2006 16:19 schrieb Sam:> Is there a good windows-based JavaScript compressor which will reliably > compress script aculo and prototype? > > SamI''ve used jsmin with no problems. Haven''t tried it on Windows though. http://javascript.crockford.com/jsmin.html -- Dirk Eschler <mailto:dirk.eschler-hi6Y0CQ0nG0@public.gmane.org> http://www.krusader.org
> It is Java-based, so should run on windows without a problem. It isn''t a > polished GUI at the moment, you''ll need to do a bit of scripting to get it> set up. More details here:> http://dojotoolkit.org/docs/compressor_system.htmlHere''s a batch file I used to compress all my JavaScripts... It put the compressed *.js files in a subfolder compress, and references the rhino.jar on my drive D. MD compress FOR %%f IN (*.js) DO java -jar d:\rhino\custom_rhino.jar -c %%f > compress/%%f 2>&1 Pause I see about a 30% to 40% reduction in file size, and amazingly, everything ran the first time. Compressed prototype.js, script aculo, windows and more... I imagine the success of this compression engine is due to the hooks into the Mozilla JavaScript engine to get the parsing correct... I''m happy to have found this tool. Sam
On 6/25/06, Sam <sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote:> > It is Java-based, so should run on windows without a problem. It isn''t a > > polished GUI at the moment, you''ll need to do a bit of scripting to get itbefore compression it is a good idea to make sure your code passes the test at http://www.jslint.com then you can use jsmin Peter
I use mod_deflate in my apache httpd to compress the js files. Nearly every modern browser supports contenttype gzip and you get a reduction from about 60 to 80% of the source files. One of the benefits is that you can compress any content (html, css, js ...)... Formerly i also tried js source compression, but i was not lucky about the results. brgds sigi On 6/25/06, Sam <sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote:> > > It is Java-based, so should run on windows without a problem. It isn''t a > > polished GUI at the moment, you''ll need to do a bit of scripting to get > it > > > set up. More details here: > > > http://dojotoolkit.org/docs/compressor_system.html > > Here''s a batch file I used to compress all my JavaScripts... It put the > compressed *.js files in a subfolder compress, and references the > rhino.jar > on my drive D. > > MD compress > FOR %%f IN (*.js) DO java -jar d:\rhino\custom_rhino.jar -c %%f > > compress/%%f 2>&1 > Pause > > I see about a 30% to 40% reduction in file size, and amazingly, everything > ran the first time. Compressed prototype.js, script aculo, windows and > more... > > I imagine the success of this compression engine is due to the hooks into > the Mozilla JavaScript engine to get the parsing correct... > > I''m happy to have found this tool. > > Sam > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
I''d like to add 2 things here - (1) Dojo also provides an online tool for the same (for those of you who don''t want to go through the hassle of setting up anything :) It''s called SHRINKSAFE: http://alex.dojotoolkit.org/shrinksafe/ (2) As far as gzip is concerned, that''s what I would advise anyone trying for js compression (as none of the tools are reliable and debugging becomes a pain later on with the compressed code). Especially with dojo that even changes function names to something like _1 _2 and so on... But, gzip is not 100% reliable, yes it''s not. There are known issues in some of the IE versions (for external js files) - the transfer stops abruptly sometimes (I think it happens on IE 6 without service pack) and the user would see a blank page or page with errors. It''s not the case with just html gzip so if you are putting your scripts inline, then go for gzip, else do extensive testing if you support multiple platforms/os/browsers/etc. Thank you, Mandy. -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]On Behalf Of Siegfried Puchbauer Sent: Monday, June 26, 2006 3:49 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] JavaScript Compression I use mod_deflate in my apache httpd to compress the js files. Nearly every modern browser supports contenttype gzip and you get a reduction from about 60 to 80% of the source files. One of the benefits is that you can compress any content (html, css, js ...)... Formerly i also tried js source compression, but i was not lucky about the results. brgds sigi On 6/25/06, Sam < sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote:> It is Java-based, so should run on windows without a problem. It isn''t a > polished GUI at the moment, you''ll need to do a bit of scripting to get it> set up. More details here:> http://dojotoolkit.org/docs/compressor_system.htmlHere''s a batch file I used to compress all my JavaScripts... It put the compressed *.js files in a subfolder compress, and references the rhino.jar on my drive D. MD compress FOR %%f IN (*.js) DO java -jar d:\rhino\custom_rhino.jar -c %%f > compress/%%f 2>&1 Pause I see about a 30% to 40% reduction in file size, and amazingly, everything ran the first time. Compressed prototype.js, script aculo, windows and more... I imagine the success of this compression engine is due to the hooks into the Mozilla JavaScript engine to get the parsing correct... I''m happy to have found this tool. Sam _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
I would disagree with point #2 below. It has been researched(and theoretically proven? don''t remember the details anymore..google search would probably turn it up) already that gzip ~may~ not always be as fast for deployment as people seem to think. As for tool reliability, not sure I understand that one either. Rhino is fairly stable at this point and maintained by mozilla itself. The dojo compression code section isn''t part of rhino, but small enough that any issues that come up are pretty easily resolvable. The _1_2 style name changes are the reason why the code is "compressed" to begin with... It''s not that much different from what the spidermonkey js bytecode interpreter does at runtime in your browser already. On 6/26/06, Maninder, Singh <mandiv-W2hqgAdRMsX2eFz/2MeuCQ@public.gmane.org> wrote:> > I''d like to add 2 things here - > > (1) Dojo also provides an online tool for the same (for those of you who > don''t want to go through the hassle of setting up anything :) > It''s called SHRINKSAFE: http://alex.dojotoolkit.org/shrinksafe/ > > (2) As far as gzip is concerned, that''s what I would advise anyone trying > for js compression (as none of the tools are reliable and debugging becomes > a pain later on with the compressed code). Especially with dojo that even > changes function names to something like _1 _2 and so on... But, gzip is not > 100% reliable, yes it''s not. There are known issues in some of the IE > versions (for external js files) - the transfer stops abruptly sometimes (I > think it happens on IE 6 without service pack) and the user would see a > blank page or page with errors. It''s not the case with just html gzip so if > you are putting your scripts inline, then go for gzip, else do extensive > testing if you support multiple platforms/os/browsers/etc. > > Thank you, > Mandy. > > -----Original Message----- > *From:* rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto: > rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]*On Behalf Of *Siegfried > Puchbauer > *Sent:* Monday, June 26, 2006 3:49 AM > *To:* rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > *Subject:* Re: [Rails-spinoffs] JavaScript Compression > > I use mod_deflate in my apache httpd to compress the js files. Nearly > every modern browser supports contenttype gzip and you get a reduction from > about 60 to 80% of the source files. One of the benefits is that you can > compress any content (html, css, js ...)... Formerly i also tried js source > compression, but i was not lucky about the results. > > brgds > > sigi > > On 6/25/06, Sam <sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote: > > > > > It is Java-based, so should run on windows without a problem. It isn''t > > a > > > polished GUI at the moment, you''ll need to do a bit of scripting to > > get it > > > > > set up. More details here: > > > > > http://dojotoolkit.org/docs/compressor_system.html > > > > Here''s a batch file I used to compress all my JavaScripts... It put the > > compressed *.js files in a subfolder compress, and references the > > rhino.jar > > on my drive D. > > > > MD compress > > FOR %%f IN (*.js) DO java -jar d:\rhino\custom_rhino.jar -c %%f > > > compress/%%f 2>&1 > > Pause > > > > I see about a 30% to 40% reduction in file size, and amazingly, > > everything > > ran the first time. Compressed prototype.js, script aculo, windows and > > more... > > > > I imagine the success of this compression engine is due to the hooks > > into > > the Mozilla JavaScript engine to get the parsing correct... > > > > I''m happy to have found this tool. > > > > Sam > > > > > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >-- Jesse Kuhnert Tacos/Tapestry, team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
I don''t say that dojo compression is not good, but try debugging in compressed mode on production where your code is deployed, it''s just impossible. Then go through the pain of maintaining a development version of the file and a production version of the file! It''s really not worth complicating it that much unless ofcourse you already have a system setup for this. Otherwise, gzip is fine - and I don''t know what theoretical evidence you are talking about. Text gets compressed a lot (gzip looks for similarities) - for example, if you had a file with 1000 @hotmail.com addresses it would get compressed to something like 1KB :) but if all addresses were different (just not possible in real world) then the compression wouldn''t give great results :) With that said, having a compressor that just removes multiple whitespaces / newlines / comments is good enough. Thanks, Mandy. -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]On Behalf Of Jesse Kuhnert Sent: Monday, June 26, 2006 11:03 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] JavaScript Compression I would disagree with point #2 below. It has been researched(and theoretically proven? don''t remember the details anymore..google search would probably turn it up) already that gzip ~may~ not always be as fast for deployment as people seem to think. As for tool reliability, not sure I understand that one either. Rhino is fairly stable at this point and maintained by mozilla itself. The dojo compression code section isn''t part of rhino, but small enough that any issues that come up are pretty easily resolvable. The _1_2 style name changes are the reason why the code is "compressed" to begin with... It''s not that much different from what the spidermonkey js bytecode interpreter does at runtime in your browser already. On 6/26/06, Maninder, Singh < mandiv-W2hqgAdRMsX2eFz/2MeuCQ@public.gmane.org> wrote: I''d like to add 2 things here - (1) Dojo also provides an online tool for the same (for those of you who don''t want to go through the hassle of setting up anything :) It''s called SHRINKSAFE: http://alex.dojotoolkit.org/shrinksafe/ (2) As far as gzip is concerned, that''s what I would advise anyone trying for js compression (as none of the tools are reliable and debugging becomes a pain later on with the compressed code). Especially with dojo that even changes function names to something like _1 _2 and so on... But, gzip is not 100% reliable, yes it''s not. There are known issues in some of the IE versions (for external js files) - the transfer stops abruptly sometimes (I think it happens on IE 6 without service pack) and the user would see a blank page or page with errors. It''s not the case with just html gzip so if you are putting your scripts inline, then go for gzip, else do extensive testing if you support multiple platforms/os/browsers/etc. Thank you, Mandy. -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]On Behalf Of Siegfried Puchbauer Sent: Monday, June 26, 2006 3:49 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] JavaScript Compression I use mod_deflate in my apache httpd to compress the js files. Nearly every modern browser supports contenttype gzip and you get a reduction from about 60 to 80% of the source files. One of the benefits is that you can compress any content (html, css, js ...)... Formerly i also tried js source compression, but i was not lucky about the results. brgds sigi On 6/25/06, Sam < sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote:> It is Java-based, so should run on windows without a problem. It isn''t a > polished GUI at the moment, you''ll need to do a bit of scripting to get it> set up. More details here:> http://dojotoolkit.org/docs/compressor_system.html <http://dojotoolkit.org/docs/compressor_system.html>Here''s a batch file I used to compress all my JavaScripts... It put the compressed *.js files in a subfolder compress, and references the rhino.jar on my drive D. MD compress FOR %%f IN (*.js) DO java -jar d:\rhino\custom_rhino.jar -c %%f > compress/%%f 2>&1 Pause I see about a 30% to 40% reduction in file size, and amazingly, everything ran the first time. Compressed prototype.js, script aculo, windows and more... I imagine the success of this compression engine is due to the hooks into the Mozilla JavaScript engine to get the parsing correct... I''m happy to have found this tool. Sam _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org <mailto:Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs -- Jesse Kuhnert Tacos/Tapestry, team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Can JavaScript files be gzip''ed in advance, stored on a server and delivered reliably to all browsers? Any browser exceptions? Sam _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
IMHO, the important thing about serving JavaScript is getting the caching right (that is do content expiration in a away that the browser won''t ask the server if the JavaScript was updated for a certain period of time). For repeated page views on a site or web app, that''s the most important performance thing to do (of course this does extend to other page assets, like layout images and style sheets). If you''re on Apache, you probably should take a look at mod_expires. -Thomas Am 25.06.2006 um 16:19 schrieb Sam:> Is there a good windows-based JavaScript compressor which will > reliably compress script aculo and prototype? > > Sam > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs-- Thomas Fuchs wollzelle http://www.wollzelle.com questentier on AIM madrobby on irc.freenode.net http://www.fluxiom.com :: online digital asset management http://script.aculo.us :: Web 2.0 JavaScript http://mir.aculo.us :: Where no web developer has gone before _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Yes definitely. Don''t know if prototype is going to be part of the ajax alliance thing but people are starting to do "hosting" of js packages as well, thus enabling more opportunities/likelyhood that the js being served has already been cached. It''s probably poor manners to being percieved as promoting another tech here but I just think the idea is good (even if I haven''t used it myself yet ) . http://dojo.jot.com/WikiHome/CrossDomainPackageLoading On 6/26/06, Thomas Fuchs <t.fuchs-moWQItti3gBl57MIdRCFDg@public.gmane.org> wrote:> > IMHO, the important thing about serving JavaScript is getting the caching > right (that is do content expiration in a away that the browser won''t ask > the server if the JavaScript was updated for a certain period of time). > For repeated page views on a site or web app, that''s the most important > performance thing to do (of course this does extend to other page assets, > like layout images and style sheets). > > If you''re on Apache, you probably should take a look at mod_expires. > > -Thomas > > Am 25.06.2006 um 16:19 schrieb Sam: > > Is there a good windows-based JavaScript compressor which will reliably > compress script aculo and prototype? > > Sam > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > -- > Thomas Fuchs > wollzelle > > http://www.wollzelle.com > > questentier on AIM > madrobby on irc.freenode.net > > http://www.fluxiom.com :: online digital asset management > http://script.aculo.us :: Web 2.0 JavaScript > http://mir.aculo.us :: Where no web developer has gone before > > > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >-- Jesse Kuhnert Tacos/Tapestry, team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Yes, javascript files can be gzip''d in advance, stored on a server and delivered to browsers. However, IE still has a bug (it''s not to do with gzipping the content, it''s to do with delivering the content where the data transfer terminates abruptly). Here you go with the link to the issue: http://support.microsoft.com/default.aspx?scid=kb;en-us;823386 Thanks, Mandy. -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]On Behalf Of Sam Sent: Monday, June 26, 2006 8:11 PM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails-spinoffs] JavaScript Compression Can JavaScript files be gzip''ed in advance, stored on a server and delivered reliably to all browsers? Any browser exceptions? Sam _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
On Monday 26 June 2006 07:40, Sam wrote:> Can JavaScript files be gzip''ed in advance, stored on a server and > delivered reliably to all browsers? Any browser exceptions?apache''s mod_gzip allows this functionality. -Jeremy -- Jeremy Kitchen ++ kitchen-RA8HwDor7flnDGu+y90WmgC/G2K4zDHf@public.gmane.org http://www.pirate-party.us/ -- defend your rights _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
How about....not reviving week old posts. Just let them go Jeremy, just let them go. -Andrew Martinez -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]On Behalf Of Maninder, Singh Sent: Thursday, July 06, 2006 12:56 PM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails-spinoffs] JavaScript Compression Jeremy on fire! :)) _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Martinez, Andrew wrote:> How about....not reviving week old posts. > > Just let them go Jeremy, just let them go.sorry, just been a bit behind reading this mailing list and playing catch-up, that''s all ;) -Jeremy _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs