[ALOY-936] Alloy, TSS as js not "parsed json"
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | Alloy 2.0.0 |
Components | Styling |
Labels | n/a |
Reporter | Guile |
Assignee | Unknown |
Created | 2014-01-23T10:21:35.000+0000 |
Updated | 2018-03-07T22:26:07.000+0000 |
Description
I'm really new in Titanium and don't really know what is the good way to purpose an improvement.
I find TSS very powerfull and find the JSON notation very good.
I disappointed me is the fact that alloy parse and compile the tss file, even if it seems to be json. Then the parser is limited to simple json expression, even if it is transform into real js like a copy/paste (or it seems to do this ;-))
A simple example of what I would like is :
app/styles/index.tss
"TextField": {
borderWidth: 2+1
}
"Button": customProjectFunction(),
Which would be "transformed" into
Resources/iphone/alloy/controllers/Login.js
$.__views.txtMyTextField = Ti.UI.createTextField({
borderWidth: 2+1
});
$.__views.txtMyButton = Ti.UI.createButton(customProjectFunction());
I'm sure there are some reasons to do as it is now, but this feature would provide a very flexible way to make styles.
Let me comment quickly that I mirror many of your concerns and plan to create a more robust solution for styling in the next major version of Alloy, but it will wait until 2.0, as this will be a major change involving everything from style formatting to dynamic styling to documentation and examples of all these. It is a massive change/feature that will require a substantial amount of planning to avoid it becoming a succession of band-aid fixes.