{
"id": "155228",
"key": "ALOY-1363",
"fields": {
"issuetype": {
"id": "2",
"description": "A new feature of the product, which has yet to be developed.",
"name": "New Feature",
"subtask": false
},
"project": {
"id": "11113",
"key": "ALOY",
"name": "Alloy",
"projectCategory": {
"id": "10400",
"description": "Tools for developing applications",
"name": "Tooling"
}
},
"fixVersions": [
{
"id": "20671",
"description": "Alloy items that will be included in CLI 7.1.0",
"name": "CLI Release 7.1.0",
"archived": false,
"released": true,
"releaseDate": "2019-08-13"
},
{
"id": "20836",
"name": "Alloy 1.14.0",
"archived": false,
"released": true,
"releaseDate": "2019-07-05"
}
],
"resolution": {
"id": "1",
"description": "A fix for this issue is checked into the tree and tested.",
"name": "Fixed"
},
"resolutiondate": "2019-06-20T21:51:55.000+0000",
"created": "2016-02-29T23:23:16.000+0000",
"priority": {
"name": "Critical",
"id": "1"
},
"labels": [
"alloy",
"font",
"fontfamily",
"fontsize",
"xml"
],
"versions": [],
"issuelinks": [
{
"id": "51093",
"type": {
"id": "10011",
"name": "Includes",
"inward": "is included by",
"outward": "includes"
},
"inwardIssue": {
"id": "155825",
"key": "ALOY-1371",
"fields": {
"summary": "Make Alloy less dependent on knowledge about Titanium APIs for parsing XML",
"status": {
"description": "The issue is open and ready for the assignee to start work on it.",
"name": "Open",
"id": "1",
"statusCategory": {
"id": 2,
"key": "new",
"colorName": "blue-gray",
"name": "To Do"
}
},
"priority": {
"name": "None",
"id": "6"
},
"issuetype": {
"id": "7",
"description": "gh.issue.story.desc",
"name": "Story",
"subtask": false
}
}
}
}
],
"assignee": {
"name": "bhouse",
"key": "bhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"updated": "2019-06-20T21:51:55.000+0000",
"status": {
"description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.",
"name": "Closed",
"id": "6",
"statusCategory": {
"id": 3,
"key": "done",
"colorName": "green",
"name": "Done"
}
},
"components": [
{
"id": "12326",
"name": "XML",
"description": "View XML and parsing"
}
],
"description": "Currently object properties like {{font.fontFamily}} or {{region.latitude}} can only be set in TSS. The request is to make this possible in XML as well, e.g.:\r\n\r\n{code:xml}\r\n\r\n{code}\r\n\r\nh4. Original description\r\n\r\nAs a developer,\r\nI want to be able to set font properties for a view from the xml view,\r\nSo that I can often avoid creating controller files and keep view properties together.\r\n\r\nDesired xml usage:\r\n\r\n{code:xml}\r\n\r\n \r\n \r\n\r\n{code}\r\n\r\nWhen processed, this should create a font object and properly merge this with any style objects defined.\r\n\r\nAdded PR: https://github.com/appcelerator/alloy/pull/764\r\n\r\n\r\n",
"attachment": [],
"flagged": false,
"summary": "Add support to set object properties via XML",
"creator": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"subtasks": [],
"reporter": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"environment": null,
"comment": {
"comments": [
{
"id": "378286",
"author": {
"name": "fokkezb",
"key": "fokke",
"displayName": "Fokke Zandbergen",
"active": true,
"timeZone": "Europe/Amsterdam"
},
"body": "Apart from the fact that setting styles in XML is a bad practice, I'd rather see a more generic implementation for assigning object properties via XML:\r\n\r\n{code:xml}\r\n\r\n{code}",
"updateAuthor": {
"name": "fokkezb",
"key": "fokke",
"displayName": "Fokke Zandbergen",
"active": true,
"timeZone": "Europe/Amsterdam"
},
"created": "2016-03-01T12:10:15.000+0000",
"updated": "2016-03-01T12:10:15.000+0000"
},
{
"id": "378294",
"author": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"body": "I like the idea of using xml prefixes to distinguish things. I think that would have been a good way to implement module and namespace support in Alloy tags. Are there a lot of other child object, other than font, that need to be set in xml? I noticed that setting font seems to be one of the few commonly used properties that can't be set currently using the normal xml attributes.",
"updateAuthor": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"created": "2016-03-01T14:02:20.000+0000",
"updated": "2016-03-01T14:02:20.000+0000"
},
{
"id": "378300",
"author": {
"name": "fokkezb",
"key": "fokke",
"displayName": "Fokke Zandbergen",
"active": true,
"timeZone": "Europe/Amsterdam"
},
"body": "Another example could be region/position of Maps/StreetView.\r\n\r\nBut more importantly fixing it that way would make it more future proof",
"updateAuthor": {
"name": "fokkezb",
"key": "fokke",
"displayName": "Fokke Zandbergen",
"active": true,
"timeZone": "Europe/Amsterdam"
},
"created": "2016-03-01T15:14:47.000+0000",
"updated": "2016-03-01T15:14:47.000+0000"
},
{
"id": "378302",
"author": {
"name": "sdarda",
"key": "sdarda",
"displayName": "Sharif AbuDarda",
"active": false,
"timeZone": "Asia/Dhaka"
},
"body": "Though it's a bad practice not to set styles in TSS than XML. This is a valid PR. Thanks.",
"updateAuthor": {
"name": "sdarda",
"key": "sdarda",
"displayName": "Sharif AbuDarda",
"active": false,
"timeZone": "Asia/Dhaka"
},
"created": "2016-03-01T15:30:15.000+0000",
"updated": "2016-03-01T15:57:07.000+0000"
},
{
"id": "378324",
"author": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"body": "I guess I agree to disagree on the bad practice. What exactly are you considering to be \"styles\" vs. normal properties? It doesn't seem like a good idea to force developers to create a TSS file just to set one property of a view.",
"updateAuthor": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"created": "2016-03-01T16:30:53.000+0000",
"updated": "2016-03-01T16:30:53.000+0000"
},
{
"id": "378328",
"author": {
"name": "sdarda",
"key": "sdarda",
"displayName": "Sharif AbuDarda",
"active": false,
"timeZone": "Asia/Dhaka"
},
"body": "The Titanium Style Sheets (TSS) file uses a JSON-like syntax to define the attributes of elements in the XML files. All TSS attributes are the properties of the Titanium object. For examples, when defining the style for a Button object, each property, such as backgroundDisabledColor, backgroundFocusedColor, backgroundSelectedColor, etc., can be specified as an attribute in the TSS file. \r\n\r\nYou can either use tss or xml to set a property of a Titanium obsject. But when you want the Platform-Specific Styles and Custom Query Styles you would need a tss file to set up those conditions. Thanks.\r\n\r\n",
"updateAuthor": {
"name": "sdarda",
"key": "sdarda",
"displayName": "Sharif AbuDarda",
"active": false,
"timeZone": "Asia/Dhaka"
},
"created": "2016-03-01T16:47:47.000+0000",
"updated": "2016-03-01T16:47:47.000+0000"
},
{
"id": "378330",
"author": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"body": "I understand what the TSS files are, I just disagree that we should be forced to use them :) \r\n\r\nThe fact that they are \"JSON-like\" instead of true JSON makes them not very editor friendly. I do use them (especially app.tss) but for quick-and-dirty views where I don't even have a .js controller file, I don't want to create a .tss file just to set a property.",
"updateAuthor": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"created": "2016-03-01T17:04:06.000+0000",
"updated": "2016-03-01T17:04:06.000+0000"
},
{
"id": "378347",
"author": {
"name": "fokkezb",
"key": "fokke",
"displayName": "Fokke Zandbergen",
"active": true,
"timeZone": "Europe/Amsterdam"
},
"body": "I've corrected the project to Alloy and changed the title to take it away from the font property (which brings up the best practice thing) and make it generic, where use cases like Map region paint a broader picture.",
"updateAuthor": {
"name": "fokkezb",
"key": "fokke",
"displayName": "Fokke Zandbergen",
"active": true,
"timeZone": "Europe/Amsterdam"
},
"created": "2016-03-01T18:17:30.000+0000",
"updated": "2016-03-01T18:17:30.000+0000"
},
{
"id": "378377",
"author": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"body": "[~fokkezb] How many levels deep were you thinking. I am assuming one but I wanted to make sure.",
"updateAuthor": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"created": "2016-03-01T22:27:42.000+0000",
"updated": "2016-03-01T22:27:42.000+0000"
},
{
"id": "378404",
"author": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"body": "I added new PR based on feedback: https://github.com/appcelerator/alloy/pull/765",
"updateAuthor": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"created": "2016-03-02T02:27:37.000+0000",
"updated": "2016-03-02T02:27:37.000+0000"
},
{
"id": "378587",
"author": {
"name": "fokkezb",
"key": "fokke",
"displayName": "Fokke Zandbergen",
"active": true,
"timeZone": "Europe/Amsterdam"
},
"body": "I think one level would cover 95% of the use cases, but we could use [_.set|https://lodash.com/docs#set] to go beyond that.\r\n\r\nCould you include a test app?\r\nhttps://github.com/appcelerator/alloy/tree/master/tools\r\n\r\nIf we implement this we'd also need a ticket for TISTUD to add XML autocompletion. I already checked it doesn't give any syntax errors.",
"updateAuthor": {
"name": "fokkezb",
"key": "fokke",
"displayName": "Fokke Zandbergen",
"active": true,
"timeZone": "Europe/Amsterdam"
},
"created": "2016-03-03T14:39:42.000+0000",
"updated": "2016-03-03T14:47:25.000+0000"
},
{
"id": "378597",
"author": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"body": "[~fokkezb] Does this mean you are replacing underscore with lodash? YES!!!!!!!!!!!!! :D",
"updateAuthor": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"created": "2016-03-03T15:46:42.000+0000",
"updated": "2016-03-03T15:46:42.000+0000"
},
{
"id": "378615",
"author": {
"name": "fokkezb",
"key": "fokke",
"displayName": "Fokke Zandbergen",
"active": true,
"timeZone": "Europe/Amsterdam"
},
"body": "Uhm... no, but we should. Feel free to do a PR for ALOY-1168\r\n\r\nAFAIK lodash is underscore compatible, so should be no problem to replace.",
"updateAuthor": {
"name": "fokkezb",
"key": "fokke",
"displayName": "Fokke Zandbergen",
"active": true,
"timeZone": "Europe/Amsterdam"
},
"created": "2016-03-03T18:47:08.000+0000",
"updated": "2016-03-03T18:47:08.000+0000"
},
{
"id": "379687",
"author": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"body": "Added test app: https://github.com/brentonhouse/brentonhouse.alloy/tree/feature-xml-attribute-prefix/test/apps/testing/ALOY-1363",
"updateAuthor": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"created": "2016-03-14T20:02:16.000+0000",
"updated": "2016-03-14T20:02:16.000+0000"
},
{
"id": "379693",
"author": {
"name": "core13",
"key": "core13",
"displayName": "Malcolm Hollingsworth",
"active": true,
"timeZone": "Europe/London"
},
"body": "[~brentonhouse] not liking that using style based properties directly in XML is a bad practice does not stop it being a bad practice. The suggestion that you should not have to create a tss for a single entry can only mean that sufficient consideration for the app structure has been performed. \r\n\r\nThe distraction of this sort of ticket rather than focussing on fixing actual bugs that are plaguing the system is annoying. Your example of a font family or size could be solved with an entry in the app.tss to define an app wide style option (you could set more than one of course) then adding that class to the XML improves the app and tenders all these changes mute. More time to fix the bugs, less code to gain new bugs. \r\n\r\nThe inclusion of style based properties in the creation of Alloy was regretted by its creator as it failed to provide true seperation. It was left in solely as a means for newbies and those transitioning from non-Alloy. \r\n\r\nI expect you may find those comments rude - that is not my intent. Should you wish to discuss it to get the other side of the coin (so to speak) feel free. You may gain new insights or stick to your own - I am happy with either outcome. ",
"updateAuthor": {
"name": "core13",
"key": "core13",
"displayName": "Malcolm Hollingsworth",
"active": true,
"timeZone": "Europe/London"
},
"created": "2016-03-14T21:57:46.000+0000",
"updated": "2016-03-14T22:02:19.000+0000"
},
{
"id": "379695",
"author": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"body": "[~core13] No offense taken! I completely realize that everyone has their own set of features that they really want. As a developer, my goal is to build awesome apps in the most simple way possible. Sometimes I do crazy things like defining an app in JSON and loading it into the app at runtime, so I don't always use TSS files. I just finally got around to adding some of these things as PR's instead of just complaining to myself... :) Most of my new desired features are now going into Adamantium (https://github.com/mobilehero/adamantium) so that I can get all the benefits of these new features without bothering the Appcelerator Dev teams. In the future, I will probably wait to see if any Adamantium features are desired by others in the community before creating a PR and Test Apps for Alloy. That's one of the many great advantages of open-source software!! Thanks for your feedback and I look forward to maybe implementing a feature you might want/need in the product!",
"updateAuthor": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"created": "2016-03-14T22:17:57.000+0000",
"updated": "2016-03-14T22:18:46.000+0000"
},
{
"id": "380039",
"author": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"body": "Not to completely derail a discussion that I started but...\r\n\r\nWhat if Alloy supported this instead:\r\n\r\n{code:xml}\r\n\r\n{code}\r\n\r\nWhere xml elements could be \"virtual\" in that they just set a property (of type object or array) on the parent object instead of creating a view. The property name would default to the element name (with lowercased first letter). This would allow you to go as you needed to and give you more flexibility.\r\n\r\nThe other reason I am asking is to possibly reserve the attribute prefixes for platform specific properties. \r\n\r\n{code:xml}\r\n\r\n \r\n\r\n{code}\r\n\r\nAgain, I know these kind of changes are not popular with everyone but I thought I would throw it out there. I am thick-skinned and can benefit from the discussions!\r\n",
"updateAuthor": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"created": "2016-03-17T22:09:30.000+0000",
"updated": "2016-03-17T22:21:54.000+0000"
},
{
"id": "380071",
"author": {
"name": "fokkezb",
"key": "fokke",
"displayName": "Fokke Zandbergen",
"active": true,
"timeZone": "Europe/Amsterdam"
},
"body": "[~brentonhouse] I like both suggestions.\r\n\r\nThe first I like because the less view-specific behavior Alloy needs to be aware off the better. However, I don't like adding too much protected attributes, maybe this would do?\r\n\r\n{code:xml}\r\n\r\n{code}\r\n\r\nWould you think for a font that would mean doing the following instead of the earlier suggested {{font:fontSize}} attribute? Because that might conflict with platform specific attributes.\r\n\r\n{code:xml}\r\n\r\n{code}\r\n\r\nI've thought about your second example for {{tiapp.xml}}, where you would be able to set platform specific settings like app name, properties etc.",
"updateAuthor": {
"name": "fokkezb",
"key": "fokke",
"displayName": "Fokke Zandbergen",
"active": true,
"timeZone": "Europe/Amsterdam"
},
"created": "2016-03-18T09:12:50.000+0000",
"updated": "2016-03-18T09:16:16.000+0000"
},
{
"id": "380082",
"author": {
"name": "fokkezb",
"key": "fokke",
"displayName": "Fokke Zandbergen",
"active": true,
"timeZone": "Europe/Amsterdam"
},
"body": "I think we better break this discussion in two:\r\n\r\n* Scalar (string/number/boolean) object property values: this ticket\r\n* Complex (array/object) object property/method values: ALOY-1371\r\n\r\nThe question now is, should we maybe not have a separate (more simple) way for scalar values and just require:\r\n\r\n{code:xml}\r\n\r\n{code}",
"updateAuthor": {
"name": "fokkezb",
"key": "fokke",
"displayName": "Fokke Zandbergen",
"active": true,
"timeZone": "Europe/Amsterdam"
},
"created": "2016-03-18T12:54:25.000+0000",
"updated": "2016-03-18T12:54:25.000+0000"
},
{
"id": "380083",
"author": {
"name": "core13",
"key": "core13",
"displayName": "Malcolm Hollingsworth",
"active": true,
"timeZone": "Europe/London"
},
"body": "Or just use the TSS files which are designed to perform this function for the Alloy MVC.",
"updateAuthor": {
"name": "core13",
"key": "core13",
"displayName": "Malcolm Hollingsworth",
"active": true,
"timeZone": "Europe/London"
},
"created": "2016-03-18T12:57:49.000+0000",
"updated": "2016-03-18T12:57:49.000+0000"
},
{
"id": "380084",
"author": {
"name": "fokkezb",
"key": "fokke",
"displayName": "Fokke Zandbergen",
"active": true,
"timeZone": "Europe/Amsterdam"
},
"body": "TSS files can't do ALOY-1371.\r\n\r\nBut you do have an argument as too why we maybe should not resolve this ticket, but only ALOY-1371 which _would_ then allow developers still declare a font in XML that way, just not the more simple way suggested by this ticket.",
"updateAuthor": {
"name": "fokkezb",
"key": "fokke",
"displayName": "Fokke Zandbergen",
"active": true,
"timeZone": "Europe/Amsterdam"
},
"created": "2016-03-18T13:01:24.000+0000",
"updated": "2016-03-18T13:01:24.000+0000"
},
{
"id": "380085",
"author": {
"name": "core13",
"key": "core13",
"displayName": "Malcolm Hollingsworth",
"active": true,
"timeZone": "Europe/London"
},
"updateAuthor": {
"name": "core13",
"key": "core13",
"displayName": "Malcolm Hollingsworth",
"active": true,
"timeZone": "Europe/London"
},
"created": "2016-03-18T13:18:47.000+0000",
"updated": "2016-03-18T13:18:47.000+0000"
},
{
"id": "380086",
"author": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"body": "[~core13] To continue with your metaphor... _What if you had a friend who was willing to give your car a new paint job for free while you were busy overhauling the \"important\" stuff. All you needed to do is make sure the paint job looked good and that paint didn't get on anything that wasn't supposed to be painted._ Would you really say no?",
"updateAuthor": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"created": "2016-03-18T13:45:26.000+0000",
"updated": "2016-03-18T13:46:01.000+0000"
},
{
"id": "380087",
"author": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"body": "[~fokkezb] What would be an example of the scalar properties that would be left after split? Are you talking about platform specific properties like {{ios:text}} or something else?",
"updateAuthor": {
"name": "brentonhouse",
"key": "brentonhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"created": "2016-03-18T13:51:49.000+0000",
"updated": "2016-03-18T13:51:49.000+0000"
},
{
"id": "380088",
"author": {
"name": "core13",
"key": "core13",
"displayName": "Malcolm Hollingsworth",
"active": true,
"timeZone": "Europe/London"
},
"body": "[~brentonhouse] I would welcome the offer provided the car was fixed first as otherwise the repaint will get in the way of the more important structural work. Once that was completed I would then have to see if the choice of colour is best for the car.\r\n\r\nMetaphor aside; I am not suggesting your work or idea does not have merit. But we are working inside a situation where there are significant long term problems that have not been started or have been abandoned. Where more recent additions to alloy get added that introduce new features requested for years rather than changing how something that already works is done.\r\n\r\nMost importantly, many things are being broken in each successive release that then have to be fixed in each subsequent release.",
"updateAuthor": {
"name": "core13",
"key": "core13",
"displayName": "Malcolm Hollingsworth",
"active": true,
"timeZone": "Europe/London"
},
"created": "2016-03-18T13:53:15.000+0000",
"updated": "2016-03-18T13:53:15.000+0000"
},
{
"id": "380090",
"author": {
"name": "fokkezb",
"key": "fokke",
"displayName": "Fokke Zandbergen",
"active": true,
"timeZone": "Europe/Amsterdam"
},
"body": "[~brentonhouse] Maybe _scalar_ wasn't the right term. I guess the original idea ({{