Ticket #2531567 (closed enhancement)
Reporter Luke Smith |
Opened: 12/9/11 Last modified: 05/10/12 Status: closed Type: enhancement Resolution: fixed |
Owner Satyen Desai |
Target Release: 3.5.0 Priority: P3 (normal) |
|---|---|---|---|
| Summary: | Class extensions can't define what static properties to augment the built class with | ||
| Description: | If I have a class extension that wants to add a static method or properties to the class it's being mixed into, there's not currently an easy way to do this.
The _buildCfg property of the main class includes an aggregates and custom keys, but that requires the main class to know what properties will be added to it. |
||
| Type: | enhancement | Observed in Version: | 3.4.1 |
| Component: | Base | Severity: | S3 (normal) |
| Assigned To: | Satyen Desai | Target Release: | 3.5.0 |
| Location: | Library Code | Priority: | P3 (normal) |
| Tags: | Relates To: | ||
| Browsers: | N/A | ||
| URL: | |||
| Test Information: | |||
Change History
|
Posted: 01/10/12
|
|
Posted: 01/10/12
I created this workaround: https://gist.github.com/1587085 |
|
Posted: 01/10/12
Somehow my comment removed you from the cc list. |
|
Posted: 01/31/12
|
|
Posted: 01/31/12
Likely to move the _buildCfg concept over to extensions also, and support a "statics" : true | ["getByNode", "foo", "bar"] |
|
Posted: 02/6/12
I'm thinking of dropping the statics:true support. So we'd only support statics:[...]. There are things like "superclass", "ATTRS", "NAME", "_buildCfg" etc., set up on the constructor, which result in brokenness when copied over from the Extension (say for cases where Ext -extends-> Base), for the statics:true case, combined with the fact that we overwrite:true going from left to right in the Y.Base.create(... main, [ext1, ext2, ext3], px, sx) signature. Now, BaseBuild, could take care of *not copying* ATTRS, NAME, _buildCfg etc - the special stuff associated with Base and which it knows about, but cleaning up "superclass" started to feel messy ("superclass" is added by Y.extend), and subject to fragility. Starting to rethink blindly copying over ALL static references (which is why we probably stopped doing it for Y.extend - we temporarily did at one point), and keeping it to a whitelist for special cases like View.getByNode. Let me know if you have any input. |
|
Posted: 02/6/12
Another good example is "NS" on Plugins. So BaseBuild would need to know that "NS" is special and not copy it over for statics:true - which is knowledge it currently does not have. |
|
Posted: 02/7/12
Pushed MyExt._buildCfg support to master. NOTE: statics:true is not support, as mentioned above. Only ... MyExt._buildCfg = { Unit tests added to src/base/tests/base.html [ Build Tests ] Forgot to add a Fixes #, so list of relevant commits are below ... --- commit 37dbff50927d8f03cf6b383964bd322016050ad1 HISTORY update for MyExt._buildCfg support commit db748fdbe02870b4c78302a13fc95ab765d474c0 Trailing comma cleanup commit 862babd913910d11edc422e00e7b97ee7e1a1948 Merge remote-tracking branch 'upstream/master' commit 52e73635546b2ee315b3d99cc7145a73ebc5b30e Cleaned up Ext._buildCfg support. All buildCfg meta-data now merged |
|
Posted: 02/7/12
|
|
Posted: 02/7/12
Cleaned up Ext._buildCfg support. All buildCfg meta-data now merged Added Ext._buildCfg test cases for static/aggregate/custom support. Also removed statics:true support. See #2531567 |
|
Posted: 02/7/12
Added API and landing page docs. Removed references to the deprecated 'build', and replaced with 'create'/'mix' |
|
Posted: 02/13/12
Cleaned up Ext._buildCfg support. All buildCfg meta-data now merged Added Ext._buildCfg test cases for static/aggregate/custom support. Also removed statics:true support. See #2531567 |
|
Posted: 05/10/12
checkedin -> closed |
|
Posted: 05/10/12
checkedin -> closed |
AutoComplete and View are both currently affected by this.