Skip to content

Conversation

@Elchi3
Copy link
Collaborator

@Elchi3 Elchi3 commented Oct 23, 2024

This was originally added here: #1033 and it had a bunch of later additions in comments (which then got lost as we migrated to BCD tags).

Compare with the latest draft file: https://github.com/web-platform-dx/web-features/blob/main/features/draft/spec/fs.yml

I'm not sure if the correct way forward here is to use compute_from or to split some of this out to a new feature. Help appreciated.

@github-actions github-actions bot added the feature definition Creating or defining new features or groups of features. label Oct 23, 2024
@captainbrosset
Copy link
Contributor

I think these keys need to go into the file-system-access feature instead.

The File System Access API is more general than OPFS. In a way, OPFS is one implementation of the File System Access API, or rather, one way to use it.

The entry point for OPFS is navigator.storage.getDirectory() which gives you access to a directory where you can then read/write/manipulate directories and files, just like you would with the File System Access API. But this directory is per origin only, and the browser can choose to implement it any way it likes (including without using real files on disk).

File System Access API, in contrast, gives you access to the real files and folders on disk, and therefore multiple origins can access the same files if the user allows it.

I think we need to keep all of the filesystem handle interface stuff in the more general File System Access API feature, and leave OPFS mostly focused on the getDirectory method.

@Elchi3 Elchi3 changed the title Add more keys to OPFS Add more keys to File system access Oct 29, 2024
@Elchi3
Copy link
Collaborator Author

Elchi3 commented Oct 29, 2024

Thanks Patrick. I moved these keys to file-system-access instead then. Do we need to update the description?

Comment on lines 11 to 14
- api.FileSystemSyncAccessHandle.close.sync_version
- api.FileSystemSyncAccessHandle.flush.sync_version
- api.FileSystemSyncAccessHandle.getSize.sync_version
- api.FileSystemSyncAccessHandle.truncate.sync_version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some more reading, it seems like these FileSystemSyncAccessHandle things are just for OPFS.

MDN says this:

This class is only accessible inside dedicated Web Workers [...] for files within the origin private file system, which is not visible to end-users.

So I believe we should move these 4 keys to the OPFS feature instead.

@Elchi3 Elchi3 closed this Oct 29, 2024
@Elchi3 Elchi3 deleted the moar-opfs branch October 29, 2024 15:03
@Elchi3
Copy link
Collaborator Author

Elchi3 commented Oct 29, 2024

hm, I hit the wrong command here. Meant to force push but deleted the branch instead 😢
Seems like I can't come back to this PR, so please see #2104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature definition Creating or defining new features or groups of features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants