{ "id": "160272", "key": "TIMOB-23383", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-07-14T04:43:46.000+0000", "created": "2016-05-16T17:21:03.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "17707", "name": "Release 5.3.0", "archived": false, "released": true, "releaseDate": "2016-06-04" } ], "issuelinks": [ { "id": "51700", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "160269", "key": "TIMOB-23381", "fields": { "summary": "Parity: Titanium CommonJS modules require'd differently than NodeJS require spec", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "51701", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "93177", "key": "TIMOB-9524", "fields": { "summary": "iOS: Support multiple JS files per module", "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": "Medium", "id": "3" }, "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } }, { "id": "51702", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "93705", "key": "TIMOB-9730", "fields": { "summary": "Android: Support multiple JS files per module", "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": "Medium", "id": "3" }, "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } }, { "id": "51721", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "160270", "key": "TIMOB-23382", "fields": { "summary": "Parity: Cannot require directory as done in NodeJS", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "updated": "2016-10-05T17:41:32.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" } ], "description": "Titanium CommonJS modules have a hard limit to effectively all be contained in a single JS file whose base name matches the module.id. If you have a CommonJS module, not only does it have to have an entry file matching the module id(TIMOB-23382), but that file will fail to require any other files relative to it.\r\n\r\nFor a simple example, I have a {{modules/commonjs/ti.commonjs.require/1.0.0}} folder and inside is:\r\n- {{ti.commonjs.require.js}}\r\n- {{main.js}}\r\n\r\nI can do {{require('ti.commonjs.require');}} from my Titanium app, and it'll load the {{modules/commonjs/ti.commonjs.require/1.0.0/ti.commonjs.require.js}} file (regardless of whether I have a package.json pointing to another file or an index.js file there). But if that file has a {{require('./main');}} it'll throw a Runtime error that it's unable to load the main.js module.", "attachment": [], "flagged": false, "summary": "Parity: Titanium CommonJS modules cannot require relative files", "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": 678, "state": "closed", "name": "2016 Sprint 14 SDK", "startDate": "2016-07-02T00:25:57.921Z", "endDate": "2016-07-16T00:25:00.000Z", "completeDate": "2016-07-18T03:18:29.729Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "385796", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "Just for testing sake, doing a {{require('main')}} or {{require('/main')}} as fails.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-05-16T17:29:41.000+0000", "updated": "2016-05-16T17:29:41.000+0000" }, { "id": "385825", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "On Android this appears to be the case because CommonJS modules are actually placed as a single file into the Resources folder of the generated app. One possible fix is to actually retain the module's full contents filtered down to just the *.js and *.json files, as a whole folder under the Resources folder?", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-05-16T20:27:20.000+0000", "updated": "2016-05-16T20:27:20.000+0000" }, { "id": "398155", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed, using:\r\nMacOS 10.12 (16A323)\r\nStudio 4.7.1.201609100950\r\nTi SDK 6.0.0.v20161005072811\r\nAppc NPM 4.2.7\r\nAppc CLI 6.0.0-55\r\nAlloy 1.9.2\r\nXcode 8.0 (8A218a)\r\n\r\nCommonJS modules can include relative files, without error (if specified as {{require('./main')}}). Tested by adding a log and require statement to a commonJS module then doing the same in the relative file. No errors were encountered and all logs were printed. Tested on both android and iOS simulators/emulators.", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-10-05T17:41:32.000+0000", "updated": "2016-10-05T17:41:32.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }