Wednesday, December 5th, 2007

YUI 2.4.0 Released

Category: Announcements, JavaScript, Yahoo!

The YUI library has one of the longest release cycles around but when they put out a release, the team definitely makes it worth it. Yahoo! just released YUI v2.4.0 with a host of new features that will surely please the YUI faithful.

New Selector Engine

In YUI 2.4.0, the Yahoo! team introduces it’s first foray into providing a CSS selector engine, called the Selector Utility. Similar to other libraries such as jQuery and Prototype. the new class adds support for most pseudo-classes, attribute operators, and combinators as defined by the W3C. While most projects have focused on improving performance, the YUI team focused on ensuring str0ng selector support, an approach that definitely makes sense for this initial implementation.

Dustin Diaz has written up his thoughts on the selector engine and shows some examples such as:


  1. var Y = YAHOO.util,
  2.     Select = Y.Selector,
  3.     Dom = Y.Dom;
  4. var collection = Select.query("#example p > span[lang^=us]");
  5. Dom.batch(collection, function(el) {
  6.   // do stuff with 'el'...
  7. });

YUI Charts Control

Getting some assistance from the Yahoo! Flash Platform team, YUI now adds support for charting. The control is a hybrid JavaScript/Flash component that supports bar, line, and pie charts and integrates with the YUI DataSource Utility for pulling data.


When Yahoo! released YSlow, you knew they were serious about application performance and that’s carried over into YUI with the new YUI Profiler.

The new the YUI Profiler allows you to target specific code for profiling and to retrieve profiling data programmatically while your application is running — in any A-Grade browser. In combination with Nicholas’s YUI Test Utility, Profiler allows you to build unit tests in which success or failure is predicated on performance benchmarks.

JSON Utility

Leveraging Douglas Crockford’s JSON parser and stringify functionality, the YUI team created the new JSON Utility which provides improved methods for working with JSON. Tasks such as JSON-to-string and string-to-JSON conversion and validation are now a core part of the library which I’m sure will make many developers very happy.

In addition to these great features, substantial enhancements have been made to the:

  • YUI Calendar Control.
  • YUI Button Class
  • Drag & Drop Utility API
  • YUI Rich Text Editor

A complete overview of the new features and changes Yahoo! just released YUI v2.4.0 can be seen at the YUI Blog.

YUI v2.4.0 is immediately available for download and the full documentation can found here.

Congrats to the YUI team!

Posted by Rey Bango at 6:00 am

3.8 rating from 35 votes


Comments feed TrackBack URI

I hope YUI adds faster ways to get to the good stuff like the new Selector Utility. Being able to use something like $$ instead of YAHOO.util.Selector.query would be a nice change. Pretty much everyone who wants to save time sets up his own vars like Dustin each time.

Comment by Nick — December 5, 2007

Excellent news! There is a lot of good stuff in here.
The CSS Selector is certainly welcome. I thought about using it in the past, but have put it off since there wasn’t a YUI version available. Now that YUI has one, for future projects I’ll certainly try and incorporate it into my way of coding web pages.
I’m actually kind of amazed that the YUI team has included FLASH into the official YU distribution. This is something I really disagree with. Charts, Graphs and Pies are all certainly handy, in fact I use them on my site. The issue I have is there is NO REASON they need to be flash. Canvas is well supported by Firefox, Opera, Safari and the next version of Konqueror. It’s also well supported in IE by the excanvas compatibility code. To officially throw flash into YUI to do something that could be handled by JavaScript/Canvas instead is really confusing to me.

On a side note I appreciate also that dragOnly has been added to the Drag and Drop code. However I already do this behind the scenes on my site and so probably won’t be updating my site to use the new code.

All in all, good things and I’m glad to see the update :)

Comment by Robert Schultz — December 5, 2007

The drag and drop utility has always support “targets” only as well as an alternative approach.

Comment by Dustin Diaz — December 5, 2007

I have never tried to use it ,and i’ll try soon!

Comment by blankyao — December 5, 2007

I think all from YUI are have in jQuery. How about it?
Have YUI some features which haven’t in jQuery (and jQuery plugins)?

Comment by YouNeedJava — December 6, 2007

Leave a comment

You must be logged in to post a comment.