YUI 3.0 – Changes From the Root
If you are web developer you may have noticed that the latest version of Yahoo’s User Interface toolset and widgets (for web development), YUI 3.0, is now available as a preview release. YUI has long been a popular “Ajax” library both because of its liberal BSD license, and because of the number of features it provides.
The big news about YUI the third are that it changes from the root and (unfortunately) is not compatible with YUI 2.x APIs as Eric and Matt stated on developer blog.
YUI 3.0 builds off of the YUI 2.x codeline, but we’ve evolved most of the core APIs in working toward the five key goals described above. As a result, migrating from YUI 2.x to 3.x will require effort at the implementation level.
However, YUI 3.0 will ship with a limited compatibility layer for the current YUI Core that will allow you to run some of your YUI 2.x-based implementations (Yahoo Global Object, Dom Collection, and Event Utility) on top of YUI 3.0.
These radical changes are toward 5 goals:
- Lighter (less K-weight on the wire and on the page for most uses)
- faster (fewer http requests, less code to write and compile, more efficient code)
- more consistent (common naming, event signatures, and widget APIs throughout the library)
- more powerful (do more with less implementation code)
- more securable (safer and easier to expose to multiple developers working in the same environment; easier to run under systems like Caja or ADsafe)
So, what’s new in YUI 3.0? Many things, both large and small like:
- Intelligent loading. YUI detect which modules it needs to load, and then download them from a server — it will also join the modules’ JavaScript source files together, in order to optimize download time.
- Change to a “YUI” namespace instead of “Yahoo” namespace in YUI 2.x branches.
- Combine DOM events with custom events, making it possible to work with all events in a unified way.
- Borrow “selectors” idea from JQuery to allow finding and working with nodes on an individual and group basis.
- Chaining - another JQuery’s idea that makes it possible to write more compressed chaining syntax in implementation code.
Now you can jump into examples to see the lib in action, especially the nice “Portal Drag” example created by Dav Glass which loads only 8 KB JavaScript files (after gzipped) at first.
Hope I’ll have time to create examples to show YUI 3.0 functionality in practice.


