|
525
|
1 |
Base Change History |
|
|
2 |
=================== |
|
|
3 |
|
|
|
4 |
3.10.3 |
|
|
5 |
------ |
|
|
6 |
|
|
|
7 |
* No changes. |
|
|
8 |
|
|
|
9 |
3.10.2 |
|
|
10 |
------ |
|
|
11 |
|
|
|
12 |
* No changes. |
|
|
13 |
|
|
|
14 |
3.10.1 |
|
|
15 |
------ |
|
|
16 |
|
|
|
17 |
* No changes. |
|
|
18 |
|
|
|
19 |
3.10.0 |
|
|
20 |
------ |
|
|
21 |
|
|
|
22 |
* Significant performance improvements in common Base/BaseCore operations. |
|
|
23 |
|
|
|
24 |
For example, on Chrome: |
|
|
25 |
|
|
|
26 |
`new BaseCore()` is 3 times faster |
|
|
27 |
`BaseCore set()` is 3 times faster |
|
|
28 |
`BaseCore get()` is 5 times faster |
|
|
29 |
|
|
|
30 |
In addition to the above basic `BaseCore` numbers, improvements in CustomEvent |
|
|
31 |
performance, result in the following improvements for `Base` |
|
|
32 |
|
|
|
33 |
`new Base()` is 4 times faster |
|
|
34 |
`Base set()` is 4 times faster |
|
|
35 |
`Base get()` is 5 times faster |
|
|
36 |
|
|
|
37 |
Major performance related changes are listed in the list of updates below. |
|
|
38 |
|
|
|
39 |
Commit messages have detailed descriptions of incremental changes, and the |
|
|
40 |
benefits introduced. |
|
|
41 |
|
|
|
42 |
* [!] The result of static `ATTRS` aggregation is now cached during the creation of |
|
|
43 |
the first instance of a given "class", and the cached results are reused for |
|
|
44 |
subsequent instances. |
|
|
45 |
|
|
|
46 |
This provides significant performance benefits, but has the potential to introduce |
|
|
47 |
a backwards compatibility issue in the hopefully rare circumstance that you're |
|
|
48 |
modifying the static ATTRS collection directly, after the first instance is created. |
|
|
49 |
|
|
|
50 |
[!] If you are modifying static `ATTRS` collection directly after an instance is |
|
|
51 |
created (e.g. if an optional module comes in and updates the collection dynamically), |
|
|
52 |
you will need to change the implementation to use the static `Y.Base.modifyAttrs()` |
|
|
53 |
or `Y.BaseCore.modifyAttrs()` method, so we can mark the cached aggregation |
|
|
54 |
dirty, and recompute it. |
|
|
55 |
|
|
|
56 |
`Y.Base.modifyAttrs(MyClass, {..changes to merge..})` |
|
|
57 |
|
|
|
58 |
`Base.create` and `Base.mix` will take care of this internally, so you only need |
|
|
59 |
to use the above methods if your own code is touching the ATTRS object on a class. |
|
|
60 |
Additionaly, `Base.create` and `Base.mix` will add the `modifyAttrs` to your created |
|
|
61 |
class, so you can also call it directly on the class. e.g. |
|
|
62 |
|
|
|
63 |
`MyCreatedClass.modifyAttrs({..changes to merge..})` |
|
|
64 |
|
|
|
65 |
3.9.1 |
|
|
66 |
----- |
|
|
67 |
|
|
|
68 |
* No changes. |
|
|
69 |
|
|
|
70 |
3.9.0 |
|
|
71 |
----- |
|
|
72 |
|
|
|
73 |
* No changes. |
|
|
74 |
|
|
|
75 |
3.8.1 |
|
|
76 |
----- |
|
|
77 |
|
|
|
78 |
* No changes. |
|
|
79 |
|
|
|
80 |
3.8.0 |
|
|
81 |
----- |
|
|
82 |
|
|
|
83 |
* `Y.Base.create()` can now be used with `Y.BaseCore`, in addition to its |
|
|
84 |
existing usage with `Y.Base`. This allows non-observable, BaseCore hierarchies |
|
|
85 |
to use class extensions. |
|
|
86 |
|
|
|
87 |
* Extracted the `Y.BaseObservable` class extension from `Y.Base`. This is a new |
|
|
88 |
class extension for `Y.BaseCore` which adds support for observability. This |
|
|
89 |
allows BaseCore subclasses to mix-in BaseObservable at runtime, bringing their |
|
|
90 |
functionality up to that of `Y.Base`. |
|
|
91 |
|
|
|
92 |
3.7.3 |
|
|
93 |
----- |
|
|
94 |
|
|
|
95 |
* No changes. |
|
|
96 |
|
|
|
97 |
3.7.2 |
|
|
98 |
----- |
|
|
99 |
|
|
|
100 |
* No changes. |
|
|
101 |
|
|
|
102 |
3.7.1 |
|
|
103 |
----- |
|
|
104 |
|
|
|
105 |
* No changes. |
|
|
106 |
|
|
|
107 |
3.7.0 |
|
|
108 |
----- |
|
|
109 |
|
|
|
110 |
* No changes. |
|
|
111 |
|
|
|
112 |
3.6.0 |
|
|
113 |
----- |
|
|
114 |
|
|
|
115 |
* "value" defined in a subclass ATTRS definition, will now override |
|
|
116 |
"valueFn" for the same attribute from the superclass chain. |
|
|
117 |
|
|
|
118 |
Previously, "value" would only override "value" and "valueFn" |
|
|
119 |
would only overide "valueFn", and in the aggregated set of |
|
|
120 |
attributes, "valueFn" would take precedence over "value". |
|
|
121 |
|
|
|
122 |
This meant that subclasses had to define a "valueFn" to overide |
|
|
123 |
superclasses, if the superclass used "valueFn". |
|
|
124 |
|
|
|
125 |
3.5.1 |
|
|
126 |
----- |
|
|
127 |
|
|
|
128 |
* No changes. |
|
|
129 |
|
|
|
130 |
3.5.0 |
|
|
131 |
----- |
|
|
132 |
|
|
|
133 |
* Only invoke Base constructor logic once to |
|
|
134 |
support multi-inheritance scenario in which |
|
|
135 |
an extension passed to Base.create inherits from Base |
|
|
136 |
itself. |
|
|
137 |
|
|
|
138 |
NOTE: To support multiple inhertiance more deeply, we'd |
|
|
139 |
need to remove the hasOwnProperty restriction around object |
|
|
140 |
key iteration. |
|
|
141 |
|
|
|
142 |
* Added Y.BaseCore which is core Base functionality without |
|
|
143 |
Custom Events (it uses Y.AttributeCore instead of Y.Attribute). |
|
|
144 |
|
|
|
145 |
Y.BaseCore still maintains the ATTRS handling, init/destroy |
|
|
146 |
lifecycle and plugin support, but doesn't fire any custom evnets |
|
|
147 |
of it's own (the idea is that it will the base for Node-Plugin |
|
|
148 |
type components, built off of a WidgetCore) |
|
|
149 |
|
|
|
150 |
Y.Base is now Y.BaseCore + Y.Attribute, and is 100% backwards |
|
|
151 |
compatible. |
|
|
152 |
|
|
|
153 |
Summary: |
|
|
154 |
|
|
|
155 |
Y.Attribute - Common Attribute Functionality (100% backwards compat) |
|
|
156 |
Y.Base - Common Base Functionality (100% backwards compat) |
|
|
157 |
|
|
|
158 |
Y.AttributeCore - Lightest Attribute support, without CustomEvents |
|
|
159 |
Y.BaseCore - Lightest Base support, without CustomEvents |
|
|
160 |
|
|
|
161 |
-- |
|
|
162 |
|
|
|
163 |
Y.AttributeEvents - Augmentable Attribute Events support |
|
|
164 |
Y.AttributeExtras - Augmentable 20% usage for Attribute (modifyAttr, removeAttr, reset ...) |
|
|
165 |
Y.AttributeComplex - Augmentable support for constructor complex attribute parsing ({"x.y":foo}) |
|
|
166 |
|
|
|
167 |
-- |
|
|
168 |
|
|
|
169 |
Y.Attribute = Y.AttributeCore + Y.AttributeEvents + Y.AttributeExtras |
|
|
170 |
Y.Base = Y.BaseCore + Y.Attribute |
|
|
171 |
|
|
|
172 |
-- |
|
|
173 |
|
|
|
174 |
Modules: |
|
|
175 |
|
|
|
176 |
"base-base" : Y.Base |
|
|
177 |
"base-core" : Y.BaseCore |
|
|
178 |
|
|
|
179 |
"base-build" : Y.Base.build/create/mix mixin |
|
|
180 |
|
|
|
181 |
* Extended Base.create/mix support for _buildCfg, to Extensions, mainly so that |
|
|
182 |
extensions can define a whitelist of statics which need to be copied to the |
|
|
183 |
main class. |
|
|
184 |
|
|
|
185 |
e.g. |
|
|
186 |
|
|
|
187 |
MyExtension._buildCfg = { |
|
|
188 |
aggregates:["newPropsToAggregate"...], |
|
|
189 |
custom: { |
|
|
190 |
newPropsToCustomMix |
|
|
191 |
}, |
|
|
192 |
statics: ["newPropsToCopy"] |
|
|
193 |
}; |
|
|
194 |
|
|
|
195 |
3.4.1 |
|
|
196 |
----- |
|
|
197 |
|
|
|
198 |
* No changes. |
|
|
199 |
|
|
|
200 |
3.4.0 |
|
|
201 |
----- |
|
|
202 |
|
|
|
203 |
* Base now destroys plugins before destroying itself |
|
|
204 |
|
|
|
205 |
* Base.create/mix extensions can now define initializer and |
|
|
206 |
destructor prototype functions, which will get invoked after |
|
|
207 |
the initializer for the host class into which they are mixed and |
|
|
208 |
before it's destructor. |
|
|
209 |
|
|
|
210 |
* Use a hash version of whitelist mix for improved performance. |
|
|
211 |
Also removed non-required hasOwnProperty check and delete. |
|
|
212 |
|
|
|
213 |
3.3.0 |
|
|
214 |
----- |
|
|
215 |
|
|
|
216 |
* Fixed Base.mix when used on a class created using Base.create |
|
|
217 |
|
|
|
218 |
* toString no longer inadvertently stamps the object, however, |
|
|
219 |
we now stamp Base objects in the constructor, to support |
|
|
220 |
use cases where the "toString" stamping was implicitly being |
|
|
221 |
relied upon (e.g. in DD, as hashkeys). |
|
|
222 |
|
|
|
223 |
3.2.0 |
|
|
224 |
----- |
|
|
225 |
|
|
|
226 |
* Fixed Base.create to properly isolate ATTRS on extensions |
|
|
227 |
|
|
|
228 |
3.1.1 |
|
|
229 |
----- |
|
|
230 |
|
|
|
231 |
* No changes |
|
|
232 |
|
|
|
233 |
3.1.0 |
|
|
234 |
----- |
|
|
235 |
|
|
|
236 |
* As the final step in the destroy phase, Base now does a detachAll() to avoid invoking listeners |
|
|
237 |
which may be waiting to be in an async. step which occurs after destruction. |
|
|
238 |
|
|
|
239 |
* "init" and "destroy" events are now published with the defaultTargetOnly property set to true |
|
|
240 |
|
|
|
241 |
* Added support for MyClass.EVENT_PREFIX to allow developers |
|
|
242 |
to define their own event prefix |
|
|
243 |
|
|
|
244 |
* Made "init" and "destroy" events fireOnce:true (along with |
|
|
245 |
"render" in Widget), so that subscriptions made after the |
|
|
246 |
events are fired, are notified immediately. |
|
|
247 |
|
|
|
248 |
* Dynamic and non-dynamically built classes now have their |
|
|
249 |
extensions instantiated the same way - during _initHierarchy. |
|
|
250 |
|
|
|
251 |
* Updated ATTRS handling for Base.build, so that ATTRS are |
|
|
252 |
also aggregated at the attribute configuration object level, |
|
|
253 |
allowing extensions to add to, or overwrite, attribute |
|
|
254 |
configuration properties on the host. |
|
|
255 |
|
|
|
256 |
* Added sugar Base.create and Base.mix methods on top of |
|
|
257 |
Base.build, to simplify the 2 main use cases: |
|
|
258 |
|
|
|
259 |
1) Creating a completely new class which uses extensions. |
|
|
260 |
2) Mixing in extensions to an existing class. |
|
|
261 |
|
|
|
262 |
* Documented non-attribute on, after, bubbleTargets and plugins |
|
|
263 |
property support in the Base constructor config argument |
|
|
264 |
|
|
|
265 |
3.0.0 |
|
|
266 |
----- |
|
|
267 |
|
|
|
268 |
* Fixed hasImpl method on built classes, to look up the class |
|
|
269 |
hierarchy for applied extensions. |
|
|
270 |
|
|
|
271 |
* Plugin.Host removed from base-base module and delivered as it's |
|
|
272 |
own module - "pluginhost" |
|
|
273 |
|
|
|
274 |
* base broken up into.. |
|
|
275 |
|
|
|
276 |
base-base: Provides class hierarchy support for ATTRS and |
|
|
277 |
initialization |
|
|
278 |
|
|
|
279 |
base-build: Provides Extension support in the form of |
|
|
280 |
Base.build |
|
|
281 |
|
|
|
282 |
base-pluginhost: Augments Plugin.Host to Base, adding plugin |
|
|
283 |
support |
|
|
284 |
|
|
|
285 |
3.0.0 beta 1 |
|
|
286 |
------------ |
|
|
287 |
|
|
|
288 |
* Config argument for init event now merged into the event facade, |
|
|
289 |
instead of being passed separately (available as e.cfg). |
|
|
290 |
|
|
|
291 |
* Removed Base.create. On review, considered to be overkill. |
|
|
292 |
Users can easily create new instances, using Base.build |
|
|
293 |
|
|
|
294 |
* Moved PluginHost down from Widget to Base, since utils and |
|
|
295 |
Node will also support Plugins. |
|
|
296 |
|
|
|
297 |
* PluginHost.plug and unplug now accept the plugin class as |
|
|
298 |
arguments [plug(pluginClass, cfg) and unplug(pluginClass)]. |
|
|
299 |
|
|
|
300 |
* Split base module up into base-base and base-build. |
|
|
301 |
|
|
|
302 |
* Added lazy attribute initialization support, to improve performance. |
|
|
303 |
|
|
|
304 |
This also removes order dependency when processing ATTRS for a |
|
|
305 |
particular class. |
|
|
306 |
|
|
|
307 |
If a get/set call is made for an uninitialized attribute A, in the |
|
|
308 |
getter/setter/validator or valueFns of another attribute B, A will |
|
|
309 |
be intiailized on the fly. |
|
|
310 |
|
|
|
311 |
* Added ability to subscribe to on/after events through the |
|
|
312 |
constructor config object, e.g.: |
|
|
313 |
|
|
|
314 |
new MyBaseObject({ |
|
|
315 |
on: { |
|
|
316 |
init: handlerFn, |
|
|
317 |
myAttrChange: handlerFn |
|
|
318 |
}, |
|
|
319 |
after: { |
|
|
320 |
init: handlerFn, |
|
|
321 |
myAttrChange: handlerFn |
|
|
322 |
}, |
|
|
323 |
... |
|
|
324 |
}); |
|
|
325 |
|
|
|
326 |
* Developers can now override the default clone behavior we use to |
|
|
327 |
isolate default ATTRS config values, using cloneDefaultValue, e.g.: |
|
|
328 |
|
|
|
329 |
ATTRS = { |
|
|
330 |
myAttr : { |
|
|
331 |
value: AnObjectOrArrayReference |
|
|
332 |
cloneDefaultValue: true|false|"deep"|"shallow" |
|
|
333 |
} |
|
|
334 |
} |
|
|
335 |
|
|
|
336 |
If the cloneDefaultValue property is not defined, Base will clone |
|
|
337 |
any Arrays or Object literals which are used as default values when |
|
|
338 |
configuring attributes for an instance, so that updates to instance |
|
|
339 |
values do not modify the default value. |
|
|
340 |
|
|
|
341 |
This behavior can be over-ridden using the cloneDefaultValue property: |
|
|
342 |
|
|
|
343 |
true, deep: |
|
|
344 |
|
|
|
345 |
Use Y.clone to protect the default value. |
|
|
346 |
|
|
|
347 |
shallow: |
|
|
348 |
|
|
|
349 |
Use Y.merge, to protect the default value. |
|
|
350 |
|
|
|
351 |
false: |
|
|
352 |
|
|
|
353 |
Don't clone Arrays or Object literals. The value is intended |
|
|
354 |
to be used by reference, for example, when it points to |
|
|
355 |
a utility object. |
|
|
356 |
|
|
|
357 |
* Base.plug and Base.unplug used to add static Plugins (default plugins |
|
|
358 |
for a class). Replaces static PLUGINS array, allowing subclasses to |
|
|
359 |
easily unplug static plugins added higher up in the hierarchy. |
|
|
360 |
|
|
|
361 |
* Base adds all attributes lazily. This means attributes don't get |
|
|
362 |
initialized until the first call to get/set, speeding up construction |
|
|
363 |
of Base based objects. |
|
|
364 |
|
|
|
365 |
Attributes which have setters which set some other state in the object, |
|
|
366 |
can configure the attribute to disable lazy initialization, by setting |
|
|
367 |
lazyAdd:false as part of their attribute configuration, so that the setter |
|
|
368 |
gets invoked during construction. |
|
|
369 |
|
|
|
370 |
3.0.0PR1 - Initial release |
|
|
371 |
-------------------------- |
|
|
372 |
|