Choosing a JavaScript library
Intro
We need a library to provide common, reusable functionality and save us from writing lots of repetitive code. We do not want to write one ourselves because it saves time to use an existing one, plus these libraries are more likely to contain fewer bugs because of the significant user base.
Javascript Library requirements
- base for client-side restletport
- cross-browser issues:
- syntax
- DOM model
- event model
- dynamic loading of js-files
- event binding
- unit testing
- (widgets, effects)
- integration of external widgets (Simile)
- size, stability, maturity
- compression
- i18n
The contestants
|
|
Latest (non-beta) release |
Size |
the good |
the bad |
Licence |
Browser compatibility |
|---|---|---|---|---|---|---|
| Dojo |
1.0.2 (12/15/07) |
50kb+ |
|
|
modified BSD or Academic Free 2.1 |
Safari 3.0.x |
| Prototype |
1.6.0.2 (01/25/08) |
~120kb |
|
MIT |
IE 6.0+ |
|
|
1.2.2 (01/14/08) |
~26kb |
|
|
MIT or GPL |
FF1.5+ |
|
| Ext JS |
2.0.1 (01/23/08) |
500kb |
|
LGPL 3.0 |
IE 6+ |
|
| Yahoo UI Library
|
2.4.1 (12/19/07) |
29kb+ |
|
|
BSD |
IE 6+ |
| MooTools |
1.1 (05/07/07) |
9kb+ |
|
MIT |
IE 6+ |
|
| qooxdoo |
0.7.3 (01/14/08) |
|
|
LGPL or EPL |
IE 5.5+ |
|
| Rico |
2.0rc (01/29/08) |
|
|
Apache 2.0 |
IE 5.5+ |
|
|
1.4.61 (11/03/07) |
|
|
Apache 2.0 |
IE |
Disqualified:
- MochiKit: seems to be deserted
Popularity (by number of searches)

The other frameworks (qooxdoo, Rico, Ext js) didn't have enough search volume to show up on the graph. The seeming popularity of Prototype is caused by the added searches for the prototype object of JavaScript.
Test 1: GWT
Test 2: Simile
Test 3: i18n support
- Dojo: has a specific i18n module (*).
- jQuery: no built-in i18n support. Localization is available for the datepicker-widget
- Prototype: no built-in i18n support.
- ExtJS: localization support (*, *).
- YUI: no built-in i18n support, there is however an internationalization plugin (*).
- MooTools: no built-in i18n support.
- qooxdoo: i18n and L10n are fully supported (*).
- GWT: internationalization support (*).
Test 4: Unit test
Test 5: Custom widget
The first 4 loosers
- Rico:
- small community
- low support


But for this: "We need a library to provide common, reusable functionality and save us from writing lots of repetitive code..." GWT is really not a contender.
It would be a good fit if your goals were to avoid maintaining any code in dynamically typed languages, or to be able to audit antipatterns with FindBugs, etc, or to leverage existing libraries written in Java that do interesting computations -- and you intend to do the whole thing, or at least large functional chunks, in GWT.