{ "id": "144302", "key": "TIMOB-18517", "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": null, "resolutiondate": null, "created": "2015-02-05T15:25:24.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [ { "id": "48180", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "149061", "key": "TIMOB-19067", "fields": { "summary": "Windows: Move forward and reverse geocoder implementations into TitaniumKit", "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 } } } } ], "assignee": null, "updated": "2018-02-28T19:54:48.000+0000", "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" } }, "components": [ { "id": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "From https://github.com/appcelerator/titanium_mobile_windows/pull/110#discussion_r24169482\r\n\r\nIt looks to me like we could implement GlobalObject and require entirely cross-platform, but it'd have to defer to using Ti.Filesystem API. Right now that requires us to jump into JS to do so:\r\n{code:cpp}\r\nJSValue Titanium_property = get_context().get_global_object().GetProperty(\"Titanium\");\r\nJSObject Titanium = static_cast(Titanium_property);\r\n\r\nJSValue FS_property = Titanium.GetProperty(\"Filesystem\");\r\nJSObject FS = static_cast(FS_property);\r\n\r\nJSValue File_property = FS.GetProperty(\"File\");\r\nJSObject File = static_cast(File_property);\r\n\r\nauto file = File.CallAsConstructor(path);\r\n\r\nJSValue resolve_property = file.GetProperty(\"resolve\");\r\nJSObject resolve = static_cast(resolve_property);\r\n\r\nreturn resolve();\r\n{code}\r\n\r\nWe were reluctant to do so out of concern for performance/memory overhead of accessing the JS objects/properties/functions and then calling them (and marshaling the values back and forth between c++ types and JSValues).\r\n\r\nWhat is the actual performance overhead involved here? Is it small enough that a cross-platform implementation is of high importance? Is there a way we can use pure C++ and still do this cross-platform (i.e. can we still get a reference/defer to the platform specific implementation of File when we need to)?", "attachment": [], "flagged": false, "summary": "Windows: Investigate cross-platform require implementation in GlobalObject", "creator": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }