I love Prototype and wanted to contribute something. It has always
frustrated me that Prototype doesn't easily compress. This is caused
by a lack of proper semi colons and what not. I have taken the time
to add the semi colons and compress several versions of Prototype.
Prototype 1.4.0 (13.2kb);
Prototype 1.5.0_rc0 (16.6kb)
Prototype 1.5.0_rc1 (18.6kb)
Prototype 1.5.0_final (21.8kb)
The protopressed.zip, located under "Files" contains original
versions, formatted versions, and compressed versions.
Dean Edward's packer to strip whitespace with the compression level of
Then ran the packed code through Memtronics compressor on "best" with
I wish the Prototype team would put the proper formatted Prototype
version into their svn cycle.
The previous memtronics link may seem slow:
The link to this thread with the "Files" section listed:
Did you ever try gzipping?
Super-great compression without the negative things of JS-native
Personally, I use jsmin + gzip.
For example, Prototype 1.5.0 plus _all_ of script.aculo.us is ~34k.
gzipping is supported by all browsers Prototype targets, plus by
Personally, I use jsmin, and have had no problems with it. [worksforme]
Ya I would say server solutions are best, but you can always combine
them. Anways its just a little somethin. I figured having proper semi
colons n what is prolly worth the dload 8). Its always nice to have
Agreed. This doesn't bother me at all as long as we don't have to
support compressed versions :-)
It should be noted that gzipping is not a universal solution, since
IE6 exhibits occasional problems with gzipped content (unless the
user has installed a particular hotfix, but you can't be certain of
that). So it's best not to serve gzipped content to IE6, even if it
claims it can handle it.
For this reason, I can see why people want to minify and compress
great tool, it requires syntax that's far too rigid than what we're
comfortable with. (I don't mind the semicolon requirement, but
requiring braces for one-line IF statements is beyond the pale.) So
you're quite welcome to clean up the syntax and distribute packed
versions of Prototype on your own.
Allow me also to recommend Dojo ShrinkSafe , which does not have
any syntax requirements above and beyond what an interpreter needs
(since it uses Rhino to parse the JS). It won't give you the same
compression level that gzip or Packer would, but it's a lot better
Should we care for people that haven't installed a years-old hotfix?
Aren't they going to have a gadzillion security problems anyway? ;)
Anyway, for getting real: does anyone have stats if the affected
versions still have some appreciable share...?
Does anyone have states of the affected share __for some target
audience__. Google has a different audience than MSN, Yahoo, or AOL.
(I'll stereotype and suggest a higher proportion of technical users
use Google, for example.) I worked for a major e-commerce company
($500M+/yr) that discovered the vast majority of its (profitable)
customers were 30-something college educated women in middle-upper
income households. A rather different dynamic than ThinkGeek.
So, even if Google were to respond to the question, the answer still
might not apply, and would certainly be less valuable than we might
originally think. The only real way to know is to audit your own logs.
I can live with telling people to get a real browser and having all
IE6 requests getting the non-compressed version. No problem with
Anyway, in most situations, just using the libs as-is and providing
proper content expiration works fine enough.
The gzipping is just the icing on the bandwidth cake.
Rhino can do this? Can you tell us how?