-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File system access API #1713
File system access API #1713
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! Left a comment with a suggestion.
caniuse: native-filesystem-api | ||
group: file-system | ||
compat_features: | ||
- api.DataTransferItem.getAsFileSystemHandle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might be part of a distinct thing, like https://caniuse.com/dragndrop. What do we lose by leaving it out of this feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's part of file system access, albeit of course it's also part of drag and drop. FWIW, we document it in the context of file system access at Google:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK @captainbrosset can you add a comment to this file saying something like the following?
api.DataTransferItem.getAsFileSystemHandle is likely to be part of a drag and drop feature, but it can't be in both features at once. See https://github.com/web-platform-dx/web-features/issues/1173 for details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving it out doesn't change the overall feature support data.
It's worth thinking about why it's here though. This method is an extension to the dragndrop feature which allows you to turn a dropped file/directory into a FileSystemHandle
, which then allows you to write to it, just like if you had opened it using showOpenFilePicker
instead.
Overall, I can think of 4 different ways to get access to a FileSystemHandle
, and using one of the show picker methods is just one of them:
- Using
showOpenFilePicker
orshowDirectoryPicker
. - Dropping the file on the browser window, and using
getAsFileSystemHandle
. - Registering the app as a file handler, via the web app manifest, and using
window.launchQueue.setConsumer()
to retrieve the file when the installed PWA is launched after double-clicking an associated file. - Retrieving the handle from IndexedDB storage.
I think this feature should not only cover the show methods, but also contain the various methods/interfaces that let you play with FileSystemHandle objects in code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDB requires having gone through either D&D or the picker methods. File handling could be an independent feature (OS integration), but I can also agree to it being part of overall file system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not objecting to its inclusion here. I just really want the https://github.com/web-platform-dx/web-features/issues/1173
text in the YAML file somewhere, because I think these file APIs are going to be rather central to figuring out BCD keys shared across multiple features. When it comes time to tackle that problem, I want breadcrumbs to the places where that's significant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I'll add a comment about this in here.
@tomayac I agree that File Handling should be its own separate feature.
Co-authored-by: Daniel D. Beck <daniel@ddbeck.com>
caniuse: native-filesystem-api | ||
group: file-system | ||
compat_features: | ||
- api.DataTransferItem.getAsFileSystemHandle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not objecting to its inclusion here. I just really want the https://github.com/web-platform-dx/web-features/issues/1173
text in the YAML file somewhere, because I think these file APIs are going to be rather central to figuring out BCD keys shared across multiple features. When it comes time to tackle that problem, I want breadcrumbs to the places where that's significant.
Adding a new entry for the File System Access API.
Spec: https://wicg.github.io/file-system-access/
Blog: https://developer.chrome.com/docs/capabilities/web-apis/file-system-access
MDN: https://developer.mozilla.org/en-US/docs/Web/API/File_System_API
Taking this opportunity to create a group to bundle this with OPFS.
Pinging @tomayac to take a look at the description I wrote and at the browser compat data, to double check that they seem correct.