Thursday, May 24th, 2007

ProtoPacked 2.13: Protoype + Script.aculo.us == 32kb

Category: Prototype, Scriptaculous

John-David Dalton is up to his packing tricks again, and has created ProtoPacked 2.13:

This updated pack includes compressed versions of Prototype: 1.4, 1.5,
1.5.1 and Scriptaculous: 1.7.1_beta2.

There is also a “Protoculous” option as well (Prototype and
Scriptaculous combined)

Smallest files are:
Prototype 1.5.1 @ 15.8kb
Scriptaculous-1.7.1_beta2 @ 17.9kb
Protoculous (1.5.1 + 1.7.1_beta2) @ 32.5kb

Download from here and find protopacked_v2.13.zip.

Posted by Dion Almaer at 7:15 am
30 Comments

++++-
4.4 rating from 83 votes

30 Comments »

Comments feed TrackBack URI

awesome news. but the file is incomplete i think it gives error when i trying to extract it. you know, “unexpected end of archive”

Comment by ilkin aka ir2 — May 24, 2007

here is the working one; http://www.wikeo.be/files/951/protoculous-1.0.1.zip
thank you google!

Comment by ilkin aka ir2 — May 24, 2007

@ilkin – The Google Groups pages have been acting wierd the last couple of days. I just tried the download/extract and it worked fine for me 8).
Try again in 15 min or so and see if that helps.

Comment by jdalton — May 24, 2007

@ilkin – The package from wikieo.be was not made by me, but by “Thomas”. His package only includes the Prototype + Scriptaculous combo and does not include gzipped versions. We also went about compressing them in different ways. He used ShrinkSafe on Scriptaculous and used a pre-formatted Prototype. Because the encodings were not consistent his compression suffered some. He also relied on High ASCII JavaScript compression which has been known to causes issues for the newest Safari/OmniWeb.

I recommend staying with this source:
http://groups.google.com/group/prototype-core/files

Comment by jdalton — May 24, 2007

Great work as always JD. Some day I’ll have to twist your arm about your compression routines! ;)

Comment by Rey Bango — May 24, 2007

@Rey – Thanks 8). You need only look to Dean Edwards. His Packer is all I use. ( No twisting required 8P )

Comment by jdalton — May 24, 2007

With this version of prototype + scriptaculous, we can’t load just a “part” of scriptaculous? like just the “effect” module for example.
Am I right?

Comment by Nicolas — May 24, 2007

@JD: I took the latest PT 1.5.1 and packed it with Dean’s Packer and my results are different from yours. Can you buzz me off post so I can give you what I see and we can compare notes? reybango (at} gmail

Comment by Rey Bango — May 24, 2007

@Nicolas – You are correct 8). I choose to pack all the Scriptaculous components. I will most likely (when time permits) produce a pack for the different components of Scriptaculous.

The good news is I gave you the tools to do so in the package. The tool I used to format Scriptaculous is under the “tools” folder.

1) The tool is an HTML file so edit the source and replace the appropriate code block with the component you want formatted.

2) Past the Prototype 1.5.1 (formatted code) and the Output from the tool into Dean Edwards’ packer.

3) Pack and enjoy your Custom “Protoculous”.

Comment by jdalton — May 24, 2007

@Rey – Before packing them I did have to format the code (add missing semi-colons and fix some troublesome regexp that most compressors don’t like).

Comment by jdalton — May 24, 2007

I have been using the tip from here
http://rakaz.nl/item/make_your_pages_load_faster_by_combining_and_compressing_javascript_and_css_files

I dont bother with the mod rewrite stuff, and just pass my files along to the combine.php file directly… Makes prototype, Scriptaculous and my own scripts.js file combined into one file at 32k.

Also this way, I can me making changes to my scripts.js file while building and still get the advantage of compression.

Comment by Alex Duffield — May 24, 2007

@Alex – What version of Prototype/Scriptaculous are you using? 32kb for those plus your own code tells me its probably not 1.5.1+1.7.1_beta2.

I actually use a similar method in my own projects. http://www.pradosoft.com/demos/quickstart/?page=Advanced.Scripts3

Comment by jdalton — May 24, 2007

It would be great if the Prototype guys would add a few semicolons so we could pack Prototype more easily! Just a thought…

Comment by Michael Jackson — May 24, 2007

@Michael Jackson – In their defense they write valid code, it’s not up to them to support every JavaScript compressor out there. I would like them to at least throw in the missing semi-colons, but they have their reasons and I respect that. For now you can use the ‘pre-formatted’ Prototype versions included in the package. This package has Original, Formatted, Compressed/Gzipped forms for every supported version.

