{ "id": "97464", "key": "ALOY-101", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2012-09-11T14:46:15.000+0000", "created": "2012-07-17T06:03:41.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:01.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": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" }, { "id": "12326", "name": "XML", "description": "View XML and parsing" } ], "description": "Models, Collections, Components, and Widgets are currently accessible via the Alloy.get() methods. It would be nice to also have them available with the old {{Alloy.Models.MODEL_NAME}} format. To do so, the optimizer needs to be updated to convert those namespaces into the performance-friendly get() calls. \r\n\r\nOriginally mentioned here: https://github.com/appcelerator/alloy/commit/8b0a21e448b0ec7c9f03dfa02eec0328e86d3a49#commitcomment-1589909 ", "attachment": [], "flagged": false, "summary": "Allow Alloy.Models.MODEL_NAME notation", "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": "208104", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This will likely be on hold for now given the reasons cited in the github issue:\r\n\r\nI think I might hold off on this one, mainly because it might be confusing to developers that the OO style is not valid at runtime. For example, this wouldn't generate correctly as it's a runtime constraint:\r\n\r\n{code:javascript}\r\nvar value = 'Models';\r\nvar MODEL_NAME = Alloy[value].MODEL_NAME;\r\n{code}\r\n\r\nIt's perfectly valid JS, but our optimizer won't catch it and it will return {{undefined}} for {{MODEL_NAME}}. I think this needs to be a runtime assignment and I'm not sure offhand how to do that for a property without loading all the models, collections, components, and widgets at application load time. The function syntax seems to be the only way to defer the loading of these modules.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-17T11:14:34.000+0000", "updated": "2012-07-17T11:14:34.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }