YUILibrary - Open source JavaScript and CSS for building richly interactive software.
Fork YUI on GitHub

YUI 2.x

YUI 3.0.0 beta 1 README Digest

This document is a summary of the YUI 3.0.0 beta 1 update information that has been added to the respective README files included within each component folder. Please refer the README files for the components you are using for a full change history of each component.

  • Animation
    • No changes
  • Attribute
    • Enhancements / Changes
      • Removed Attribute.CLONE support in the interests of simplicity. Was not being used. Can re-evaluate support if real world demand for it exists.
      • Changed "set" and "get" configuration properties for setter and getter methods to "setter" and "getter" respectively.
      • Added support for setter to return Attribute.INVALID_VALUE to prevent attribute state from being changed. This allows developers to combine setter and validator functionality into one method if performance optimization is required.
      • "validator" is now invoked before "setter".
      • Renamed xxxAtt and xxxAtts methods to xxxAttr, xxxAttrs for consistency.
      • "after" listeners are only notified if attribute value really changes (preVal !== newVal).
      • Extending classes can now overwrite ATTRS configuration properties from super classes, including writeOnce and readOnly attributes. The ATTRS configurations are merged across the class hierarchy, before they are used to initialize the attributes.
      • addAttr now prevents re-adding attributes which are already configured in order to maintain consistent state.
      • Event prefix wrapper functions (on, after etc.) removed. Event.Target now accepts an event prefix configuration value
      • Added additional log messages to assist with debugging.
      • Attribute change events are no longer fired for initial set.
      • Split up State add/get/remove into add/addAll, get/getAll, remove/removeAll to avoid having to create object literals for critical path [ add/get single key values ].
      • Attribute getter, setter, validator now also receive attribute name as the 2nd arg (val, name).
      • If Attributes initialized through addAttrs have a user provided value which is not valid, the initial attribute value will revert to the default value in the attribute configuration, if it exists.
      • reset() no longer resets readOnly or writeOnce attributes. Only publically settable values are reset.
      • Added modifyAttr method, to allow component developer to modify configuration of an attribute which has already been added. The set of attribute configuration properties which can be modified after it has been added are limited to getter, readOnly, writeOnce and broadcast.
      • Added support for lazy attribute configuration. Base uses this feature to lazily intialize all Attributes on the first call to get/set, for performance optimization. lazyAdd:true/false can be used to over-ride this behavior for a particular attribute.
  • Base
    • Config argument for init event now merged into the event facade, instead of being passed separately (available as e.cfg).
      • Removed Base.create. On review, considered to be overkill. Users can easily create new instances, using Base.build
      • Moved PluginHost down from Widget to Base, since utils and Node will also support Plugins.
      • PluginHost.plug and unplug now accept the plugin class as arguments [plug(pluginClass, cfg) and unplug(pluginClass)].
      • Split base module up into base-base and base-build.
      • Added lazy attribute initialization support, to improve performance. This also removes order dependency when processing ATTRS for a particular class. If a get/set call is made for an uninitialized attribute A, in the getter/setter/validator or valueFns of another attribute B, A will be intiailized on the fly.
      • Added ability to subscribe to on/after events through the constructor config object, e.g.:



new MyBaseObject({
on: {
init: handlerFn,
myAttrChange: handlerFn
},
after: {
init: handlerFn,
myAttrChange: handlerFn
},
...

});

  • Developers can now override the default clone behavior we use to isolate default ATTRS config values, using cloneDefaultValue, e.g.:


ATTRS = {
myAttr : {
value: AnObjectOrArrayReference
cloneDefaultValue: true|false|"deep"|"shallow"
}
}

If the cloneDefaultValue property is not defined, Base will clone any Arrays or Object literals which are used as default values when configuring attributes for an instance, so that updates to instance values do not modify the default value.

This behavior can be over-ridden using the cloneDefaultValue property:

true, deep:
Use Y.clone to protect the default value.

shallow:
Use Y.merge, to protect the default value.

