Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1287] Alloy styles compilation does not produce the same results accross successive compilations

GitHub Issuen/a
TypeBug
PriorityMedium
StatusResolved
ResolutionFixed
Resolution Date2015-07-29T00:06:48.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.7.0
ComponentsStyling
Labelsdefect
ReporterXavier Lacot
AssigneeIngo Muschenetz
Created2015-07-01T08:29:12.000+0000
Updated2015-07-29T00:06:48.000+0000

Description

In some cases, when the developer overloads in a stylesheets some styles defined in the app.tss files, the alloy compilation won't produce the same resulting javascript accross successive compilations. Alloy's styler orders style rules to define their priority, but there's a bug with the app.tss global styles being cached and therefore not correctly being counted by the styler during a compilation phase when app.tss didn't change. Steps to reproduce: * create a new alloy app, replace its app folder with the one contained in the attached app.zip file * compile once: alloy compile --config platform=ios. Check in Resources/iphone/alloy/controllers/sum.js that the style rules defined in app/styles/sum.tss are applied correctly * compile again, the generated javascript in the Resources directory differ. In particular, the Resources/iphone/alloy/controllers/sum.js does only contain rules from the app.tss file. A PR is being proposed to fix this problem.

Attachments

FileDateSize
app.zip2015-07-01T08:28:07.000+00007603

Comments

  1. Xavier Lacot 2015-07-01

    A Pull Request is available here: https://github.com/appcelerator/alloy/pull/704
  2. Fokke Zandbergen 2015-07-07

    I just ran into this bug while creating https://github.com/appcelerator-developer-relations/appc-sample-ti410, thanks [~xavier]
  3. Fokke Zandbergen 2015-07-07

    Verified the bug using the attached sample app: First run, correctly mixing style from app.tss and sum.tss
           $.__views.__alloyId0 = Ti.UI.createView({
               layout: "vertical",
               height: Ti.UI.SIZE,
               top: 10,
               right: 10,
               bottom: 5,
               left: 10,
               backgroundColor: "red",
               id: "__alloyId0"
           });
       
    Second run, missing the styles from sum.tss:
           $.__views.__alloyId0 = Ti.UI.createView({
               top: 14,
               bottom: 15,
               backgroundColor: "red",
               layout: "vertical",
               height: Ti.UI.SIZE,
               right: 10,
               left: 10,
               id: "__alloyId0"
           });
       
    Also verified the PR, where both the first and second run correctly mix the style from app.tss and sum.tss.
  4. Feon Sua Xin Miao 2015-07-29

    PR merged.

JSON Source