[jira] [Commented] (CB-12715) File - KEEP
[ https://issues.apache.org/jira/browse/CB-12715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16099075#comment-16099075 ] Filip Maj commented on CB-12715: Didn't know binary blobs in IndexedDB was a thing ;) - I'll play around with that approach, just ensuring there's a transition path available. Looks like solid support for indexeddb lands in iOS 10 (caniuse mentions it is available in 9.3, but not in the webview and it is buggy in the browser). cordova-ios currently supports as far back as 9.3. Blobs are partially supported in Android 4.4 (w/ prefix and via the now-deprecated {{BlobBuilder}} interface). That seems close enough to me. So fleshing out some things on next steps, here is what I have got so far: - remove a bunch of APIs, specifically: -- {{window.requestFileSystem}} method, {{LocalFileSystem}} object -- {{Flags}} object? -- {{Metadata}} object -- {{FileSystem}} object -- {{Entry}}, {{DirectoryEntry}} and {{FileEntry}} objects -- {{DirectoryReader}} object -- {{FileWriter}} object -- {{FileUploadOptions}}, {{FileUploadResult}} objects (wtf are these?) -- the {{FileError}} object, as the [latest spec says to return {{DOMException}}|https://w3c.github.io/FileAPI/#failureReason] - update a bunch of APIs, specifically: -- update {{FileReader}} interface's {{readAs*}} methods takes a {{Blob}} object instead of a {{File}} object -- if the polyfill is still needed, might need to update the {{File}} object and remove a bunch of extra native-y cruft like "type" and stuff that was used when leveraging the bridge -- update any error handling to return {{DOMException}} - possibly write up a polyfill for {{Blob}} ? Looks like it will be needed in Android 4.4 or lower. - possibly write up a polyfill for {{FileList}} (as per [spec|https://w3c.github.io/FileAPI/#dfn-filelist]) - might be needed on iOS 9.3 / Android 4.4. Worth noting that the first descriptive text in the spec mentions this interface being "at risk" as it's basically a glorified array. - review docs on FileSystem bits. does this still apply? probably? there are also a few higher-level "storage" articles in cordova-docs. -- things like are still relevant right? -- worth calling out that the [File API defines its own URL scheme to use|https://w3c.github.io/FileAPI/#url]. does this then supercede the cordova custom ones like cdvfile:// and other protocols? -- review and update https://cordova.apache.org/docs/en/latest/cordova/storage/storage.html#indexeddb - it mentions some things like indexeddb has a 5MB storage, we should probably update it to mention it is supported in ios. -- review and update https://cordova.apache.org/docs/en/latest/cordova/storage/storage.html#filesystem-api -- how much of this documentation should reside in the File plugin docs vs. in the general "Storage" cordova docs, or perhaps even the platform docs? over half of the File plugin docs talk about filesystem formats and platform quirks therein. One thing worth noting is that platform implementations for a lot of the above may not be needed on iOS 10+ and Android 5.0+. Would need to check windows / edge support. > File - KEEP > --- > > Key: CB-12715 > URL: https://issues.apache.org/jira/browse/CB-12715 > Project: Apache Cordova > Issue Type: Sub-task > Components: cordova-plugin-file >Reporter: Shazron Abdullah >Assignee: Filip Maj > > See parent issue. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-12715) File - KEEP
[ https://issues.apache.org/jira/browse/CB-12715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16099021#comment-16099021 ] Simon MacDonald commented on CB-12715: -- I don't think IndexedDB has fallen flat on it's face. It seems to have pretty good support across the board: http://caniuse.com/#search=indexeddb Storing binary blogs in a DB is a time honored tradition. The Cache API is the one used by SW and support is as you said only in Chrome and FF. I understand support for Edge is coming soon and there have been some recent rumblings for Safari support. In the meantime we are polyfilling service workers on cordova-ios. There is nothing forcing them to upgrade from File plugin version X to File plugin version Y that supports the most up to date spec. We are providing them a better way forward by aligning them with the web. > File - KEEP > --- > > Key: CB-12715 > URL: https://issues.apache.org/jira/browse/CB-12715 > Project: Apache Cordova > Issue Type: Sub-task > Components: cordova-plugin-file >Reporter: Shazron Abdullah >Assignee: Filip Maj > > See parent issue. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-12715) File - KEEP
[ https://issues.apache.org/jira/browse/CB-12715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=1609#comment-1609 ] Filip Maj commented on CB-12715: IndexedDB has fallen flat on its face, and I'm not exactly sure about the other two APIs you mentioned. By Storage do you mean the [Web Storage API|https://www.w3.org/TR/webstorage/]? Not sure which Cache API, but if it's the one related to the ServiceWorkers, I think support for that is pretty barebones (Chrome and Firefox only) at the moment. Also unclear to me whether either webstorage or cache could handle binary data. Ideally, I'd like to have a transition in place for the functionality we're sunsetting for users. In this case, for file-writing operations, it seems like this functionality was abandoned by the specs. The question then shifts for me: is it more important to align with specs, or more important to provide users this kind of functionality? If the latter, then is it cordova's responsibility to provide that functionality, or is it sufficient to leave that to the community? > File - KEEP > --- > > Key: CB-12715 > URL: https://issues.apache.org/jira/browse/CB-12715 > Project: Apache Cordova > Issue Type: Sub-task > Components: cordova-plugin-file >Reporter: Shazron Abdullah >Assignee: Filip Maj > > See parent issue. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-12715) File - KEEP
[ https://issues.apache.org/jira/browse/CB-12715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16098616#comment-16098616 ] Simon MacDonald commented on CB-12715: -- Persisting files should probably be handled by one of the other API's like Storage, Cache or IndexDB. The FileWriter interface was deprecated in 2014. > File - KEEP > --- > > Key: CB-12715 > URL: https://issues.apache.org/jira/browse/CB-12715 > Project: Apache Cordova > Issue Type: Sub-task > Components: cordova-plugin-file >Reporter: Shazron Abdullah >Assignee: Filip Maj > > See parent issue. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-12715) File - KEEP
[ https://issues.apache.org/jira/browse/CB-12715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16097769#comment-16097769 ] Filip Maj commented on CB-12715: Sorry to resurrect this, but would this mean that we are turfing all file-writing operations, then? The current cordova file plugin is a mishmash of different specs, including the File API (linked above), as well as the old File System API (allowing traversal of directories) and FileWriter spec (which handles the writing). > File - KEEP > --- > > Key: CB-12715 > URL: https://issues.apache.org/jira/browse/CB-12715 > Project: Apache Cordova > Issue Type: Sub-task > Components: cordova-plugin-file >Reporter: Shazron Abdullah > > See parent issue. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org