{ "id": "94486", "key": "TIMOB-9893", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "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": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-06-11T15:53:48.000+0000", "created": "2012-07-05T16:47:25.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "core", "parity" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "issuelinks": [ { "id": "18549", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "92653", "key": "TIMOB-9443", "fields": { "summary": "Ti API: Full CommonJS implementation", "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": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } }, { "id": "56598", "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": "18895", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "93264", "key": "TIMOB-9557", "fields": { "summary": "Android: Stack overflow when having commonJS circular reference", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "18745", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "85246", "key": "TIMOB-9669", "fields": { "summary": "iOS: Relative Pathing of Require'd CommonJS 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": "Low", "id": "4" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "updated": "2018-06-11T15:53:48.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": "10224", "name": "TiAPI", "description": "This component is used for cross-platform API work. Specifications are most likely to use this component." } ], "description": "Needs to implement the \"minispec\" for require() that was decided on by core:\r\n\r\n# Conform to commonjs spec: http://wiki.commonjs.org/wiki/Modules/1.1\r\n-> Testing to be https://github.com/commonjs/commonjs/tree/master/tests/modules\r\n# non-MW platforms throw an exception when confronted with async syntax\r\n-> {{ require([\"foo\"], callbackFunction); }}\r\n\r\nThere is also the possibility of:\r\n# Leading '/' not allowed in module names\r\n# Leading '/' always indicates a resource at the root of the project\r\n\r\nThis should be done for all platforms.", "attachment": [], "flagged": false, "summary": "TiAPI: CommonJS 1.1 compliance", "creator": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [ { "id": "94919", "key": "TIMOB-9936", "fields": { "summary": "TiAPI: Port Commonjs 1.0 tests to anvil", "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 } } } ], "reporter": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "202525", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Hello.\r\n\r\n\r\nI'm not sure about second point. The path is relative if it begins with \".\" or \"..\", otherwise is absolute. Hope that \"require\" will work even without leading slash.", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-07-10T23:56:12.000+0000", "updated": "2012-07-10T23:56:12.000+0000" }, { "id": "202530", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "On Mobile Web, require(\"/some/module\") and require(\"some/module\") are the same absolute path.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2012-07-11T00:31:16.000+0000", "updated": "2012-07-11T00:31:16.000+0000" }, { "id": "202705", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "If you have questions about how commonjs will work, read the linked specification. We will be following it exactly except for the root path addition.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-11T11:52:37.000+0000", "updated": "2012-07-11T11:52:37.000+0000" }, { "id": "202869", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "I don't have questions regarding CommonJs, but I'm a bit worried about root path addition. If scripts that uses that addition will work in other JS environments that supports CommonJs specification (which is the point of CommonJs), then OK, the problem does not exist. But will they work? I haven't worked much in other CommonJs environments, but for example, in NodeJs \"require('console')\" works, but \"require('/console')\" does not work.\r\n\r\n\r\nI don't see the point in having addition (that copies existing functionality) that could cause scripts not to work in other CommonJs environments.", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-07-12T01:07:02.000+0000", "updated": "2012-07-12T01:07:02.000+0000" }, { "id": "202933", "author": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It's not actually an addition. Titanium has supported a forward slash to indicate absolute on Android and iOS for a long time, for better or worse, and changing that behavior now would break a lot of existing apps. Titanium is the only platform I am aware of that supports forward slash in a require.", "updateAuthor": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-12T09:15:02.000+0000", "updated": "2012-07-12T09:15:02.000+0000" }, { "id": "202963", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "I'm all for removing support for the '/' in module ids. It's not standard. Mobile Web resisted supporting this for quite a while before we caved. Removing support is 2 small changes. Then any module id that starts with '/' would signify a resource file such as require('/some/file.js').\r\n\r\nHow about we detect and show a deprecation message if someone tries to use a '/' in a module id?", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2012-07-12T11:11:33.000+0000", "updated": "2012-07-12T11:11:33.000+0000" }, { "id": "203055", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Bryan -\r\n\r\nYes, it is an addition. In fact iOS doesn't support it because it had to be added in a recent PR.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-12T16:22:31.000+0000", "updated": "2012-07-12T16:22:31.000+0000" }, { "id": "203089", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Brake of existing apps shouldn't be big issue because it is not hard task to remove leading slash (everyone should be able to do that within 1 minute). A deprecation message is fine, but IMO unnecessary because leading slash in module id should be considered as a bug and not as a feature.", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-07-13T00:28:56.000+0000", "updated": "2012-07-13T00:28:56.000+0000" }, { "id": "394098", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "[~cwilliams] You worked on some of the {{require()}} behavior, right? Can you say that we have fixed this issue? Do we have correctly load module where the module id begins and does not begin with a '/'? All of the scoping works? Requiring modules with relative paths work correctly?", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2016-08-24T14:05:31.000+0000", "updated": "2016-08-24T14:05:31.000+0000" }, { "id": "438287", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "Marking as closed/fixed as we implemented this behavior as well as node-compatible require in TIMOB-16078 in the 6.0.0 timeframe.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2018-06-11T15:53:48.000+0000", "updated": "2018-06-11T15:53:48.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }