Published 2007-03-25 10:08:51

My last post about Javascript toolkits garnered a few comments, which seems to be rare for most of my blog posts... (I must be getting too old..or the spam protection works to well). There where quite a few suggestions for alternatives to dojo, along with a not too complimentary comment about dojo's development status.

As luck had it, I started a new project Last week, a contact manager for one of my clients, and rather than carry on with dojo, that had begun to annoy me a little, with little bugs (for example , the Accordion was broken), or just weird stuff, like getting forms on dialogs to look just right. I thought that it would be a good opportunity to review some of the other toolkit's mentioned on the post.

The extended Entry contains reviews of jQuery and yui-ext (and see which is now the prefered library)

jQuery

jquery home page

This was mentioned very quickly, by a couple of people, and was the first one I investigated. From what I understood, the core of jQuery, is basically a document.getElementById() on drugs.., the result you get back from jQuery('object_id') from my understanding is the DOM object + all of jQuery's prototype methods bolted on. This is not a bad Idea, but What really annoyed me about jQuery, again it's one of those small issues. Is they aliased the $ sign to jQuery. Decisions like that tend to make you want to run screaming or line up the original developers and wack them with a big clue stick.. - It just smells like the _() farce in PHP.. (10 points to who knows what that does without looking in the manual)

I resisted the temptation to leave it there, (as crazy ideas like $ aliasing tend to be a good warning sign) and looked a bit deeper at jQuery. What makes jQuery a little different from the other toolkit's is that the Widget library / add on stuff, are provided seperately, so if you want a dialog, you have to look at one of two packages that can be downloaded separately. Again with tree widgets etc. While it seems like a good idea, has ended up with something worse than the original CPAN model (yes I've heard that's changed now). In that any old code is linked on the packages page, and no coding standards appear to have been applied. Let alone any consistent CSS set that would work across applications. At least some of the add-on developers resisted the temptation to use the $ alias...

The sense I got was if you want to add a few dynamic bit's to your website, and want to get up and going quickly the jQuery may be quite suitable. But building a full on application out of the disparate collection of parts may lead you to hacking and re-writing alot of the libraries yourself.

Yui-Ext

yui-ext homepage (Jack Slocum's Blog)
yui-ext documentation - for 1.0 alpha 3
Forum page with download info.

As one person mentioned, they are keeping an eye on the Yahoo Interface Library, but as I noted before, what put me off originally was seeing all the Javascript code that was needed to create anything. I'm a great believer in KISS, for Javascript Addon's and if it involves more that One line of Javascript to generate the interface, it's probably one line too many. (This however should be seen in context , that this part was quite simple to fix..)

At the end of the last post some-one mentioned yui-ext, It's difficult to get a sense of how yui-ext started, from the looks of things, it was by just adding a few widget's or altering existing widgets from YUI. But as things went along, it looks like rewriting most of YUI became necessary. For the contact application I used the yui-ext 1.0 beta 3 release, which for the most part worked nicely.

From what I can see the key advantages to YUI-EXT (or as it refers to itself as - Ext.) over YUI.

  • Cleaner code
  • Cleaner documentation
  •  You dont have to advertise YAHOO in all your code..!!
  •  A reasonable set of CSS is provided for the widgets. (unlike the rather odd looking stuff that is default on the YUI project pages.)
  • Layout Code - taking over the full page layout hence less messing around with your own HTML/CSS
  • Form library, and more elegant Message and Dialog library
  • The code is reasonably bug free, if it's used normally.

While for the most part using yui-ext is productive, a number of things do cause alot of trouble.

  • Layout code, can be very temperamental. Getting the options correct, to prevent scrolling in the wrong place, or toolbars to appear correctly can be very problematic.  
  • Writing so much code for things like buttons is tedious, and pointless (although most of this can be solved, but writing Helper libraries, that autobuild)
  • Drag and drop code is a little incomplete at present, It took some considerable digging and research to make a grid row drag into a tree. (eg. writing to classes that extend existing code, but once working, it's pretty damn cool)
  •  Creating and rendering is occasionally temperamental - an exception occurs inside the compressed yui-ext.js file, indicating that something has not been created yet, however is expected to exist. 
  • Forms on dialogs on firefox are broken - (The carat does not show) ** this can be fixed by this little CSS addition:
    .x-dlg {
     position: fixed;
     position:expression("absolute");
    }

In the end what is feasible with yui-ext is XUL quality interfaces with good ole HTML.  In addition, the on-page dialogs, enable a much faster interface, than the popups that XUL required.

To make it feasible however you need to write a ExtHelper library. The one I cobbled together basically parses the DOM of specified elemnts, and uses attributes to create the yui-ext objects - typically, this involves converting Forms, and setting up allowEmpty: false.. or automatically converting a HTML table with <caption><button*> into a grid with a toolbar.. With this, you can become quite productive with yui-ext, and most of the javascript code deals with interaction, and sending data back/forth to the server rather than huge wadges of interface creation code.

Mentioned By:
www.planet-php.net : Planet PHP (67 referals)
google.com : april (63 referals)
swik.net : Javascript Tookits Part Two: Review of jQuery and Yui-Ext 1.0 - SWiK (61 referals)
google.com : march (24 referals)
google.com : december (19 referals)
ma.gnolia.com : DragonI's Bookmarks Tagged With "javascript.framework" (6 referals)
del.icio.us : DragonI's bookmarks tagged with &quot;javascript.framework&quot; on del.icio.us (5 referals)
del.icio.us : Pages tagged with &quot;YUI-Ext&quot; on del.icio.us (5 referals)
ma.gnolia.com : "yui-ext" in DragonI's Tags on Ma.gnolia (4 referals)
www.phpeye.com : PHPEye.com | Zend Framework|PHP教程|PHP新闻|PHP5|PEAR|PHP框架|PHPEye - Powered by HappyCMS (3 referals)
www.megite.com : Discover From Your Favorite Topic or Web Page: dr-hamza.net/codeigniter-simplicity-speed-usabilit (3 referals)
swik.net : Javascript Tookits Part Two - SWiK (3 referals)
planet.debian.org.hk : Planet DebianHK (3 referals)
planet.debian.org.hk : Planet DebianHK | Debian HK (3 referals)
google.com : november (3 referals)
www.tailrank.com : Javascript Tookits Part Two (2 referals)
www.megite.com : Discover From Your Favorite Topic or Web Page: www.akbkhome.com/blog.php (2 referals)
www.debian.org.hk : 資訊聯播 | Debian HK (2 referals)
google.com : tookits (2 referals)
del.icio.us : DragonI's bookmarks tagged with &quot;yui-ext&quot; on del.icio.us (2 referals)

Add Your Comment

Follow us on