|
525
|
1 |
Attribute Change History |
|
|
2 |
======================== |
|
|
3 |
|
|
|
4 |
3.10.3 |
|
|
5 |
------ |
|
|
6 |
|
|
|
7 |
* No changes. |
|
|
8 |
|
|
|
9 |
3.10.2 |
|
|
10 |
------ |
|
|
11 |
|
|
|
12 |
* opts now passed to setter correctly, when using AttributeObservable. |
|
|
13 |
|
|
|
14 |
This feature was added in 3.8.1 (below), but didn't work for |
|
|
15 |
AttributeObservable. |
|
|
16 |
|
|
|
17 |
3.10.1 |
|
|
18 |
------ |
|
|
19 |
|
|
|
20 |
* No changes. |
|
|
21 |
|
|
|
22 |
3.10.0 |
|
|
23 |
------ |
|
|
24 |
|
|
|
25 |
* Significant performance improvements in common Attribute operations. |
|
|
26 |
|
|
|
27 |
For example, on Chrome: |
|
|
28 |
|
|
|
29 |
`get()` is 4 times faster |
|
|
30 |
`set()` is 3 times faster |
|
|
31 |
|
|
|
32 |
Major performance related changes are listed below. |
|
|
33 |
|
|
|
34 |
Commit messages have detailed descriptions of incremental changes, and the |
|
|
35 |
benefits introduced. |
|
|
36 |
|
|
|
37 |
* We retrieve and pass the internally stored attribute configuration in State |
|
|
38 |
by reference in a lot more places, across methods, results in less function |
|
|
39 |
hops, and removing the need for each method to go and ask for the configuration. |
|
|
40 |
|
|
|
41 |
* Avoid the delete operator for transient configuration properties, and just set |
|
|
42 |
to null or other falsey values as appropriate. |
|
|
43 |
|
|
|
44 |
* Store final attribute config in State by reference, as opposed to merging |
|
|
45 |
since it's isolated already higher up in the call stack. |
|
|
46 |
|
|
|
47 |
3.9.1 |
|
|
48 |
----- |
|
|
49 |
|
|
|
50 |
* No changes. |
|
|
51 |
|
|
|
52 |
3.9.0 |
|
|
53 |
----- |
|
|
54 |
|
|
|
55 |
* No changes. |
|
|
56 |
|
|
|
57 |
3.8.1 |
|
|
58 |
----- |
|
|
59 |
|
|
|
60 |
* Invalid values supplied during Attribute initialization that fail setter |
|
|
61 |
validation will now fallback the default value defined in `ATTRS`. |
|
|
62 |
[Ticket #2528732] [redbat] |
|
|
63 |
|
|
|
64 |
* Attribute validators and setters now receive set's `options` argument. This is |
|
|
65 |
now a part of `AttributeCore`. [Ticket #2532810] [Satyam] |
|
|
66 |
|
|
|
67 |
3.8.0 |
|
|
68 |
----- |
|
|
69 |
|
|
|
70 |
* [!] The `AttributeEvents` class extension and the `attribute-events` module |
|
|
71 |
have been renamed to `AttributeObservable` and `attribute-observable` |
|
|
72 |
respectively. The old names are deprecated, but have been retained as aliases |
|
|
73 |
for backwards compatibility. They will be removed in a future version of YUI. |
|
|
74 |
|
|
|
75 |
* [!] The `AttributeComplex` class extension and the `attribute-complex` module |
|
|
76 |
have been deprecated. This functionality is now part of `AttributeCore`, and |
|
|
77 |
this extension and module are no longer needed. |
|
|
78 |
|
|
|
79 |
* Moved AttributeCore's protected `_protectAttrs()` utility method to a public |
|
|
80 |
static method, `protectAttrs()`, which is available on both `Y.Attribute` and |
|
|
81 |
`Y.AttributeCore` namespaces. |
|
|
82 |
|
|
|
83 |
3.7.3 |
|
|
84 |
----- |
|
|
85 |
|
|
|
86 |
* No changes. |
|
|
87 |
|
|
|
88 |
3.7.2 |
|
|
89 |
----- |
|
|
90 |
|
|
|
91 |
* No changes. |
|
|
92 |
|
|
|
93 |
3.7.1 |
|
|
94 |
----- |
|
|
95 |
|
|
|
96 |
* No changes. |
|
|
97 |
|
|
|
98 |
3.7.0 |
|
|
99 |
----- |
|
|
100 |
|
|
|
101 |
* Removed unused call to `get` in `getAttrs()`, improving `getAttrs()` |
|
|
102 |
performance. [Ryan Grove] |
|
|
103 |
|
|
|
104 |
3.6.0 |
|
|
105 |
----- |
|
|
106 |
|
|
|
107 |
* Optimized valueFn handling, so that valueFn is not called for Attribute, |
|
|
108 |
if user provides a value. |
|
|
109 |
|
|
|
110 |
* Support opts argument for setAttrs() also. Passed through to set, and ends up |
|
|
111 |
mixed into the event payload for all the attributes set through setAttrs() |
|
|
112 |
|
|
|
113 |
3.5.1 |
|
|
114 |
----- |
|
|
115 |
|
|
|
116 |
* No changes. |
|
|
117 |
|
|
|
118 |
3.5.0 |
|
|
119 |
----- |
|
|
120 |
|
|
|
121 |
* Broke Y.Attribute up into: |
|
|
122 |
|
|
|
123 |
- Y.AttributeCore |
|
|
124 |
- Y.AttributeEvents |
|
|
125 |
- Y.AttributeExtras |
|
|
126 |
|
|
|
127 |
To support core Attribute usage, without Events, but still allow upgrade |
|
|
128 |
path to add Events, if required. |
|
|
129 |
|
|
|
130 |
Y.AttributeCore is likely to form the basis for BaseCore and WidgetCore |
|
|
131 |
(ala Node Plugins, where low-level state change events are not required). |
|
|
132 |
|
|
|
133 |
Y.Attribute's public and protected API reimain unchanged, and loader will |
|
|
134 |
pull in the new dependencies. |
|
|
135 |
|
|
|
136 |
However if you're manually pulling in attribute-base, you'll need to |
|
|
137 |
manually pull in attribute-core, attribute-events and attribute-extras |
|
|
138 |
before it. |
|
|
139 |
|
|
|
140 |
Summary: |
|
|
141 |
|
|
|
142 |
Y.Attribute - Common Attribute Functionality (100% backwards compat) |
|
|
143 |
Y.AttributeCore - Lightest Attribute support, without CustomEvents |
|
|
144 |
|
|
|
145 |
-- |
|
|
146 |
|
|
|
147 |
Y.AttributeEvents - Augmentable Attribute Events support |
|
|
148 |
Y.AttributeExtras - Augmentable 20% usage for Attribute (modifyAttr, removeAttr, reset ...) |
|
|
149 |
Y.AttributeComplex - Augmentable support for constructor complex attribute parsing ({"x.y":foo}) |
|
|
150 |
|
|
|
151 |
-- |
|
|
152 |
|
|
|
153 |
Y.Attribute = Y.AttributeCore + Y.AttributeEvents + Y.AttributeExtras |
|
|
154 |
|
|
|
155 |
-- |
|
|
156 |
|
|
|
157 |
Modules: |
|
|
158 |
|
|
|
159 |
"attribute-base" : Y.Attribute |
|
|
160 |
"attribute-core" : Y.AttributeCore |
|
|
161 |
|
|
|
162 |
"attribute-complex" : Y.AttributeComplex mixin (mixed into Y.Attribute) |
|
|
163 |
"attribute-events" : Y.AttributeEvents mixin |
|
|
164 |
"attribute-extras" : Y.AttributeExtras mixin |
|
|
165 |
|
|
|
166 |
* Changed State's internal data structure, to store pairs by |
|
|
167 |
[name][property], instead of [property][name] to improve performance |
|
|
168 |
(most Attribute operations are name centric, not property centric). |
|
|
169 |
|
|
|
170 |
If you're working directly with Attribute's private _state.data, you |
|
|
171 |
may need to update your code to account for the change in structure. |
|
|
172 |
|
|
|
173 |
* Attribute now passes the attribute name to valueFn, allowing users to |
|
|
174 |
write shared valueFn impls across attributes. |
|
|
175 |
|
|
|
176 |
3.4.1 |
|
|
177 |
----- |
|
|
178 |
|
|
|
179 |
* No changes. |
|
|
180 |
|
|
|
181 |
3.4.0 |
|
|
182 |
----- |
|
|
183 |
|
|
|
184 |
* Added params to constructor, to support call to addAttrs on construction |
|
|
185 |
with user values, when augmenting and invoking constructor manually. |
|
|
186 |
|
|
|
187 |
Also broke out addAttrs logic on construction (introduced for Node), |
|
|
188 |
into it's own _initAttrs method to facilitate customization. |
|
|
189 |
|
|
|
190 |
3.3.0 |
|
|
191 |
----- |
|
|
192 |
|
|
|
193 |
* Changed instanceof to Y.instanceOf, to prevent leaks in IE7 |
|
|
194 |
|
|
|
195 |
3.2.0 |
|
|
196 |
----- |
|
|
197 |
|
|
|
198 |
* Added protected helper method (_getAttrCfg) to return the configuration |
|
|
199 |
for a given attribute. |
|
|
200 |
|
|
|
201 |
3.1.1 |
|
|
202 |
----- |
|
|
203 |
|
|
|
204 |
* Fixed ticket #2528753 : Sub attribute value crashed after setting another |
|
|
205 |
sub attribute. |
|
|
206 |
|
|
|
207 |
3.1.0 |
|
|
208 |
----- |
|
|
209 |
|
|
|
210 |
* writeOnce can be set to "initOnly", which can be used |
|
|
211 |
to prevent the user from setting the value outside of the initial |
|
|
212 |
configuration when using the addAttrs. |
|
|
213 |
|
|
|
214 |
When used with Base, this means that the user can only define a |
|
|
215 |
value for the Attribute during construction. |
|
|
216 |
|
|
|
217 |
* Attribute change events are now published with the defaultTargetOnly |
|
|
218 |
property set to true. |
|
|
219 |
|
|
|
220 |
* newVal property of event object passed to change event listeners will |
|
|
221 |
now be the value returned from the Attribute's getter (if defined) |
|
|
222 |
|
|
|
223 |
* setter, getter, validator and valueFn can now be specified as |
|
|
224 |
strings, referring to the method names to be invoked on the Attribute |
|
|
225 |
instance. |
|
|
226 |
|
|
|
227 |
3.0.0 |
|
|
228 |
----- |
|
|
229 |
|
|
|
230 |
* set/get can now be called for ad-hoc attributes (attributes which |
|
|
231 |
have not been added/configured). |
|
|
232 |
|
|
|
233 |
* Fixed issue where custom getters were being called with undefined values, |
|
|
234 |
for the initial set. |
|
|
235 |
|
|
|
236 |
* Limited the case for which an attribute will not notify after listeners, |
|
|
237 |
if the value is unchanged after a set, to primitive values (values for |
|
|
238 |
which Lang.isObject(newVal) returns false). |
|
|
239 |
|
|
|
240 |
This allows after listeners to be invoked, when resetting the value to |
|
|
241 |
the same object reference, which has properties updated, or arrays with |
|
|
242 |
elements modified. |
|
|
243 |
|
|
|
244 |
* Attribute broken up into attribute-base and attribute-complex submodules. |
|
|
245 |
|
|
|
246 |
attribute-complex adds support for complex attributes ({x.y.z : 5}) to |
|
|
247 |
addAttrs. |
|
|
248 |
|
|
|
249 |
3.0.0 beta 1 |
|
|
250 |
------------ |
|
|
251 |
|
|
|
252 |
* Removed Attribute.CLONE support in the interests of simplicity. |
|
|
253 |
Was not being used. Can re-evaluate support if real world demand |
|
|
254 |
for it exists. |
|
|
255 |
|
|
|
256 |
* Changed "set" and "get" configuration properties for setter and |
|
|
257 |
getter methods to "setter" and "getter" respectively. |
|
|
258 |
|
|
|
259 |
* Added support for setter to return Attribute.INVALID_VALUE |
|
|
260 |
to prevent attribute state from being changed. |
|
|
261 |
|
|
|
262 |
This allows developers to combine setter and validator |
|
|
263 |
functionality into one method if performance optimization |
|
|
264 |
is required. |
|
|
265 |
|
|
|
266 |
* "validator" is now invoked before "setter". |
|
|
267 |
|
|
|
268 |
* Renamed xxxAtt and xxxAtts methods to xxxAttr, xxxAttrs for |
|
|
269 |
consistency. |
|
|
270 |
|
|
|
271 |
* "after" listeners are only notified if attribute value really |
|
|
272 |
changes (preVal !== newVal). |
|
|
273 |
|
|
|
274 |
* Extending classes can now overwrite ATTRS configuration properties |
|
|
275 |
from super classes, including writeOnce and readOnly attributes. |
|
|
276 |
|
|
|
277 |
The ATTRS configurations are merged across the class hierarchy, |
|
|
278 |
before they are used to initialize the attributes. |
|
|
279 |
|
|
|
280 |
* addAttr now prevents re-adding attributes which are already |
|
|
281 |
configured in order to maintain consistent state. |
|
|
282 |
|
|
|
283 |
* Event prefix wrapper functions (on, after etc.) removed - |
|
|
284 |
Event.Target now accepts an event prefix configuration value |
|
|
285 |
|
|
|
286 |
* Added additional log messages to assist with debugging. |
|
|
287 |
|
|
|
288 |
* Attribute change events are no longer fired for initial set. |
|
|
289 |
|
|
|
290 |
* Split up State add/get/remove into add/addAll, get/getAll, |
|
|
291 |
remove/removeAll to avoid having to create object literals for |
|
|
292 |
critical path [ add/get single key values ]. |
|
|
293 |
|
|
|
294 |
* Attribute getter, setter, validator now also receive attribute name |
|
|
295 |
as the 2nd arg (val, name). |
|
|
296 |
|
|
|
297 |
* If Attributes initialized through addAttrs have a user provided value |
|
|
298 |
which is not valid, the initial attribute value will revert to the |
|
|
299 |
default value in the attribute configuration, if it exists. |
|
|
300 |
|
|
|
301 |
* reset() no longer resets readOnly or writeOnce attributes. Only |
|
|
302 |
publically settable values are reset. |
|
|
303 |
|
|
|
304 |
* Added modifyAttr method, to allow component developer to modify |
|
|
305 |
configuration of an attribute which has already been added. The set of |
|
|
306 |
attribute configuration properties which can be modified after it |
|
|
307 |
has been added are limited to getter, readOnly, writeOnce and broadcast. |
|
|
308 |
|
|
|
309 |
* Added support for lazy attribute configuration. Base uses this feature |
|
|
310 |
to lazily intialize all Attributes on the first call to get/set, for |
|
|
311 |
performance optimization. |
|
|
312 |
|
|
|
313 |
lazyAdd:true/false can be used to over-ride this behavior for a |
|
|
314 |
particular attribute. |
|
|
315 |
|
|
|
316 |
3.0.0PR2 |
|
|
317 |
-------- |
|
|
318 |
|
|
|
319 |
* Added valueFn support, to allowing static |
|
|
320 |
attribute values configuration to set instance |
|
|
321 |
based values. |
|
|
322 |
|
|
|
323 |
* Added reset method. |
|
|
324 |
|
|
|
325 |
* Added private setter for use by class implementation |
|
|
326 |
code to set readOnly, writeOnce values. |
|
|
327 |
|
|
|
328 |
3.0.0PR1 - Initial release |
|
|
329 |
-------------------------- |