Tuesday, October 11th, 2005

ShrinkSafe: Compress your JavaScript

Category: Dojo, Utility

The Dojo Toolkit guys have had a JavaScript compressor for awhile, but you needed to download and run it locally.

They just exposed this functionalty as ShrinkSafe, so you can now upload one or more JavaScript files, and they will come back as one compressed file.

shrinksafe.png

Posted by Dion Almaer at 9:18 am
10 Comments

+++--
3.6 rating from 10 votes

10 Comments »

Comments feed

This tool is great, it stripped 20kb of one of my files. :)

Comment by Skov — October 11, 2005

Hi, full disclosure, I wrote ShrinkSafe. That said, I just ran a quick test on an uncompressed version of Dojo put through both Dean’s packer and ShrinkSafe.

The source file started at 160K. When run through Packer, it resulted in a 76K file. That’s pretty impressive, however the file failed to evaluate. Running the same file through packer with less aggressive settings didn’t seem to help.

When run through ShrinkSafe with newline stripping, the file came back at 97K, and 101K w/ newlines left in place. Both of those files loaded in browsers without incident.

Jsmin produces a file that works and is 106K in size.

ShrinkSafe appears to generate the smallest of the working files and doesn’t require a download.

Regards

Comment by Alex Russell — October 14, 2005

I can’t get online ShrinkSafe to work at all: I get back empty files. Tried Safari, Moz and Firefox, all on the Mac.

Comment by Chris Purcell — November 5, 2005

I use ShrinkSafe and love it. The safe is the keyword for me. The empty file problem might because of a fatal/syntax error, as I tried one time.

Comment by Son Nguyen — January 30, 2006

[…] NOTE: We posted on ShrinkSafe which is a JS compression tool […]

Pingback by Ajaxian » Ajax and CSS Optimization — January 31, 2006

Is anyone else worried about how on the JSMin page in his example the Before has a string set to ‘Microsoft Internet Explorer’ but the After has it minified to ‘MicrosoftInternetExplorer’ without spaces?

Comment by Steve Nolte — January 31, 2006

Alex, Packer requires that you end all statements with a semicolon, including functions, so that might have been why you had problems getting your file to work.

Although… it looks like Dean Edwards’s site is down now, so I guess it’s sort of irrelevant.

Comment by Matthew Ratzloff — March 7, 2006

I glued prototype and scriptaculous into one file (with minor changes to scriptaculous which normally loads separate files), and it broke in shrinksafe.

It has to do with internal variable renaming getting messed up, but I can’t debug it.

Bummer about that.

If anyone has succeeded in doing this with Scriptaculous 1.6.0 I’d love to see it!

The ideal (maximum option) would be to then take what Doko Compressor returns and push it thru Dean Edward’s Packer!

Wish it was so easy :(

– Alister

Comment by Alister Cameron — March 28, 2006

Shrinksafe seemed to work the best for me too, decent compression, and it worked for 2 / 3 files that I tried.

The packer script had amazing compression, but all 3 files failed to work in firefox or opera. Worked awesome in IE though

Comment by Ash Haque — July 29, 2006

Prototype.js (http://prototype.conio.net/) crashed with both of them ;)

Comment by Edo — February 12, 2007

Leave a comment

You must be logged in to post a comment.