YUI 3 has a preview release for us to analyse out.

The goals are:

  • lighter (less K-weight on the accommodate and on the tender for most uses)
  • faster (fewer http requests, inferior cipher to indite and compile, more economical code)
  • more conformable (common naming, circumstance signatures, and widget APIs throughout the library)
  • more coercive (do more with inferior feat code)
  • more securable (safer and easier to guy to binary developers employed in the aforementioned environment; easier to separate low systems same Caja or ADsafe)

What’s New

  • Sandboxing: Each YUI happening on the tender crapper be self-contained, fortified and restricted (YUI().use()). This segregates it from another YUI instances, tailors the functionality to your limited needs, and lets assorted versions of YUI endeavor nicely together.
  • Modularity: YUI 3 is architected to ingest diminutive modular pieces, gift you fine-grained curb over what functionality you locate on the page. If you exclusive poverty to attain something draggable, you crapper allow the dd-drag submodule, which is a diminutive subset of the Drag & Drop Utility.
  • Self-completing: As daylong as the base YUI cum enter is in place, you crapper attain ingest of some functionality in the library. Tell YUI what modules you poverty to use, bond that to your feat code, and YUI power alter in every needed dependencies in a azygos protocol letter before executing your code.
  • Selectors: Elements are targeted using illogical CSS switch idioms, making it cushy to clutch an surroundings or a assemble of elements whenever you’re performing an operation.
  • Custom Events++: Custom Events are modify more coercive in YUI 3.0, with hold for bubbling, fastening propagation, assigning/preventing choice behaviors, and more. In fact, the Custom Event engine provides a ordinary programme for DOM and API events in YUI 3.0, creating a conformable saying for every kinds of event-driven work.
  • Nodes and NodeLists: Element references in YUI 3.0 are mediated by Node and NodeList facades. Not exclusive does this attain feat cipher more expressive (Y.Node.get("#main ul li").addClass("foo");), it makes it easier to change differences in application activity (Y.Node.get("#promo").setStyle("opacity", .5);).
  • Chaining: We’ve paying tending throughout the newborn structure to the convey values of methods and constructors, allowing for a more shut chaining structure in feat code.

Some warning snippets

JAVASCRIPT:

  1.  
  2. // Creates a YUI happening with the convexity power (and some dependencies) and adds the collection "enabled" to the surroundings with the id of "demo".
  3. YUI().use(‘node’, function(Y) {
  4.     Y.get(‘#demo’).addClass(‘enabled’);
  5. });
  6.  
  7. // Creates an happening of YUI with base inspire functionality (a subset of the dd module), and makes the surroundings with the id of "demo" draggable.
  8. YUI().use(‘dd-drag’, function(Y) {
  9.         var dd = new Y.DD.Drag({
  10.         node: ‘#demo’
  11.     });
  12. });
  13.  
  14. // Adds the collection "enabled" to the every elements with the className "demo".
  15. Y.all(‘.demo’).addClass(‘enabled’);
  16.  
  17. // Sets the denomination concept of every elements with the className "demo" and removes the collection "disabled" from each.
  18. Y.all(‘.demo’).set(‘title’, ‘Ready!’).removeClass(‘disabled’);
  19.  
  20. // Adds the Drag plugin to the surroundings with the id "demo", and enables every of its h2 children inspire as handles.
  21. Y.get(‘#demo’).plug(Y.Plugin.Drag, {
  22.     handles: ‘h2′
  23. });
  24.  
  25. // Attaches a DOM circumstance perceiver to every fix elements that are children of the surroundings with the id "demo". The circumstance trainer prevents the fix from navigating and then sets a continuance for the innerHTML of the prototypal em surroundings of the clicked anchor.
  26. Y.on(‘click’, function(e) {
  27.     e.preventDefault();
  28.     e.target.query(‘em’).set(‘innerHTML’, ‘clicked’);
  29. }, ‘#demo a’);
  30.  

Very elating clog to the team. I countenance nervy to sight a flooded up code intimate too!