[ALOY-1287] Alloy styles compilation does not produce the same results accross successive compilations
| GitHub Issue | n/a |
| Type | Bug |
| Priority | Medium |
| Status | Resolved |
| Resolution | Fixed |
| Resolution Date | 2015-07-29T00:06:48.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Alloy 1.7.0 |
| Components | Styling |
| Labels | defect |
| Reporter | Xavier Lacot |
| Assignee | Ingo Muschenetz |
| Created | 2015-07-01T08:29:12.000+0000 |
| Updated | 2015-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
| File | Date | Size |
| app.zip | 2015-07-01T08:28:07.000+0000 | 7603 |
A Pull Request is available here: https://github.com/appcelerator/alloy/pull/704
I just ran into this bug while creating https://github.com/appcelerator-developer-relations/appc-sample-ti410, thanks [~xavier]
Verified the bug using the attached sample app: First run, correctly mixing style from
app.tssandsum.tssSecond run, missing the styles from$.__views.__alloyId0 = Ti.UI.createView({ layout: "vertical", height: Ti.UI.SIZE, top: 10, right: 10, bottom: 5, left: 10, backgroundColor: "red", id: "__alloyId0" });sum.tss:Also verified the PR, where both the first and second run correctly mix the style from$.__views.__alloyId0 = Ti.UI.createView({ top: 14, bottom: 15, backgroundColor: "red", layout: "vertical", height: Ti.UI.SIZE, right: 10, left: 10, id: "__alloyId0" });app.tssandsum.tss.PR merged.