{ "id": "169247", "key": "TIMOB-25057", "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": "19975", "name": "Hyperloop 3.1.0", "archived": false, "released": true } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-03-28T18:48:16.000+0000", "created": "2017-08-02T16:05:29.000+0000", "epic": { "id": 152521, "key": "TIMOB-19834", "name": "Support ES6 for Titanium Application Development", "summary": "Support ES6 for Titanium Application Development", "color": { "key": "color_1" }, "done": false }, "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "updated": "2018-03-28T18:48:16.000+0000", "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" } }, "components": [ { "id": "13715", "name": "Hyperloop", "description": "Hyperloop project" } ], "description": "We need to be able to handle es6 user code in hyperloop.\r\n\r\nI don't know if we have any issues around using uglify for any of the hooks we use, but I do know that we have an issue around our {{require}} detection if users starts using {{import}} instead.\r\n\r\nWe currently do some ugly regexp searching of the code to look for native {{require}} calls. We need to modify that regexp to find native {{import}} calls as well (or even use a real JS parser like babylon).\r\n\r\nWe should also consider if we can ease use of the hyperloop wrappers by allowing nice ES6 imports of frameworks/packages. i.e. in Android you can require a Java package and access types off of the returned object. Do we need to do anything special to support something like this?\r\n{code:javascript}\r\nimport { ArrayList, Calendar } from 'java.util';\r\n{code}", "attachment": [], "flagged": false, "summary": "Hyperloop: Support ES6 user code", "creator": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "environment": null, "closedSprints": [ { "id": 997, "state": "closed", "name": "2018 Sprint 03 SDK", "startDate": "2018-01-28T16:23:12.178Z", "endDate": "2018-02-11T16:23:00.000Z", "completeDate": "2018-02-12T04:22:49.354Z", "originBoardId": 114 }, { "id": 1018, "state": "closed", "name": "2018 Sprint 07 SDK", "startDate": "2018-03-25T21:59:36.637Z", "endDate": "2018-04-08T21:59:00.000Z", "completeDate": "2018-04-08T17:55:14.467Z", "originBoardId": 114 }, { "id": 1008, "state": "closed", "name": "2018 Sprint 06 SDK", "startDate": "2018-03-11T22:18:04.396Z", "endDate": "2018-03-25T22:18:00.000Z", "completeDate": "2018-03-25T21:52:36.683Z", "originBoardId": 216 } ], "comment": { "comments": [ { "id": "433995", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Proposed functionality (by [~cwilliams] from the [PR|https://github.com/appcelerator/hyperloop.next/pull/270]):\r\niOS:\r\n{code:js}\r\n// types\r\nvar UIAlertController = require('UIKit/UIAlertController');\r\nimport UIAlertController from 'UIKit/UIAlertController';\r\nimport * as UIAlertController from 'UIKit/UIAlertController';\r\n// types from frameworks\r\nimport { UIAlertController, UIView } from 'UIKit';\r\n// builtins/methods/whatever from frameworks\r\nvar CGRectMake = require('CoreGraphics/CoreGraphics').CGRectMake;\r\nvar CGRectMake = require('CoreGraphics').CGRectMake;\r\nimport { CGRectMake, CGAffineTransformRotate } from 'CoreGraphics';\r\n\r\n// invalid/ambiguous/unsupported?\r\nimport UIView from 'UIKit';\r\n// are they trying to import UIKit/UIKit and alias it as 'UIView'?\r\n// Or import UIView from 'UIKit/UIView';?\r\n{code}\r\n\r\nAndroid:\r\n{code:js}\r\n// types\r\nvar Activity = require('android.app.Activity');\r\nimport Activity from 'android.app.Activity';\r\nimport * as Activity from 'android.app.Activity';\r\n// packages\r\nimport { ArrayList, Calendar } from 'java.util.*';\r\nvar javaUtil = require('java.util.*');\r\nvar ArrayList = javaUtil.ArrayList;\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-02-03T11:57:55.000+0000", "updated": "2018-02-03T11:57:55.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }