{ "id": "111597", "key": "TIMOB-13193", "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": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2014-03-31T21:56:54.000+0000", "created": "2013-03-25T09:52:58.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "android", "axe", "include", "ios", "js", "module" ], "versions": [], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-22T22:53:04.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": "Thanks to TIMOB-9317 we now are able to require submodules inside modules\r\n\r\nNow it would nice to be able to use Ti.include with module compiled js files.\r\n\r\nh2. Test Steps\r\n\r\nh3. Module build\r\n# Create a new module project for Android/ios with the id com.foo.bar.\r\n# Download the attached assets.zip\r\n# Unzip assets.zip in the directory of the new module project\r\n# Run ant to build the module.\r\n\r\nh3. Project\r\n# Download the attached tic2043.zip and unzip it.\r\n# Import the resulting directory into TiStudio\r\n# Run project\r\n\r\nh3. Pass:\r\n# The test is simple, if you see \"woo :)\" in the console then it worked!\r\n", "attachment": [ { "id": "36616", "filename": "assets.zip", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2013-03-25T11:22:55.000+0000", "size": 677, "mimeType": "application/zip" }, { "id": "36617", "filename": "tic2043.zip", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2013-03-25T11:22:55.000+0000", "size": 2362468, "mimeType": "application/zip" } ], "flagged": false, "summary": "TiAPI: Native JS module: support Ti.include", "creator": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium 3.1.0 master\r\nios sdk 6.1\r\nandroid sdk 4.1", "comment": { "comments": [ { "id": "243894", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "h1. Testing\r\n\r\nh2. Module build\r\nCreate a new module project for Android/ios with the id com.foo.bar.\r\nDownload the attached assets.zip\r\nunzip assets.zip in the directory of the new module project\r\nrun ant to build the module.\r\n\r\nh2. Project\r\nDownload the attached tic2043.zip and unzip it.\r\nImport the resulting directory into TiStudio\r\nRun project\r\n\r\nh2. Pass:\r\nThe test is simple, if you see \"woo :)\" in the console then it worked!", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2013-03-25T11:19:03.000+0000", "updated": "2013-03-25T11:19:44.000+0000" }, { "id": "243970", "author": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is a new feature request. Changing as such. Thanks for the suggestion, engineering will take a look at it. \nRegards,\nCarter", "updateAuthor": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-25T18:38:51.000+0000", "updated": "2013-03-25T18:38:51.000+0000" }, { "id": "243971", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "Sorry you are right, wasnt on purpose :s", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2013-03-25T18:41:02.000+0000", "updated": "2013-03-25T18:41:02.000+0000" }, { "id": "244649", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "Ok working with that i realised it was trickier than i though. In fact i cant rely on the context to guess where to get the file (assets or native module).\r\nIt came to light while using the module. My native JS module has a method which will include a file. What you exepct is for the include to be looked for relatively from where the method was called and not relatively to the context.\r\nSo what i ended up doing is simply to allow include to \"look\" for module in the same way require does.\r\nTi.include('com.foo.bar/toto.js\"); will look for toto.js in the module com.foo.bar (as it exists and is loaded).\r\n\r\nIf you do \r\nTi.include('/toto.js\");\r\nor \r\nTi.include('./toto.js\");\r\nor\r\nTi.include('toto.js\");\r\n\r\ninside a module it will always look for the asset (like it was done before).\r\n\r\nI updated the test case to reflect all that\r\n\r\nI will post a pull request for that", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2013-03-29T14:49:33.000+0000", "updated": "2013-03-29T14:49:33.000+0000" }, { "id": "244650", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "Seems that now that it is a TIMOB ticket i cant modify it anymore :s\r\nSo here is the expected pass\r\n[object ComFooBarModule] loaded\r\n[INFO] : \b\b \b test1 from module com.foo.bar\r\n[INFO] : \b\b \b test1 from app\r\n[INFO] : \b\b \b module tested\r\n[INFO] : \b\b \b test1 from app\r\n[INFO] : \b\b \b test1 from module com.foo.bar\r\n\r\nNow for the assets, they need to be updated as the ones in the description are not good anymore :s\r\nyou can get them there\r\n[assets|https://dl.dropbox.com/u/255893/titanium/assets.zip]\r\n[tic2043|https://dl.dropbox.com/u/255893/titanium/tic2043.zip]", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2013-03-29T14:53:23.000+0000", "updated": "2013-03-29T14:53:23.000+0000" }, { "id": "244651", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "and here is the pull request https://github.com/appcelerator/titanium_mobile/pull/4028", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2013-03-29T15:15:24.000+0000", "updated": "2013-03-29T15:15:24.000+0000" }, { "id": "299408", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We have decided that we will be deprecating support to Ti.Include, so we don't want to extend support for this behavior.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-31T21:56:54.000+0000", "updated": "2014-03-31T21:56:54.000+0000" }, { "id": "415171", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as \"Won't Fix\".", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T22:53:04.000+0000", "updated": "2017-03-22T22:53:04.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }