{ "id": "105628", "key": "ALOY-399", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "14875", "description": "2013 Sprint 06", "name": "2013 Sprint 06", "archived": true, "released": true, "releaseDate": "2013-03-25" } ], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2013-03-11T15:41:34.000+0000", "created": "2012-11-28T18:11:25.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-01-28T23:18:04.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": "As it stands, all automatically generated variable names in Alloy get a standard prefix and then a counter as more variables are generated. In other words, the list will always look like this:\r\n\r\n* __alloyId1\r\n* __alloyId2\r\n* __alloyId3\r\n* __alloyId4\r\n* __alloyId5\r\n* and so on...\r\n\r\nWhile this serves its purpose correctly, it makes it difficult in some cases to understand what is going on if a developer decides to inspect the generated code. They can figure it out, but it would be nicer if they could understand it a little more at a glance. \r\n\r\nTo help with this, when the deploy type is either *development* or *test*, I'd like to make the name a little more meaningful. Perhaps adding a part to the variable name that indicates what API it pertains to, or anything to really make it more applicable. In *production* we'll just squeeze these names down to something small and unique, but a more verbose name in *development* and *test* will prove useful.\r\n\r\nFortunately the auto generation of variable names has been abstracted out to a single function called *generateUniqueId()* in https://github.com/appcelerator/alloy/blob/master/Alloy/commands/compile/compilerUtils.js. We can add additional parameters to this function relatively easily and make this improvement gradually, starting with the most used or most cryptic generated code.", "attachment": [], "flagged": false, "summary": "Improve generated variable names", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "241574", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Now that source mapping has been implemented (ALOY-532 and ALOY-537) this is not really necessary. Will re-open if for some reason this becomes beneficial.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-11T15:41:34.000+0000", "updated": "2013-03-11T15:41:34.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }