{"action":"created","issue":{"url":"https://api.github.com/repos/eclipsesource/tabris-js/issues/1371","repository_url":"https://api.github.com/repos/eclipsesource/tabris-js","labels_url":"https://api.github.com/repos/eclipsesource/tabris-js/issues/1371/labels{/name}","comments_url":"https://api.github.com/repos/eclipsesource/tabris-js/issues/1371/comments","events_url":"https://api.github.com/repos/eclipsesource/tabris-js/issues/1371/events","html_url":"https://github.com/eclipsesource/tabris-js/issues/1371","id":234489806,"number":1371,"title":"Handle file paths consistently across APIs and platforms","user":{"login":"tbuschto","id":527303,"avatar_url":"https://avatars2.githubusercontent.com/u/527303?v=3","gravatar_id":"","url":"https://api.github.com/users/tbuschto","html_url":"https://github.com/tbuschto","followers_url":"https://api.github.com/users/tbuschto/followers","following_url":"https://api.github.com/users/tbuschto/following{/other_user}","gists_url":"https://api.github.com/users/tbuschto/gists{/gist_id}","starred_url":"https://api.github.com/users/tbuschto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbuschto/subscriptions","organizations_url":"https://api.github.com/users/tbuschto/orgs","repos_url":"https://api.github.com/users/tbuschto/repos","events_url":"https://api.github.com/users/tbuschto/events{/privacy}","received_events_url":"https://api.github.com/users/tbuschto/received_events","type":"User","site_admin":false},"labels":[{"id":112404150,"url":"https://api.github.com/repos/eclipsesource/tabris-js/labels/feature","name":"feature","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/eclipsesource/tabris-js/milestones/22","html_url":"https://github.com/eclipsesource/tabris-js/milestone/22","labels_url":"https://api.github.com/repos/eclipsesource/tabris-js/milestones/22/labels","id":1920825,"number":22,"title":"2.0","description":null,"creator":{"login":"tbuschto","id":527303,"avatar_url":"https://avatars2.githubusercontent.com/u/527303?v=3","gravatar_id":"","url":"https://api.github.com/users/tbuschto","html_url":"https://github.com/tbuschto","followers_url":"https://api.github.com/users/tbuschto/followers","following_url":"https://api.github.com/users/tbuschto/following{/other_user}","gists_url":"https://api.github.com/users/tbuschto/gists{/gist_id}","starred_url":"https://api.github.com/users/tbuschto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbuschto/subscriptions","organizations_url":"https://api.github.com/users/tbuschto/orgs","repos_url":"https://api.github.com/users/tbuschto/repos","events_url":"https://api.github.com/users/tbuschto/events{/privacy}","received_events_url":"https://api.github.com/users/tbuschto/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":52,"state":"open","created_at":"2016-08-03T14:17:15Z","updated_at":"2017-06-30T11:27:18Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2017-06-08T11:02:19Z","updated_at":"2017-06-30T11:32:09Z","closed_at":null,"body":"All APIs offered by tabris that deal with file paths should behave in the same way, on all platforms. This should improve cross-platform compatibility, avoid confusion, allow the app to use downloaded files as a resource and read bundled files via `fs`.\r\n\r\nI suggest these basic rules that would should not cause any breaking changes:\r\n - All paths not starting with `/` are relative to the directory containing `package.json`. These files are \"bundled\" and read-only. Paths pointing outside this directory (e.g. `../foo.dat`) are invalid. (see #1210, #722)\r\n - All paths starting with `/` are \"relative\" to a os-specific root directory. Known directories can be retrieved from `fs` string properties (currently `filesDir` and `cacheDir`), which include the root slash. These directories have write-access unless noted otherwise.\r\n\r\nThe following of APIs should honor these rules:\r\n * `fs` - All methods that take a path. These are not URIs, the strings start directly with the path.\r\n * `fetch`and `XMLHttprequest`. These are URIs, so if the path is absolute it should start with a scheme, e.g. `file://`, -> `file://${fs.filesDir}/foo.dat`.\r\n * Widgets, i.e. `Video.url` (see #1312), `WebView.url`, all `image` properties. Since these also accept `http` URLs, absolute paths should probably include a scheme, just like `fetch`/`XMLHttpRequest`.\r\n * `app.getResourceLocation`: This should convert a relative paths to absolute URLs, so including `http://` or `file://`. Not sure what this would be needed for though. (see below)\r\n\r\nWe could also directly support the Cordova scheme `cdvfile`, (https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/index.html#cdvfile-protocol) for bundled resources only, which could easy the use of e.g. the media plugin.\r\n\r\nMaking our absolute paths (non-bundled files) Cordova compatible would probably be more difficult, at least on windows. The file system layouts they describe (https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/index.html#file-system-layouts) do not match our rules. May be `app.getResourceLocation` (or another method) could convert to their system."},"comment":{"url":"https://api.github.com/repos/eclipsesource/tabris-js/issues/comments/312244470","html_url":"https://github.com/eclipsesource/tabris-js/issues/1371#issuecomment-312244470","issue_url":"https://api.github.com/repos/eclipsesource/tabris-js/issues/1371","id":312244470,"user":{"login":"tbuschto","id":527303,"avatar_url":"https://avatars2.githubusercontent.com/u/527303?v=3","gravatar_id":"","url":"https://api.github.com/users/tbuschto","html_url":"https://github.com/tbuschto","followers_url":"https://api.github.com/users/tbuschto/followers","following_url":"https://api.github.com/users/tbuschto/following{/other_user}","gists_url":"https://api.github.com/users/tbuschto/gists{/gist_id}","starred_url":"https://api.github.com/users/tbuschto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbuschto/subscriptions","organizations_url":"https://api.github.com/users/tbuschto/orgs","repos_url":"https://api.github.com/users/tbuschto/repos","events_url":"https://api.github.com/users/tbuschto/events{/privacy}","received_events_url":"https://api.github.com/users/tbuschto/received_events","type":"User","site_admin":false},"created_at":"2017-06-30T11:32:09Z","updated_at":"2017-06-30T11:32:09Z","body":"This has been achieved to a degree that I would consider satisfactory for 2.0 - see https://github.com/eclipsesource/tabris-js/issues/1391\r\n\r\nWhat's missing is fetch/XHR support for file URIs and possibly support for paths in Video and WebView, and likely Cordova integration via `app.getResourceLocation` "}}
{"actor":{"display_login":"tbuschto"}}