views:

525

answers:

7

While considering the JS framework for my next project, I can see the scale clearly tipping towards jQuery, however, Prototype is getting good reviews, too.

The issue I am thinking of is how to downscale these to have only the functionality I REALLY need. The latest jQuery seems to be 55k compressed, for instance, and I clearly need only the very basic functionality needed mostly or cross-browser compatibility.

The alternative of coding just what I need by hand sounds quite a pain in the butt.

Has anyone come across some "jQuery downscaler" or "Prototype downscaler"? Stuff like Dlite does not quite cut it since I need the cross-browser AJAX with timeouts, and the cross-browser cookie handling, but maybe there is some other lightweight solution?

ASP-related bundles won't help since I am doing a PHP-based solution.

Any tips on that will be much appreciated.

+9  A: 

Check these Frameworks out:

If you want a complete but light weight solution, I'd suggest you go with Midori or DOMAssistant.

Finally, here is a link that will show you differences between the frameworks: http://en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks

[Edit]

This post may also help you with your research.

Andreas Grech
+1  A: 

I use packed version of Prototype + Scriptaculous that weighs in at 146k. You can get a packed version of Prototype by itself at about 76K.

Since Prototype is very self-referential (Prototype uses its own shortcuts to build itself) there is no really easy way to strip out bits of it and make a "lighter" version.

I've been using Prototype pretty well since it came out and must say that I'm pretty happy with it. But when it comes to file size, there are smaller alternatives with other frameworks.

Diodeus
+3  A: 

just minify&gzip. You will get only 15kb or so. Is not a huge size, isn't it?:)

Ionut Staicu
+1  A: 

Is file size really a huge problem? The biggest gain comes from simply gzipping your javascript files; minifying beyond that, in my experience, only decreases the file size by a few percent. And since the libraries are open source, readability isn't a risk. Remember, you only have to load a javascript library once. The user's cache will keep it ready for you.

Personally, I use Prototype and script.aculo.us. For me, they are very intuitive.

geowa4
+3  A: 

jQuery is about 10k compressed and minified with YUI compressor:

http://www.julienlecomte.net/blog/2007/08/13/

That is incredibly tiny for the amount of functionality you get in jQuery.

Ryan Doherty
+2  A: 

Have you considered mootools yet? It allows you to build your own file, giving you the ability to choose whatever you need and download it without getting anything you may not use in the future.

Plus, it's a very powerful library and is updated often.

I would seriously consider it.

Salty
A: 

reglib comes in 40 kb.

niko

nes1983