{ "id": "155746", "key": "TIMOB-20567", "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": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2018-04-19T10:45:30.000+0000", "created": "2016-03-15T12:49:12.000+0000", "epic": { "id": 154964, "key": "TIMOB-20416", "name": "Support Hyperloop modules", "summary": "Support Hyperloop modules in Titanium Mobile", "color": { "key": "color_8" }, "done": false }, "priority": { "name": "High", "id": "2" }, "labels": [ "frameworks", "hyperloop", "ios" ], "versions": [], "issuelinks": [ { "id": "51470", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "159778", "key": "TIMOB-23266", "fields": { "summary": "Android: Hyperloop: Allow requiring java package to access types", "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": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": null, "updated": "2018-08-02T22:20:02.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": "13715", "name": "Hyperloop", "description": "Hyperloop project" }, { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Currently, when we want to use a {{UILabel}} with Hyperloop, we need to require it the following way:\r\n*iOS*:\r\n{code:javascript}\r\nvar UILabel = require(\"UIKit/UILabel\");\r\n{code}\r\nNow if we want to use another class from the {{UIKit}} framework e.g. {{UIView}}, we need to do:\r\n{code:javascript}\r\nvar UIView = require(\"UIKit/UIView\");\r\n{code}\r\n\r\nThe approach is to make it possible to require frameworks like we do it in Swift/Objective-C and expose the available classes automatically:\r\n{code:javascript}\r\nrequire(\"UIKit\"); // Can we do this require-statement anonymously?\r\n\r\nvar view = new UIView();\r\nvar label = new UILabel();\r\n{code}\r\nIn addition, Alloy does a similar kind of pre-processing to expose variables like {{OS_IOS}} and {{arguments}} in new controllers.", "attachment": [], "flagged": false, "summary": "Hyperloop: Allow class usage with only the framework being required", "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": 1058, "state": "closed", "name": "2018 Sprint 16 SDK", "startDate": "2018-07-29T22:26:06.486Z", "endDate": "2018-08-12T22:26:00.000Z", "completeDate": "2018-08-13T17:38:16.757Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "379739", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "/cc [~penrique] & [~jhaynie]", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-03-15T12:52:51.000+0000", "updated": "2016-03-15T12:52:51.000+0000" }, { "id": "379755", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "Something else to consider: What about ES6 module import syntax?\r\n\r\n{code:javascript}\r\nimport { UILabel, UIView } from 'UIKit';\r\n{code}", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-03-15T15:46:38.000+0000", "updated": "2016-03-15T15:46:38.000+0000" }, { "id": "379795", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~cwilliams] +1, we focus ES6 for 6.0.0. Would need to shift the issue then. Discussions welcome.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-03-15T22:49:18.000+0000", "updated": "2016-03-15T22:49:18.000+0000" }, { "id": "382584", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I just thought of wildcard patterns like \r\n{code:javascript}\r\nvar view = require(\"android.view.*\")\r\n{code}\r\nin Android, but that's not good practice right? Are there API's where package wildcards would make access?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-13T11:39:06.000+0000", "updated": "2016-04-13T11:39:06.000+0000" }, { "id": "382616", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "It's fairly standard practice to use wildcards in java package imports. Most IDEs/tooling automatically expand it out the the actual types you use, so that the wildcard isn't used - probably just to be more specific/improve performance.\r\n\r\nSo I think it would make sense to do an ES6 style import with a wildcard:\r\n{code:javascript}\r\nimport { View, Gravity } from 'android.view.*';\r\nimport { List, Map } from 'java.util.*';\r\n{code}\r\n\r\nfor ES5 syntax? I guess we'd have to have the require return an object with type names as keys inside it:\r\n{code:javascript}\r\nvar ViewPackage = require('android.view.*'),\r\n View = ViewPackage.View,\r\n Gravity = ViewPackage.Gravity;\r\n{code}", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-04-13T16:57:16.000+0000", "updated": "2016-04-13T16:57:16.000+0000" }, { "id": "382617", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "BTW, I'd suggest that this ticket be cloned out for the android implementation vs iOS implementation.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-04-13T16:58:02.000+0000", "updated": "2016-04-13T16:58:02.000+0000" }, { "id": "383652", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "You are right, that are two different cases. Do we want to put this in 5.4.0 already or 6.0.0? ", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-22T08:12:52.000+0000", "updated": "2016-04-22T08:12:52.000+0000" }, { "id": "436992", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Resolving as {{Won't Fix}} since we have ES6 support in Hyperloop 3.1.0 and later already, which can be used for module based import of native frameworks, classes and enums.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-04-19T10:45:30.000+0000", "updated": "2018-04-19T10:45:30.000+0000" }, { "id": "439718", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing old \"Won't fix\" tickets. If you disagree, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-02T22:20:02.000+0000", "updated": "2018-08-02T22:20:02.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }