[ALOY-709] Add ability to disable auto adding "classes" and "apiName" properties
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-08-02T17:20:29.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.2.0, 2013 Sprint 16, 2013 Sprint 12 |
Components | Runtime, Styling |
Labels | qe-testadded |
Reporter | Tony Lukasavage |
Assignee | Tony Lukasavage |
Created | 2013-06-13T22:18:07.000+0000 |
Updated | 2013-08-06T19:35:35.000+0000 |
Description
Adding "classes" and "apiName" imposes overhead on the creation of Titanium UI components, as detailed in ALOY-706. "apiName" will eventually be solved by the tickets resulting from TIMOB-12553, but "classes" will continue to pose a performance issue until we have the core runtime. The use of dynamic styling may not be desirable for all developers and they should not be forced to incur those performance costs. We need to make dynamic styling optional at a project-level in the config.json and perhaps investigate allowing it to be used on a per-component level.
The new
autoStyle
option can be set to either true
or false
.
project-level
This will add auto styling for all markup components. IfautoStyle
is not specified, it is false
by default.
config.json
{
autoStyle: true
}
controller-level
All components within this controller would be auto styled. Overrides project-level option.
<Alloy autoStyle="true">
<!-- the rest of your components -->
</Alloy>
component-level
The specific component withautoStyle
would be automatically styled. This overrides both project and controller level options.
<Alloy>
<Window>
<Label autoStyle="true">some label</Label>
</Window>
</Alloy>
PR: https://github.com/appcelerator/alloy/pull/156 test app: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-709 Functional test can pass if the app can be run on all supported platforms and the automated runtime unit tests all pass. This must be confirmed under three separate app conditions for each platform.
Once with
autoStyle:true
in the config.jsonOnce with
autoStyle:false
in the config.jsonOnce with no entry for
autoStyle
in the config.jsonPR: https://github.com/appcelerator/alloy/pull/208 It was just a poorly written unit test. The functionality is operating fine. The unit test has been fixed. You can confirm by executing the original test steps. The fixed version is available in alloy 1.2.0-alpha4 on npm.
Verified working as expected and all unit tests are passing (all OS). Titanium SDK 3.1.2.v20130806034554 Alloy 1.2.0-alpha6 Appcelerator Studio 3.1.2.201308021524 CLI 3.1.1 Node 0.10.13 Closing.