{ "id": "176204", "key": "TIMOB-28461", "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": "21199", "description": "", "name": "Release 10.0.1", "archived": false, "released": true, "releaseDate": "2021-07-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2021-07-28T15:07:40.000+0000", "created": "2021-05-28T23:15:32.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "build", "hyperloop", "iOS", "liveview" ], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-07-28T15:07:40.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "*Summary:*\r\nRunning an iOS app with LiveView will cause runtime exceptions when modifying a JS file using hyperloop.\r\n_(This works on Android as of Titanium 9.0.0 and we'd like to do the same on iOS.)_\r\n\r\n*Cause:*\r\nWhile the app is being built, hyperloop will string replace all {{require}}/{{import}} calls which reference a native Objective-C/Swift type with the hyperloop JS file which wraps that native type. This works fine for normal builds since the modified JS file is written to the app bundle. But this {{require}}/{{import}} string replacement does not happen with LiveView, causing the module lookup to fail.\r\n\r\n*Recommended Solution:*\r\nModify the hyperloop build hook to not modify the JS source files anymore. Instead, create a bootstrap script (which is ran before the \"app.js\") that defines the require/import bindings between native types to the actual hyperloop JS file. The below is how Android handles it.\r\n[generate-sources-task.js|https://github.com/appcelerator/hyperloop.next/blob/f98983db8aa19b73e2ec5458e04589cda900af2e/android/hooks/tasks/generate-sources-task.js#L208-L235]\r\n\r\n*Limitations:*\r\nDo the following while LiveView is running still won't be supported. The below requires a native rebuild to integrate them into the app.\r\n* Adding libraries.\r\n* Adding {{Hyperloop.defineClass()}} method calls. _(Involves native code generation.)_\r\n", "attachment": [], "flagged": false, "summary": "iOS: Support running LiveView with Hyperloop", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "458726", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (hyperloop.next): https://github.com/appcelerator/hyperloop.next/pull/351\r\n\r\nAlso below PR fixes regression in above PR...\r\nPR (hyperloop.next): https://github.com/appcelerator/hyperloop.next/pull/355", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-05-29T00:00:42.000+0000", "updated": "2021-06-29T05:07:48.000+0000" }, { "id": "458798", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/12905", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-06-17T22:30:50.000+0000", "updated": "2021-06-17T22:30:50.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }