README revision 0709cd166604645c5511b892413b44ad6bce6b64
2247N/ABase is designed to be a low level class from which other attribute
2247N/Aand event target based classes in the YUI library can be derived.
2247N/AIt provides a standard template for creating attribute based objects
2247N/Aacross the library and provides a consistent init() and destroy()
2247N/Asequence, by chaining initialization (initializer) and destruction
2247N/A(destructor) methods for the class hierarcy.
2247N/A
2247N/A3.4.0
2247N/A
2247N/A* Base now destroys plugins before destroying itself
2247N/A
2247N/A* Base.create/mix extensions can now define initializer and
2247N/A destructor prototype functions, which will get invoked after
2247N/A the initializer for the host class into which they are mixed and
2247N/A before it's destructor.
2247N/A
2247N/A3.3.0
2247N/A
2247N/A* Fixed Base.mix when used on a class created using Base.create
2247N/A
5306N/A* toString no longer inadvertently stamps the object, however,
2247N/A we now stamp Base objects in the constructor, to support
2247N/A use cases where the "toString" stamping was implicitly being
2247N/A relied upon (e.g. in DD, as hashkeys).
2247N/A
5306N/A3.2.0
2276N/A
2276N/A* Fixed Base.create to properly isolate ATTRS on extensions
2276N/A
2276N/A3.1.1
2276N/A
2276N/A* No changes
5023N/A
2276N/A3.1.0
2276N/A
2247N/A* As the final step in the destroy phase, Base now does a detachAll() to avoid invoking listeners
5306N/A which may be waiting to be in an async. step which occurs after destruction.
2247N/A
2247N/A* "init" and "destroy" events are now published with the defaultTargetOnly property set to true
2247N/A
5306N/A* Added support for MyClass.EVENT_PREFIX to allow developers
3574N/A to define their own event prefix
2899N/A
3817N/A* Made "init" and "destroy" events fireOnce:true (along with
3817N/A "render" in Widget), so that subscriptions made after the
3817N/A events are fired, are notified immediately.
2247N/A
2247N/A* Dynamic and non-dynamically built classes now have their
2247N/A extensions instantiated the same way - during _initHierarchy.
2247N/A
3930N/A* Updated ATTRS handling for Base.build, so that ATTRS are
3930N/A also aggregated at the attribute configuration object level,
3142N/A allowing extensions to add to, or overwrite, attribute
3142N/A configuration properties on the host.
3142N/A
3142N/A* Added sugar Base.create and Base.mix methods on top of
3142N/A Base.build, to simplify the 2 main use cases:
3142N/A
3142N/A 1). Creating a completely new class which uses extensions.
3142N/A 2). Mixing in extensions to an existing class.
4076N/A
4742N/A* Documented non-attribute on, after, bubbleTargets and plugins
5024N/A property support in the Base constructor config argument
3142N/A
3142N/A3.0.0
2247N/A
2247N/A* Fixed hasImpl method on built classes, to look up the class
2247N/A hierarchy for applied extensions.
2247N/A
2247N/A* Plugin.Host removed from base-base module and delivered as it's
3431N/A own module - "pluginhost"
3431N/A
5161N/A* base broken up into..
5161N/A
5161N/A base-base: Provides class hierarchy support for ATTRS and
3431N/A initialization
3431N/A
3431N/A base-build: Provides Extension support in the form of
3431N/A Base.build
2247N/A
3513N/A base-pluginhost: Augments Plugin.Host to Base, adding plugin
2247N/A support
2247N/A
2247N/A3.0.0 beta 1
2247N/A
2247N/A* Config argument for init event now merged into the event facade,
2247N/A instead of being passed separately (available as e.cfg).
2247N/A
4707N/A* Removed Base.create. On review, considered to be overkill.
2247N/A Users can easily create new instances, using Base.build
2588N/A
2247N/A* Moved PluginHost down from Widget to Base, since utils and
2247N/A Node will also support Plugins.
2247N/A
3520N/A* PluginHost.plug and unplug now accept the plugin class as
3260N/A arguments [plug(pluginClass, cfg) and unplug(pluginClass)].
2247N/A
2738N/A* Split base module up into base-base and base-build.
2738N/A
2738N/A* Added lazy attribute initialization support, to improve performance.
2738N/A
2738N/A This also removes order dependency when processing ATTRS for a
2738N/A particular class.
3513N/A
3513N/A If a get/set call is made for an uninitialized attribute A, in the
3513N/A getter/setter/validator or valueFns of another attribute B, A will
2247N/A be intiailized on the fly.
3477N/A
3477N/A* Added ability to subscribe to on/after events through the
3431N/A constructor config object, e.g.:
2247N/A
3431N/A new MyBaseObject({
2247N/A on: {
2247N/A init: handlerFn,
2247N/A myAttrChange: handlerFn
2247N/A },
2247N/A after: {
4337N/A init: handlerFn,
4337N/A myAttrChange: handlerFn
2247N/A },
3817N/A ...
3817N/A
3817N/A });
3817N/A
3817N/A* Developers can now override the default clone behavior we use to
3930N/A isolate default ATTRS config values, using cloneDefaultValue, e.g.:
3817N/A
4941N/A 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.
3.0.0PR1 - Initial release