Download compressed Prototype versions: (File: protopressed.zip)

101 views
Skip to first unread message

jd

unread,
Feb 21, 2007, 2:12:17 PM2/21/07
to Prototype: Core
Hello,

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.

I used:
Dean Edward's packer to strip whitespace with the compression level of
"none";
http://dean.edwards.name/packer/

Then ran the packed code through Memtronics compressor on "best" with
"hardcore" checkled.
http://hometown.aol.de/_ht_a/memtronic/

I wish the Prototype team would put the proper formatted Prototype
version into their svn cycle.

jd

unread,
Feb 21, 2007, 2:18:55 PM2/21/07
to Prototype: Core

Thomas Fuchs

unread,
Feb 21, 2007, 2:19:17 PM2/21/07
to prototy...@googlegroups.com
Heya,

Did you ever try gzipping?

Super-great compression without the negative things of JS-native
compression.

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
most webservers.

Best,
Thomas

Tom Gregory

unread,
Feb 21, 2007, 2:22:09 PM2/21/07
to prototy...@googlegroups.com
You'll find a) that this discussion come up every couple of months,
and b) most everyone here uses some sort of compressor successfully,
without needing to modify the Prototype source.

Personally, I use jsmin, and have had no problems with it. [worksforme]


TAG

jd

unread,
Feb 21, 2007, 2:31:37 PM2/21/07
to Prototype: Core
Right,

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
options.

Andrew Dupont

unread,
Feb 21, 2007, 3:27:53 PM2/21/07
to Prototype: Core

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
JavaScript. I don't use Packer personally -- though I think it's a
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 [1], 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
than nothing.

Cheers,
Andrew

[1] http://alex.dojotoolkit.org/shrinksafe/

Thomas Fuchs

unread,
Feb 21, 2007, 3:40:54 PM2/21/07
to prototy...@googlegroups.com

Am 21.02.2007 um 21:27 schrieb Andrew Dupont:
> On Feb 21, 1:31 pm, "jd" <jdalton...@gmail.com> wrote:
>> Right,
>>
>> 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
>> options.
>
> 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.

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...?

Best,
Thomas

Tom Gregory

unread,
Feb 21, 2007, 3:53:22 PM2/21/07
to prototy...@googlegroups.com
That's only half of a proper question. Any answer has to be viewed in
the context of the full question:

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.


TAG

jd

unread,
Feb 21, 2007, 4:03:12 PM2/21/07
to Prototype: Core

Packer seemed to work just fine with single line if statements.
I did, however only use compression "none" option to just remove
whitespace.
All I did was add some missing semi colons to the Prototype source.
You can use winMerge or other file compare tool to see the changes
between the formatted and original sources.
http://winmerge.org/

Cheers,
-jd

Thomas Fuchs

unread,
Feb 21, 2007, 4:10:43 PM2/21/07
to prototy...@googlegroups.com
Sure enough.

I can live with telling people to get a real browser and having all
IE6 requests getting the non-compressed version. No problem with
that. :)

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.

Best,
Thomas

Martin Ellis

unread,
Feb 21, 2007, 5:26:58 PM2/21/07
to Prototype: Core
Instead of sadistically adding semi colons and other needed things to
make it small, run it through rhino and it can spit out good looking
code. There are a few web based talls for successfully renaming
variables to short hand forms, i would'nt recommend it unless you know
how to test everything to make sure it did a good job, but it does
work wonders.

Andrew Dupont

unread,
Feb 21, 2007, 8:37:12 PM2/21/07
to Prototype: Core
On Feb 21, 4:26 pm, "Martin Ellis" <mal...@gmail.com> wrote:
> Instead of sadistically adding semi colons and other needed things to
> make it small, run it through rhino and it can spit out good looking
> code.

Rhino can do this? Can you tell us how?

Reply all
Reply to author
Forward
0 new messages