Comment by jdalton — May 24, 2007

Ooh very nice.

Comment by Noah Everett — May 24, 2007

it’s Prototype, not Protoype

Comment by jjjjj — May 24, 2007

jdalton – I stand corrected it is 51.7k for the full prototype and Scriptaculous when using the combine.php file to serve them up. I want using everything in Scriptaculous..
(Scriptaculous 1.7.1 b2 + prototype 1.5.1 final)

Looks to be about on par with this method for final size, but adds the flexibility to be able to read the code and edit it at will on top of being able to add what ever other files I create myself.. Plus it also compresses CSS!

This article says that the file “protoculous-1.0.1.js” is 32.5kb, but looking at the file after downloading it and it is 56k…

Comment by Alex Duffield — May 24, 2007

opps.. spelling..
Should have been “I WASN’T using everything in Scriptaculous..”

Comment by Alex Duffield — May 24, 2007

Nice, Thanks!

Comment by Joseph — May 24, 2007

For thos fo you reading WIRED i’ve thought of a new Jargon watch buzzword that we could create after reading a comment above:
IT’S PROTOHYPE not PROTOTYPE :) love it…

Comment by carlo de marchis — May 24, 2007

@Alex – As I mentioned in an earlier post the package that the other commenter, Ilkin pointed to, was not made by me. Look at my previous comments for clarification. I also mentioned that I use a similar method to yours in my own projects. Re-reading my comments may help.

I am not saying that my package should replace what you have. What you have works for you. This package is to help those who are looking for a quick way to get formatted and compressed forms of Prototype and Scriptaculous.

Developers can do whatever they want with the formatted, var-strunk, packed, and gzipped forms that my package offers. For example, if you use the var-shrunk version of Prototype in your setup it would give you a smaller gzipped file, thus lessening the over-all footprint.

ProtoPacked can be found only at:
http://groups.google.com/group/prototype-core/files

The smallest file size of the (Prototype/Scriptaculous combo) is correct @ 32.5kb.

Comment by jdalton — May 24, 2007

Use this tool to compress your js/css files correctly.

http://scott.carnett.name/downloads/jCompressor.zip

(uses Dean Edwards Packer and Mozilla Rhino).

Comment by Scott — May 25, 2007

I know its an old argument and people love to compress their javascript … but a simple jsmin and gzip compression can compress normal code (code that’s readable and not written using one-char variablenames) with ~85% and you don’t have the problem that the heavy use of eval()/regexp during unpacking freezes older browsers.

And missing semicolons are not really valid code, to write warning-free give jslint a try or enable at least warnings in your firebug. Most people will never pay attention to it, but I feel better without warnings :D

Comment by digitarald — May 25, 2007

Too bad, scriptaculous 1.7.1 b3 is out :p

Comment by devil1591 — May 25, 2007

digitarald – Following jslint can result in much pulling of hair, because many of jslints warnings are invalid or false. Prototypes code is valid without the missing semi-colons.

The script deployment method I use in my own projects utilizes something similar to jsmin and gzip compression too (http://www.pradosoft.com/demos/quickstart/?page=Advanced.Scripts3).

The ProtoPack package also includes gzipped versions of each release.

@ Scott – I use Firefox to format Scriptaculous and Deans packer as well 8). The formatted versions included in ProtoPack will work with many different compressors including ShrinkSafe and Dean’s Packer.

Comment by jdalton — May 25, 2007

Updated v2.14:
Added support for Scriptaculous 1.7.1_beta3.
Added more links to info on JavaScript concatenation and compression.

To download go to:http://groups.google.com/group/prototype-core/files
Click on “protopacked_v2.14.zip”

Please read the “readme first.txt” for all the information on this package.

Comment by jdalton — May 28, 2007

If I just want to optimize the number of hit on my serveur but not compression : I only use protoculous-shrinkvars.js (@ 133Ko).
Is that correct ?
Thank you

Comment by opticex — August 30, 2007

Righteous!

Comment by Randolph — September 26, 2007

Why can’t I find any minified version of Script.aculo.us 1.8.2, which has been released back in Nov. 2008 ?

Comment by magnosis — September 18, 2009

@magnosis and everyone that need up-to-date prototype and scriptaculous compressed, I made a last update to Protoculous.
You can grab the 2.0 release at http://protoculous.wikeo.be/
Hope this will help someone ;-)

Comment by bistory — August 22, 2011

Leave a comment

You must be logged in to post a comment.