false:
Don't clone Arrays or Object literals.
The value is intended to be used by reference, for example,
when it points to a utility object.

  • Base.plug and Base.unplug used to add static Plugins (default plugins for a class). Replaces static PLUGINS array, allowing subclasses to easily unplug static plugins added higher up in the hierarchy.
  • Base adds all attributes lazily. This means attributes don't get initialized until the first call to get/set, speeding up construction of Base based objects. Attributes which have setters which set some other state in the object, can configure the attribute to disable lazy initialization, by setting lazyAdd:false as part of their attribute configuration, so that the setter gets invoked during construction.
  • Cache
    • Initial release
  • ClassNameManager
    • Enhancements / Changes
      • Now uses Y.cached
      • All white space is stripped from incoming arguments
  • Cache
    • No changes
  • Console
    • Enhancements / Changes
      • logSource attribute added to configure listening for events from a specific target. Also useful for subscribing to all log events across multiple YUI instances.
      • Lowered consoleLimit default to 300
      • printLimit attribute added to limit the number of entries from the buffer to output in a given printBuffer call
      • printBuffer(max) argument added to limit the number of entries to print in this cycle
      • Changed from setTimeout to setInterval to chunk DOM output
      • logLevel constants changed to strings and categories outside info, warn, and error are not treated as info
      • CSS updates
      • Support for height and width attribute configuration
      • Changed <input type="button"> to <button type="button">
      • Added Collapse/Expand
      • Entry addition and removal now occurs off DOM
      • Entry removal checks that the target node is present before removing it
    • Bug Fixes
      • Y.config.debug explicitly set to false during print cycle to avoid infinite loops
  • Console-Filters
    • Initial release
  • Cookie
    • Enhancements / Changes
      • Synchronized with 2.x version of cookie:
      • Changes formatting of date from toGMTString() to toUTCString() (#2527892).
      • Updated remove() so that it no longer modifies the options object that is passed in (#2527838).
      • Changed behavior for Boolean cookies (those that don't contain an equals sign). Previously, calling Cookie.get() on a Boolean cookie would return the name of the cookie. Now, it returns an empty string. This is necessary because IE doesn't store an equals sign when the cookie value is empty ("info=" becomes just "info").
      • Added Cookie.exists() to allow for easier Boolean cookie detection.
      • Removed check for cookie value before parsing. Previously, parsing checked for name=value, now it parses anything that is passed in.
      • Removing the last subcookie with removeSub() now removes the cookie if the removeIfEmpty option is set to true (#2527954)
      • Added option to disable url encoding/decoding by passing options.raw to set() and get() (#2527953).
      • Changed get() to take an options object with raw and converter properties, if a function is passed instead of an object then it is used as the converter for backward compatibility (#2527953).
  • CSS Base
    • No changes
  • CSS Fonts
    • No changes
  • CSS Grids
    • Deprecated for YUI 3.x
  • CSS Reset
    • No changes
  • DataSchema
    • Initial release
  • DataSource
    • Initial release
  • DataType
    • Initial release
  • Drag & Drop
    • Enhancements / Changes
      • Converted Everything to use setXY now that FF2 is not supported.
      • Performance tweaks to dragging over a target.
      • Added a plugin to support Window and Node based scrolling


var dd = new Y.DD.Drag({
node: '#drag'
}).plug(Y.plugin.DDWinScroll);

var dd = new Y.DD.Drag({
node: '#drag'
}).plug(Y.plugin.DDNodeScroll, {
node: '#some-parent-with-scroll'
});

  • Proxy and Constrained were moved to the plugin modal, there are some syntax changes:


PR2 - Proxy:
var dd = new Y.DD.Drag({
node: '#drag',
proxy: true,
moveOnEnd: false
});

Current - Proxy:
var dd = new Y.DD.Drag({
node: '#drag'
}).plug(Y.plugin.DDProxy, {
moveOnEnd: false
});

PR2 - Constrained:
var dd = new Y.DD.Drag({
node: '#drag',
constrain2node: '#wrap'
});

Current - Constrained:
var dd = new Y.DD.Drag({
node: '#drag'
}).plug(Y.plugin.DDConstrained, {
constrain2node: '#wrap'
});

  • DOM
    • Enhancements / Changes
      • Selector CSS3 support broken out as optional addon ('selector-css3')
      • Selector now leverages native querySelector
      • Selector now leverages native getElementsByClassName
  • Dump
    • Enhancements / Changes
      • Added /regexp/ formatting
  • Event
    • Enhancements / Changes
      • DOM event, custom event, and simulate event moved to separate modules.
      • Added an event for DOM event delegation. It only fires it the target or its descendants match a supplied selector.
        • Y.on('delegate', fn, el, 'click', 'selector' ...
        • The event facade sets the following properties:
          • target: the target of the event
          • currentTarget: the element that the selector matched
          • container: the bound element (the delegation container)
      • Added mouseenter/mouseleave events
        • Y.on('mouseenter', fn, el, 'click', 'selector' ...
        • Y.on('mouseleave', fn, el, 'click', 'selector' ...
      • Added Y.on('windowresize', fn), which attempts to normalize when the event fires across all browsers (once at the end of the resize rather than continuously during the resize).
      • Added ability to skip facade creation where performance is a concern.
      • Moved DOMReady core to yui-base.
      • purgeElement only reads element guids, it does not create new ones for elements without one.
      • Event.attach returns a single handle if the result from collection processing is a single item.
    • Bug Fixes
      • Fixed unsubscribeAll return value.
      • Focus/blur abstraction works in Opera when the bound element is the target
  • Event-Custom
    • Enhancements / Changes
      • Implemented the broadcast flag. broadcast = 1: local, accessible via Y.on('prefix:event'). broadcast = 2: global, accessible via Y.on or globally via Y.Global.on('prefix:event). Broadcast listeners cannot effect the defaultFn or host subscribers (s0 are in effect, after listeners), although this is still possible by added either Y or Y.Global as event targets.
      • Moved custom event out of event package
      • EventTarget accepts a prefix configuration. This is used in all exposed methods to handle shortcuts to event names e.g., 'click' and 'menu:click' are the same if the prefix is 'menu'
      • Exposed methods are 'on' for the before moment, 'after' for the after moment, and 'detach' for unsubscribe. subscribe, before, unsubscribe, and corresponding methods are deprecated.
      • Event type accepts a event category which can be used to detach events.
        • Y.on('category|prefix:event', fn);
        • Y.detach('category|prefix:event');
        • Y.detach('category|*');
      • Added 'chain' config to events that makes the return value the event target rather than a detach handle. Use with the detach category prefix.
      • The type parameter can be an object containing multiple events to attach
        • Y.on( { 'event1': fn1, 'event2': fn2 }
      • Y.fire payload for event facades can be another facade or a custom event.
  • Event-Simulate
    • Enhancements / Changes
      • Moved out of event module.
      • References to document changed to Y.config.doc.
      • Removed methods on Y.Event in favor of just simulate().
      • simulate() now throws an error if the event isn't supported (#2527823).
  • History
    • Initial release
  • ImageLoader
    • Enhancements / Changes
      • 3.0 conversion
      • New features:
        • Fold groups indicated by a distance from the fold, and images are loaded in cascading fashion as each reaches that distance. Scroll and resize triggers are set automatically for these groups
        • Custom triggers can belong to the global Y instance or to any local event target
        • Bg, Src, and Png images are all registered with groups via the same "registerImage" method, and differentiated by attribute parameters
  • IO
    • Enhancements / Changes
      • The io-queue sub-module now implements YUI Queue. The io queue interface allows transaction callback handlers to be processed in the order the transactions were sent, regardless of actual server response order. For example:
        • io queue is used to make three requests.
        • The actual server response order happens to be: transaction 2, 1, 3.
        • However, using the queue interface, the transaction callbacks are processed in the order of: transaction 1, 2, 3.
      • All transaction event flows now resolves to "success" or "failure"; the abort event was removed. Transaction abort and timeout conditions resolve to "failure", and is distinguishable in the response data. Specifically, the response object's status and statusText properties will be populated as:
        • response.status will be 0.
        • response.statusText will be set to "timeout" or "abort" to differentiate the two possible conditions.
      • A new "end" event is introduced in the transaction event flow; this is the terminal event for all transactions. Its event handler signature is the same as the "start" event, receiving the transaction id and user-defined arguments.
        • The global event name is "io:end".
        • To subscribe to the transaction event, define the "end" property in the transaction's configuration object.


{ on: { end: function() { } } }

  • JSON
    • Enhancements / Changes
      • Leverages native JSON.parse if available
      • Stringify API change. Third argument changed from depth control to indent (Per the ECMA 5 spec)
      • Stringify now throws an Error if the object has cyclical references (Per the ECMA 5 spec)
      • restructured stringify to leverage Y.Lang.type
  • Node
    • Enhancements / Changes
      • Node and NodeList broken into separate classes
      • NodeList no longer contains DOM related methods (appendChild, removeChild, contains, etc.)
      • Node no longer contains NodeList methods (size, each, filter, etc.)
      • Node extends Base
      • set() fires attribute change events
      • zero length NodeLists now return an empty NodeList rather than null
      • added insert, prepend, append, setContent methods
  • Node-FocusManager
    • Initial release
  • Node-MenuNav
    • Enhancements / Changes
      • Now lives on the "Plugin" namespace, as opposed to the "plugin" namespace
      • Now requires the Focus Manager Node Plugin (Y.Plugin.NodeFocusManager)
      • Now extends Y.Base
  • OOP
    • Enhancements / Changes
      • bind() now adds the arguments supplied to bind before the arguments supplied when the function is executed. Added rbind to provide the old functionality (arguments supplied to bind are appended to the arguments collection supplied to the function when executed).
      • bind() supports a string representing a function on the context object in order to allow overriding methods on superclasses that are bound to a function displaced by aop.
    • Bug Fixes
      • Fixed array handling in clone'
  • Overlay
    • No changes
  • Plugin
    • Enhancements / Changes
      • Moved Y.Plugin to Y.Plugin.Base
      • Host/Owner object now available through public "host" attribute, as opposed to protected _owner property (this.get("host"))
  • Profiler
    • Enhancements / Changes
      • Changed profiler so that unregistering a function/object no longer deletes all recorded data.
      • Added clear() method to remove profiler data.
      • Added instrument() method to profile anonymous functions.
      • Added getReport() method and deprecated getFunctionReport().
      • Added getOriginal() method to retrieve uninstrumented versions of functions.
      • Implemented stopwatch functionality.
  • Queue
    • Enhancements / Changes
      • Overhaul. Broken into queue-base, queue-promote, and queue-run. See the user guide and API docs for more detail.
  • Slider
    • Enhancements / Changes
      • Renamed the valueSet custom event to positionThumb and rejiggered the logic of the default function and support methods.
      • Renamed _defSyncUI to _defSyncFn for library nomenclature consistency
      • Added protected _convertValueToOffset to help position the thumb
      • Set bubble: false on the DD.Drag instance
      • Created a ConsoleFilters plugin to restore the filter checkboxes familiar to yui2 users. myConsole.plug(Y.Plugin.ConsoleFilters);
      • Added collapse/expand button to header and changed input[type=button]s to button elements
      • silence the logging subsystem during the print cycle
      • major markup and skin css overhaul
      • added support for setting height and width in configuration
      • logLevel filtering now only applies to messages with info|warn|error. All other messages pass through.
      • static Console.LOG_LEVEL_INFO etc are now strings
      • added logSource attribute to support a single Console instance listening to all YUI instance log statements { logSource: Y.Global }
      • added destructor
      • Renamed _timeout to _printLoop and _clearTimeout to _cancelPrintLoop
      • refactored printLogEntry to call new _createEntry(meta). _addToConsole subsumed into printLogEntry. _createEntry returns an HTML string.
      • print loop scheduled on render to display any previously buffered entries
      • print loop only scheduled if the Console has been rendered
      • entries added to Console via DocumentFragment and Node instance creation avoided for performance
      • buffer is spliced at the beginning of a print loop to limit entries that would be removed by consoleLimit anyway
  • StyleSheet
    • Initial release
  • Substitute
    • No changes
  • Test
    • Enhancements / Changes
      • Changed component name to "test" from "yuitest".
      • Removed dependencies on Y.Object.owns().
      • Renamed Y.ObjectAssert.has() to Y.ObjectAssert.hasKey() to better match Y.Object.hasKey().
      • Removed Y.ObjectAssert.hasAll() and replaced with Y.ObjectAssert.hasKeys() to better match Y.Object.hasKey().
      • Renamed Y.ObjectAssert.owns() to Y.ObjectAssert.ownsKey() to better match Y.Object.hasKey().
      • Removed Y.ObjectAssert.ownsAll() and replaced with Y.ObjectAssert.ownsKeys() to better match Y.Object.hasKey().
      • Added unit tests for mock and object asserts.
      • Added Y.assert() and Y.fail().
      • Added Y.ObjectAssert.ownsNoKeys() (#2527849).
      • Added proper XML escaping to Y.Test.Format.XML.
    • Bug Fixes
      • Fixed bug in Y.Mock.Value() where omitting second argument caused an error.
      • Fixed this._form is undefined error in TestReporter (#2527928).
      • Fixed bug in Y.Mock.Value() that resulting in multiple calls to the same verification to include old information.
      • Fixed bug in mock objects where a mock method called asynchronously (via timeout or XHR callback) could throw an error up to the browser and cause the test to incorrectly be marked as passing.
  • Widget
    • Enhancements / Changes
      • PluginHost moved down to Base.
      • Render event args added to event facade instead of being passed across separately (e.parentNode).
      • "hasFocus" attribute renamed to "focused"
      • "focused" attribute is read only
      • "focused" attribute is set via:
        • user interaction
        • the "focus" and "blur" methods
      • Only one DOM focus event handler is used now (two for WebKit) and it is bound to the widget's ownerDocument. This allows modal widgets to maintain a reference to the element in the document that previously had focus and to be able to restore that focus when the modal widget is hidden.
      • "tabIndex" attribute was updated
        • accepts a number or null
        • more documentation
  • Widget-position
    • No changes
  • Widget-position-ext
    • No changes
  • Widget-stack
    • No changes
  • Widget-stdmod
    • No changes
  • YUI
    • Enhancements / Changes
      • Core:
        • Y.fail has been renamed to Y.error so that Y.fail can be used for the assertion engine.
        • Y.stamp now accepts a readOnly parameter to be used when you are only interested in reading an existing guid rather than creating a new one.
        • Y.stamp defends against stamping items that can't be stamped.
        • Added to Object: values(), hasKey(), hasValue(), size(), getValue, setValue (the latter are for manipulating nested values)
        • Y.use calls are queued during dynamic loading.
        • Added Y.cached for function memoizing
        • added numericSort to Array
        • The yui:log event broadcasts globally.
      • Lang:
        • Added Lang.type (typeof abstraction), and refactored some 'is' methods to use it.
      • Get:
        • Accepts an attribute collection config to apply to inserted nodes.
        • id attributes are globally unique
        • Now accepts purgethreshold as a config option. This will set the number of transactions required before auto removing nodes from previous transactions (default is 20)
      • Loader:
        • yuitest renamed to test, now requires collection
        • lots of new module metadata
        • added onCSS
        • Loader requests are queued globally
        • Accepts jsAttributes and cssAttributes configs for adding attributes to inserted nodes
        • The force config
      • UA:
        • Added 'secure' property for SSL detection
        • Added 'os' property for windows vs mac detection
        • Added Adobe Air and Google Caja detection