Comparing JS Toolkits
This time around, however, it’s been a completely different experience. Just about all of the libraries I have tried have been documented, robust, and effective. I used Aptana to quickly test a wide range of libraries. the libraries that I tried were:
Using Aptana made this very easy – since recent versions of Aptana have all of the libraries already built into it, it was as simple as choosing the "new project" wizard, and selecting each library. The Wizard even creates a sample page, showing that library in action.
I realised that there are really two types of library: those which try to be a complete application building toolkit, and those which simply try to make everyday scripting tasks more easy. Ext and Dojo are complete toolkits. The others are really "helper libraries" (Scriptaculous is actually an add-on to Prototype for UI glitz, and unit testing). I found a good description of this in a blog post entitled The sliding scale.
Along with Ext and Dojo, there are also some commercial libraries attempting to provide complete application toolkits. There’s a good review of these in an InfoWorld article: Top AJAX tools deliver rich GUI goodness. In my testing, these didn’t seem as robust as the open source solutions, although the InfoWorld reviewer came to the opposite conclusion.
Anyway, my interest at the moment is in finding a useful helper library, so I haven’t looked much further that these application toolkits (although they impressed me enough that I’d love to write a complete app with them some day – applications written in Ext in particular look very attractive and usable, without requiring much code).
JQuery, MochiKit, MooTools, and Prototype have more alike than they have differences. They all have the useful ability to use CSS selector notation to extract a range of elements from a page. They all then let you do things to these elements, such as select a filtered subset, attach an event, and change their class.
All of the "helper libraries" are pretty small (~20-30k), as long as you use the packed version. In terms of speed, MooTools and Prototype are twice as slow as the rest of them under Internet Explorer, but twice as fast as the rest of them under Firefox. JQuery has perhaps the most reliable performance under all browsers.