{ "id": "124137", "key": "TIMOB-16078", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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-07T18:32:42.000+0000", "created": "2013-12-23T08:07:55.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "breaking-change", "npm", "package.json", "require" ], "versions": [], "issuelinks": [ { "id": "57021", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "172628", "key": "TIMOB-26570", "fields": { "summary": "Node compatibility and developer experience", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "6", "description": "gh.issue.epic.desc", "name": "Epic", "subtask": false } } } }, { "id": "48760", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "150599", "key": "TIMOB-19392", "fields": { "summary": "Load JS files and image assets relative to a different codebase than resourcesDirectory", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } }, { "id": "51720", "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 } } } }, { "id": "53939", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "165255", "key": "TIMOB-24293", "fields": { "summary": "Alloy: iOS - Using require() without \"/\" prefix will try to load file relatively node_modules first, other unrelated logs and behavior changes", "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" }, "inwardIssue": { "id": "159265", "key": "TIMOB-23138", "fields": { "summary": "Parity: On Android require() tries current folder first", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "52049", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "161205", "key": "TIMOB-23543", "fields": { "summary": "TiAPI: require implementation uses incorrect __filename values", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "56598", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "94486", "key": "TIMOB-9893", "fields": { "summary": "TiAPI: CommonJS 1.1 compliance", "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": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } }, { "id": "50977", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "155148", "key": "TIMOB-20472", "fields": { "summary": "Allow require to find modules in node_modules, etc", "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": "52258", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "162040", "key": "ALOY-1509", "fields": { "summary": "Generate spec-compliant require calls", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "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": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "updated": "2018-11-16T15:42:06.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": "I know from [~jhaynie] that Hyperloop (and thus Ti.Next - likely Titanium 4.x) will support the full [NodeJS require specs|http://nodejs.org/api/modules.html] so to make it possible to use NPM as a package manager for all kinds of modules. This is also the direction ALOY-86 has been going, asking for widget dependency management.\r\n\r\nI open this ticket to request looking into the possibility of implementing this in Titanium 3.x already.\r\n\r\n* What are the obstacles to change the require implementation to require both JS and native modules from the local and global {{node_modules}} paths?\r\n* What does it take to get Alloy to loading e.g. widgets from local and global installed {{node_modules}}?\r\n* How should the builder copy in global {{node_modules}} to the project when it packages the app?\r\n\r\nI think this would spur and new wave of Titanium native/CommonJS modules and Alloy widgets, sync adapters etc that would really boost the platform, as well as making it easier to re-use proprietary components in multiple projects myself.\r\n\r\nUltimately, I think {{tiapp.xml}} and {{manifest}} could even be replaced by {{package.json}}?", "attachment": [], "flagged": false, "summary": "Implement full NodeJS require specs so we can use NPM for modules", "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": "Titanium 3.x", "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": "285828", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Makes sense. Moving this feature request to engineering for further evaluation.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-26T06:50:06.000+0000", "updated": "2013-12-26T06:50:06.000+0000" }, { "id": "285838", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Also see the blog I wrote about the fantastic implications of these features at http://www.tidev.io/2013/12/23/hyperloop-npm/", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2013-12-26T07:31:52.000+0000", "updated": "2013-12-26T07:31:52.000+0000" }, { "id": "285850", "author": { "name": "mattapperson", "key": "mattapperson", "displayName": "me@gmail.com", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I 1000% agree \"Ultimately, I think tiapp.xml and manifest could even be replaced by package.json\"", "updateAuthor": { "name": "mattapperson", "key": "mattapperson", "displayName": "me@gmail.com", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-26T15:41:39.000+0000", "updated": "2013-12-26T15:41:39.000+0000" }, { "id": "285876", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "I've thought about getting rid of tiapp.xml quite a bit and determined that we're better with it than without it.\n\n1. XML allows comments. This may not seem that important, but it is. People comment out and uncomment modules and flags all the time.\n2. XML allows attributes. This can be hacked in JSON, but XML attributes are pretty elegant.\n3. XML files can easily be validated against a schema.\n\nFurthermore, I'm cautious about mucking up the package.json. If the is a syntax error in the package.json, then we are going to get a ton of Jira tickets about NPM which is obviously not the problem. There doesn't seem to be any \"future reserved words\" in the package.json, so if we start using \"modules\" or something, then NPM decides to use that for something special, we're hosed.\n\nSo, my vote is to keep tiapp.xml around a while longer.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2013-12-26T18:27:53.000+0000", "updated": "2013-12-26T18:27:53.000+0000" }, { "id": "285883", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "I'm fine with tiapp.xml staying as long as package.json (NodeJS/NPM) compatible require is coming ;)", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2013-12-26T19:34:38.000+0000", "updated": "2013-12-26T19:34:38.000+0000" }, { "id": "288763", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Let me first begin by saying that I don't think any of this should be done before 4.0. These are major breaking changes, and while they could be introduced early through configuration settings (perhaps set a property in tiapp.xml that tells Titanium to use node.js-style requires), the core of Titanium needs to take care not to impact its current commonjs implementation within 3.X. I fully agree with \"my vote is to keep tiapp.xml around a while longer\"\n\nAs to [~cbarber]'s points:\n\n# From a technical perspective I don't think this is a big deal, and certainly doesn't outweigh the potential benefits of using the package.json format. The whole of the node.js community has lived without comments forever. That said, because they never had comments they are different than our developers who will have had comments and would have them taken away. There would undoubtedly be explanations to be made, but again, this seems a trivial bump to get used to in a major version transition. If we find it to be critical, it would be pretty easy to handle our own JSON parser for package.json that supports comments, but I would advise against it.\n# I don't understand what XML attributes provide that JSON properties don't, particularly considering that JSON properties can be any string.\n# JSON files are also easily validated. The difference between syntax validation and schema validation for what we use these configuration files is minimal enough that I don't see this be a blocker at all.\n\nWRT the reserved words and fitting Titanium's own configuration in there, we have a number of things we can do to make sure that this works. First off, we need to contact npm's maintainers and see what they think. Isaac has been very helpful in the past, so I just emailed him directly to see what his thoughts were. I'll find out if a sanctioned way of customizing the package.json exists, and if not, if we can get one in place. Given that they're going to finally try and monetize npm with npm Inc., I would think suggestions like this would be right up npm's alley. But I agree that we need this answer before we could even seriously consider it. ", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-19T16:02:08.000+0000", "updated": "2014-01-19T16:02:08.000+0000" }, { "id": "290611", "author": { "name": "mattapperson", "key": "mattapperson", "displayName": "me@gmail.com", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Could we get some official word on 3.x support so I know if it's worth my time to create a shim module?", "updateAuthor": { "name": "mattapperson", "key": "mattapperson", "displayName": "me@gmail.com", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-31T12:37:56.000+0000", "updated": "2014-01-31T12:37:56.000+0000" }, { "id": "290629", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "For 3.X support, it would not happen in the first half of 2014 at the earliest. If you'd like to take a stab at a shim module, it would be great.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-31T17:05:17.000+0000", "updated": "2014-01-31T17:05:17.000+0000" }, { "id": "370758", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~cng] I think this is worth considering for 6.0, depending on effort. Thoughts?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-11-18T22:39:06.000+0000", "updated": "2015-11-18T22:39:06.000+0000" }, { "id": "386564", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "Need to wait for https://github.com/appcelerator/titanium_mobile/pull/8004 until I'll then work on adding node_modules folder searching to our require implies for iOS/Android...", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-05-23T23:35:46.000+0000", "updated": "2016-05-23T23:35:46.000+0000" }, { "id": "386592", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "(y)(y)(y)(y)(y)(y)(y)", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-05-24T07:07:25.000+0000", "updated": "2016-05-24T07:07:25.000+0000" }, { "id": "387954", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "I'm still waiting on reviews for the PR that must be merged first. I'm going to push this ticket out to next sprint.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-06-09T17:01:52.000+0000", "updated": "2016-06-09T17:01:52.000+0000" }, { "id": "390019", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Tested the PR: https://github.com/appcelerator/titanium_mobile/pull/8075\r\nh4. Steps to test\r\n1. *appc new --classic*\r\n2. Obtain this module {{scapegoat}} from https://github.com/brentertz/scapegoat\r\n3. put the module in {{/Resources/node_modules/scapegoat}}\r\n4. put this in app.js\r\n{code}\r\nTi.UI.createWindow().open();\r\nvar scapegoat = require('scapegoat')\r\n escape = scapegoat.escape,\r\n unescape = scapegoat.unescape;\r\n\r\nvar html = '

Hello World

',\r\n escaped = escape(html),\r\n unescaped = unescape(escaped);\r\n \r\nalert('html: ' + html + '\\nescaped: ' + escaped + '\\nunescaped: ' + unescaped);\r\n{code}\r\n5. *appc run -p ios*\r\n\r\nh4. Expected Result\r\nAn alert will show with this result \r\n{code}\r\nhtml:

Hello World

\r\nescaped: <h1>Hello World</h1>\r\nunescaped:

Hello World

\r\n{code}\r\n\r\nRepeat with *appc -run -p android* you can get the same result\r\n", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-07-07T05:53:46.000+0000", "updated": "2016-07-07T05:53:46.000+0000" }, { "id": "390061", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "Merged to master.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-07-07T18:32:42.000+0000", "updated": "2016-07-07T18:32:42.000+0000" }, { "id": "393327", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the implementation in android & IOS.\r\n\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\r\niOS simulator: iPhone 6S 9.3", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-08-16T21:11:56.000+0000", "updated": "2016-08-16T21:11:56.000+0000" }, { "id": "403349", "author": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "body": "Following your guide cause this\r\n\r\n!https://d3vv6lp55qjaqc.cloudfront.net/items/0j2F080W0j3u0s3m3R1h/Bildschirmfoto%202016-12-14%20um%2008.31.57.png!", "updateAuthor": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-12-14T07:33:19.000+0000", "updated": "2016-12-14T07:33:19.000+0000" }, { "id": "403352", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~benutzername] Can you please post the specific code you are using?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-12-14T08:31:11.000+0000", "updated": "2016-12-14T08:31:11.000+0000" }, { "id": "403353", "author": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "body": "I'm using the exact example of [~cng]s last comment", "updateAuthor": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-12-14T08:41:09.000+0000", "updated": "2016-12-14T08:41:09.000+0000" }, { "id": "403358", "author": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "body": "Fixed. Problem is using tishadow which does not support node_modules in the Resources folder. Will file a ticket", "updateAuthor": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-12-14T10:44:15.000+0000", "updated": "2016-12-14T10:44:15.000+0000" } ], "maxResults": 25, "total": 25, "startAt": 0 } } }