What JavaScript libraries do you use?

From Jimbojw.com

Jump to: navigation, search

Recently, Jean-Lou Dupont asked me in an email the simple question: "What sort of AJAX framework are you using: jQuery, MooTools, YUI, prototype etc. ?"

The truth is, I'm currently in a state of flux between frameworks. Let me explain...

Prototype/Scriptaculous

For a long time I was partial to Prototype for cross-browser development/Ajax and Scriptaculous for effects. I find the documentation for these libraries to be for the most part thorough, using gotAPI and the scriptaculous wiki for info respectively.

Note: If you've never used gotAPI, I strongly suggest you start today. It is, quite simply, the fastest and easiest way to find API docs on a wide range of current web technologies and programming languages.

jQuery

Since it was created, I've always kept a place in my heart for jQuery because of its ingenious '$' method and English-like syntactical sugar. Unlike Prototype's $ which is basically a document.getElementById() wrapper, jQuery's function takes a string representation of a CSS3 compatible selector and returns a collection all matching elements. Prototype now has a similar method called $$, but, by their own admission, it's not as fast as it could be.

That said, I've never actually used jQuery in a project of mine as yet - though it's on my list of technologies to investigate further.

Ext/YUI

In the last few weeks I've been writing some small Adobe AIR applications, and consequently I've been researching JavaScript frameworks to make development easier. One that comes up a lot in the AIR world is Ext - which is fantastic at creating all manner of desktop-app-like widgetry. Whereas other frameworks force you to create your own images and CSS to back your JS magic, Ext comes prepackaged with several "themes" - each with its own set of icons, backgrounds, gradients and stylesheets. It also has out-of-the-box support for a number of common UI paradigms such as tabbed panels, menu bars and sliding frames.

Ext was originally built on the Yahoo! User Interface Library (YUI), but has since been decoupled. Ext can now be used standalone, or in conjunction with Prototype/Scriptaculous, jQuery or YUI. I have never used YUI.

Unfortunately, one aspect of Ext which scares me very much is its license, which is either LGPL 3.0 or Commercial. I personally fear the viral impact of LGPL 3.0, and I especially don't like the OEM clause of the aforementioned license page, which states:

If you plan to distribute Ext in a product that will be packaged or sold as a software development library, toolkit or plug-in-based framework (LIBRARY), we require that you work with us to establish a specific license that is appropriate. Use of the open source license in a LIBRARY is not permitted without explicit permission.

If something is open-source, I just want to use it - not worry about whether I'm meeting the vague clauses on some web page, nor do I wish to contact the owners to ask if my use case meets their particular definition of "library". That's why everything I release has a specifically permissive license (see my Clarification on the extent of my licensing terms).

Mootools

One library which has really caught my attention lately is Mootools, which has many of the capabilities of Prototype/Scriptaculous and more. It's also compact, utilizing the "pick features, pick compression type, and download" paradigm which jQuery pioneered. The result is that you can get a very small library with exactly those features that you actually need.

In the case of doing development in Adobe AIR, size doesn't really matter, so I just keep an uncompressed compendium of all features.

dojo

I've never actually used dojo, but I plan to very soon. It appears to have similar capabilities to Ext, but with a distribution and developer friendly license. This is probably because dojo is backed by a foundation rather than an LLC (but that's just wild speculation on my part)

Rico

I used Rico briefly because I needed an accordion effect that Scriptaculous didn't provide. I was researching alternatives when I came across Mootools and subsequently Ext. I ended up using Ext's ContentPanel concept instead.

Conclusions

So in summary, Prototype and Scriptaculous used to be my twin hammers of destruction for all things JavaScript, but right now I'm into Mootools and Ext, probably switching to Mootools and dojo soon. I'm not sure yet how jQuery will factor into my future developments, but it's something to keep an eye on.

What's your favorite JavaScript library? or if you don't have a favorite, which ones do you use?


Got something to say?

Leave a comment

Name (required):

Website:

Comment:

or, read what others have said...