{ "id": "159265", "key": "TIMOB-23138", "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-06-10T08:05:06.000+0000", "created": "2016-04-02T09:26:31.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "notable", "parity" ], "versions": [ { "id": "17684", "name": "Release 5.2.1", "archived": false, "released": true, "releaseDate": "2016-03-25" } ], "issuelinks": [ { "id": "51722", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "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": "51723", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "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 } } } }, { "id": "51213", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "124137", "key": "TIMOB-16078", "fields": { "summary": "Implement full NodeJS require specs so we can use NPM for modules", "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": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } }, { "id": "53011", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "163704", "key": "TIMOB-23983", "fields": { "summary": "iOS Debugger: Breakpoint not hit for Alloy applications", "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": "2017-09-19T20:25:23.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" } ], "description": "Take the following app:\r\n\r\n*Resources/app.js*\r\n\r\n{code:js}\r\nTi.UI.createWindow().open();\r\nconsole.log(require('folder/foo').whoami);\r\n{code}\r\n\r\n*Resources/folder/foo.js*\r\n\r\n{code:js}\r\nexports.whoami = 'Resources/folder/foo.js';\r\nconsole.log(require('foo').whoami);\r\n{code}\r\n\r\n*Resources/foo.js*\r\n\r\n{code:js}\r\nexports.whoami = 'Resources/foo.js';\r\n{code}\r\n\r\nOn iOS the console will be:\r\n\r\n{code}\r\n[DEBUG] Loading: /Users/fokkezb/Library/Developer/CoreSimulator/Devices/C7ECC4A2-E0F1-4248-B51E-5873696E719E/data/Containers/Bundle/Application/080A078B-81C0-4C7B-95FD-C994909390C0/req.app/app.js, Resource: app_js\r\n[DEBUG] Loading: /Users/fokkezb/Library/Developer/CoreSimulator/Devices/C7ECC4A2-E0F1-4248-B51E-5873696E719E/data/Containers/Bundle/Application/080A078B-81C0-4C7B-95FD-C994909390C0/req.app/folder/foo.js, Resource: folder/foo_js\r\n[DEBUG] Loading: /Users/fokkezb/Library/Developer/CoreSimulator/Devices/C7ECC4A2-E0F1-4248-B51E-5873696E719E/data/Containers/Bundle/Application/080A078B-81C0-4C7B-95FD-C994909390C0/req.app/foo.js, Resource: foo_js\r\n[INFO] Resources/foo.js\r\n[INFO] Resources/folder/foo.js\r\n{code}\r\n\r\nWhile on Android it will be:\r\n\r\n{code}\r\n[DEBUG] Module: Loading module: folder/foo -> Resources/folder/foo.js\r\n[INFO] Resources/folder/foo.js\r\n[INFO] Resources/folder/foo.js\r\n{code}\r\n\r\nThe [documentation|http://docs.appcelerator.com/platform/latest/#!/api/Global-method-require] does mention that only on Android you can use absolute and relative paths, but it does not say that it will always try to resolve relative to the current directory first.\r\n\r\nI'd expect Android to work as iOS and *not* attempt to resolve relative to the current directory first.\r\n\r\nIdeally we'd resolve this as part of TIMOB-16078", "attachment": [], "flagged": false, "summary": "Parity: On Android require() tries current folder first", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": null, "closedSprints": [ { "id": 641, "state": "closed", "name": "2016 Sprint 12 SDK", "startDate": "2016-06-04T00:30:28.612Z", "endDate": "2016-06-18T00:30:00.000Z", "completeDate": "2016-06-20T04:25:16.065Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "388010", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "FT passed. PR APPROVED!", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-06-10T05:55:00.000+0000", "updated": "2016-06-10T08:03:23.000+0000" }, { "id": "388016", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~bimmel] see description on 'documentation'. needs to be updated.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-06-10T08:05:38.000+0000", "updated": "2016-06-10T08:05:38.000+0000" }, { "id": "388052", "author": { "name": "bimmel-defective", "key": "bimmel", "displayName": "(deactived) Brian Immel", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Thanks for the heads up [~cng]. I'll add this to the docs when we get to 6.0.0 release.", "updateAuthor": { "name": "bimmel-defective", "key": "bimmel", "displayName": "(deactived) Brian Immel", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-06-10T14:08:40.000+0000", "updated": "2016-06-10T14:08:40.000+0000" }, { "id": "393343", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix.\r\n\r\nAndroid does not attempt to resolve relative to the current directory first.\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 4.7.0.201607250649\r\nTi SDK : 6.0.0.v20160816021339\r\nTi CLI : 5.0.9\r\nAlloy : 1.9.1\r\nMAC El Capitan : 10.11.6\r\nAppc NPM : 4.2.7\r\nAppc CLI : 6.0.0-24\r\nNode: 4.4.4\r\nNexus 6 - Android 6.0.1", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-08-16T22:31:49.000+0000", "updated": "2016-08-16T22:31:49.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }