|
0
|
1 |
3.0.0 beta 1
|
|
|
2 |
|
|
|
3 |
* Config argument for init event now merged into the event facade,
|
|
|
4 |
instead of being passed separately (available as e.cfg).
|
|
|
5 |
|
|
|
6 |
* Removed Base.create. On review, considered to be overkill.
|
|
|
7 |
Users can easily create new instances, using Base.build
|
|
|
8 |
|
|
|
9 |
* Moved PluginHost down from Widget to Base, since utils and
|
|
|
10 |
Node will also support Plugins.
|
|
|
11 |
|
|
|
12 |
* PluginHost.plug and unplug now accept the plugin class as
|
|
|
13 |
arguments [plug(pluginClass, cfg) and unplug(pluginClass)].
|
|
|
14 |
|
|
|
15 |
* Split base module up into base-base and base-build.
|
|
|
16 |
|
|
|
17 |
* Added lazy attribute initialization support, to improve performance.
|
|
|
18 |
|
|
|
19 |
This also removes order dependency when processing ATTRS for a
|
|
|
20 |
particular class.
|
|
|
21 |
|
|
|
22 |
If a get/set call is made for an uninitialized attribute A, in the
|
|
|
23 |
getter/setter/validator or valueFns of another attribute B, A will
|
|
|
24 |
be intiailized on the fly.
|
|
|
25 |
|
|
|
26 |
* Added ability to subscribe to on/after events through the
|
|
|
27 |
constructor config object, e.g.:
|
|
|
28 |
|
|
|
29 |
new MyBaseObject({
|
|
|
30 |
on: {
|
|
|
31 |
init: handlerFn,
|
|
|
32 |
myAttrChange: handlerFn
|
|
|
33 |
},
|
|
|
34 |
after: {
|
|
|
35 |
init: handlerFn,
|
|
|
36 |
myAttrChange: handlerFn
|
|
|
37 |
},
|
|
|
38 |
...
|
|
|
39 |
|
|
|
40 |
});
|
|
|
41 |
|
|
|
42 |
* Developers can now override the default clone behavior we use to
|
|
|
43 |
isolate default ATTRS config values, using cloneDefaultValue, e.g.:
|
|
|
44 |
|
|
|
45 |
ATTRS = {
|
|
|
46 |
myAttr : {
|
|
|
47 |
value: AnObjectOrArrayReference
|
|
|
48 |
cloneDefaultValue: true|false|"deep"|"shallow"
|
|
|
49 |
}
|
|
|
50 |
}
|
|
|
51 |
|
|
|
52 |
If the cloneDefaultValue property is not defined, Base will clone
|
|
|
53 |
any Arrays or Object literals which are used as default values when
|
|
|
54 |
configuring attributes for an instance, so that updates to instance
|
|
|
55 |
values do not modify the default value.
|
|
|
56 |
|
|
|
57 |
This behavior can be over-ridden using the cloneDefaultValue property:
|
|
|
58 |
|
|
|
59 |
true, deep:
|
|
|
60 |
|
|
|
61 |
Use Y.clone to protect the default value.
|
|
|
62 |
|
|
|
63 |
shallow:
|
|
|
64 |
|
|
|
65 |
Use Y.merge, to protect the default value.
|
|
|
66 |
|
|
|
67 |
false:
|
|
|
68 |
|
|
|
69 |
Don't clone Arrays or Object literals. The value is intended
|
|
|
70 |
to be used by reference, for example, when it points to
|
|
|
71 |
a utility object.
|
|
|
72 |
|
|
|
73 |
* Base.plug and Base.unplug used to add static Plugins (default plugins
|
|
|
74 |
for a class). Replaces static PLUGINS array, allowing subclasses to
|
|
|
75 |
easily unplug static plugins added higher up in the hierarchy.
|
|
|
76 |
|
|
|
77 |
* Base adds all attributes lazily. This means attributes don't get
|
|
|
78 |
initialized until the first call to get/set, speeding up construction
|
|
|
79 |
of Base based objects.
|
|
|
80 |
|
|
|
81 |
Attributes which have setters which set some other state in the object,
|
|
|
82 |
can configure the attribute to disable lazy initialization, by setting
|
|
|
83 |
lazyAdd:false as part of their attribute configuration, so that the setter
|
|
|
84 |
gets invoked during construction.
|
|
|
85 |
|
|
|
86 |
3.0.0PR1 - Initial release
|
|
|
87 |
|
|
|
88 |
Module Name: "base"
|
|
|
89 |
Documentation: http://developer.yahoo.com/yui/3/base
|
|
|
90 |
|
|
|
91 |
Base is designed to be a low level class from which other attribute
|
|
|
92 |
and event target based classes in the YUI library can be derived.
|
|
|
93 |
It provides a standard template for creating attribute based objects
|
|
|
94 |
across the library and provides a consistent init() and destroy()
|
|
|
95 |
sequence, by chaining initialization (initializer) and destruction
|
|
|
96 |
(destructor) methods for the class hierarcy.
|