Titanium JIRA Archive
Alloy (ALOY)

[ALOY-709] Add ability to disable auto adding "classes" and "apiName" properties

GitHub Issuen/a
Resolution Date2013-08-02T17:20:29.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.2.0, 2013 Sprint 16, 2013 Sprint 12
ComponentsRuntime, Styling
ReporterTony Lukasavage
AssigneeTony Lukasavage


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.


This will add auto styling for all markup components. If autoStyle is not specified, it is false by default.


    autoStyle: true


All components within this controller would be auto styled. Overrides project-level option.
<Alloy autoStyle="true">
    <!-- the rest of your components -->


The specific component with autoStyle would be automatically styled. This overrides both project and controller level options.
        <Label autoStyle="true">some label</Label>


  1. Tony Lukasavage 2013-06-14

    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.json

    Once with autoStyle:false in the config.json

    Once with no entry for autoStyle in the config.json

  2. Tony Lukasavage 2013-08-02

    PR: 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.
  3. Federico Casali 2013-08-06

    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 CLI 3.1.1 Node 0.10.13 Closing.

JSON Source