{ "id": "171011", "key": "TIMOB-25740", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "19882", "name": "Release 8.0.0", "archived": false, "released": true, "releaseDate": "2019-03-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-01-08T14:52:48.000+0000", "created": "2018-02-01T09:26:23.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [ { "id": "56939", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "171773", "key": "TIMOB-26117", "fields": { "summary": "iOS: ES6 promises not supported on iOS 9. (Works on iOS 8 and 10.)", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "58120", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "166898", "key": "TIMOB-24549", "fields": { "summary": "TiAPI: Add support for Promises", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "6", "description": "gh.issue.epic.desc", "name": "Epic", "subtask": false } } } } ], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-04-06T09:16:13.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": "10202", "name": "Android", "description": "Android Platform" }, { "id": "10206", "name": "iOS", "description": "iOS Platform" }, { "id": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "We added support for ES6 and later in the latest 7.1.0 changes, which is *awesome*! The only thing missing is the support for using async/await in Titanium code.\r\n\r\nHere is an example (taken from my sample-project):\r\n{code:js}\r\n someOtherMethod() {\r\n this._getUserLocation();\r\n }\r\n\r\n async _getUserLocation() {\r\n // FIXME: Current throws, work in progress!\r\n const coordinates = await Ti.Geolocation.getCurrentPosition(event => {\r\n return new Promise(resolve => {\r\n resolve(event.coords);\r\n });\r\n });\r\n alert(`Found location! Latitude: ${coordinates.latitude}, Longitude: ${coordinates.longitude}`);\r\n }\r\n{code}\r\nThe full sample can be found [here|https://github.com/hansemannn/titanium-es6-sample/blob/master/Resources/src/application.js#L84-L94]. It is throwing an \"Cannot find regeneratorRuntime\" error when calling the method, which looks like a Babel error that occurs when certain transform-plugins are missing. \r\n\r\nWe use the babel-preset-env, which should already support it by having a dependency on [babel-plugin-transform-async-to-generator|https://www.npmjs.com/package/babel-plugin-transform-async-to-generator] but for some reasons it does not work. \r\n\r\nImportant to say is also that I may be doing something wrong, so let me know if thats the case!", "attachment": [], "flagged": false, "summary": "TiAPI: Add support for async/await", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "closedSprints": [ { "id": 1176, "state": "closed", "name": "2020 Sprint 1", "startDate": "2020-01-02T21:15:56.301Z", "endDate": "2020-01-17T21:15:00.000Z", "completeDate": "2020-01-21T17:44:29.577Z", "originBoardId": 114 }, { "id": 1177, "state": "closed", "name": "2020 Sprint 2", "startDate": "2020-01-20T17:44:37.733Z", "endDate": "2020-01-31T17:44:00.000Z", "completeDate": "2020-01-31T16:57:44.689Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "435817", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{{async await}} supported can be added by including the [ti.es6|https://github.com/appcelerator/ti.es6] plugin", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-21T21:20:52.000+0000", "updated": "2018-03-21T21:20:52.000+0000" }, { "id": "438374", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/node-titanium-sdk/pull/32\r\n\r\n*TEST CASE*\r\n{code:js}\r\nconst win = Ti.UI.createWindow({\r\n backgroundColor: 'gray'\r\n }),\r\n view = Ti.UI.createView({\r\n backgroundColor: 'red',\r\n width: 200,\r\n height: 200\r\n }),\r\n matrix = Ti.UI.create2DMatrix({\r\n rotate: 90\r\n }),\r\n animation = Ti.UI.createAnimation({\r\n transform: matrix,\r\n duration: 3000\r\n }),\r\n animate = (view, animation) => {\r\n return new Promise(resolve => view.animate(animation, resolve));\r\n };\r\n\r\nwin.addEventListener('postlayout', async () => {\r\n await animate(view, animation);\r\n view.backgroundColor = 'orange';\r\n alert('DONE ANIMATION!');\r\n});\r\n\r\nwin.add(view);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-12T22:19:53.000+0000", "updated": "2018-06-12T22:20:38.000+0000" }, { "id": "452050", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "This should be resolved by now.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-10-15T08:50:43.000+0000", "updated": "2019-10-15T08:50:43.000+0000" }, { "id": "453503", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Do we have a ticket for the \"real\" async/await in native Ti methods? Replacing callbacks with methods returning a promise? I think Gary had a \"ti.es6\" cli hook that did that on a JS level, but this could likely be done natively as well!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-01-08T15:07:48.000+0000", "updated": "2020-01-08T15:07:48.000+0000" }, { "id": "453852", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "[~hknoechel] we're repurposing TIMOB-24549 as an overarching epic for that. So I'm going to close this ticket out", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2020-01-28T15:21:04.000+0000", "updated": "2020-01-28T15:21:04.000+0000" }, { "id": "458508", "author": { "name": "bgarcia", "key": "bgarcia", "displayName": "Brian García", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Currently, this is unusable with liveview", "updateAuthor": { "name": "bgarcia", "key": "bgarcia", "displayName": "Brian García", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-03-31T08:31:32.000+0000", "updated": "2021-03-31T08:31:32.000+0000" }, { "id": "458530", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "[~bgarcia] could you please file a new ticket with the details of the issue", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2021-04-06T09:16:13.000+0000", "updated": "2021-04-06T09:16:13.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }