mdn icon indicating copy to clipboard operation
mdn copied to clipboard

Add new "mode" option to FileSystemAccessFileHandle's createSyncAccessHandle and createWritable

Open nathanmemmott opened this issue 2 years ago • 9 comments

Proposal

As part of the New Locking Scheme to Enable Multiple Readers and Writers, a new "mode" option is added to both FileSystemAccessFileHandle's createSyncAccessHandle and createWritable functions.

Browser support

Chrome

  • Bug: https://crbug.com/1382215
  • Feature status: https://chromestatus.com/feature/5172892632875008
    • Shipping M121

Tasks

  • createSyncAccessHandle() method
    • [ ] Add "options" (FileSystemCreateSyncAccessHandleOptions dictionary) to Parameters
    • [ ] Describe the "mode" property, it's possible values ("readwrite", "readonly", "readwrite-unsafe"), and its default value ("readwrite").
  • createWritable() method
    • [ ] Add the "mode" property to "options".
    • [ ] Describe it, its possible values ("siloed", "exclusive"), and its default value ("siloed").

Dependencies

  • [x] Feature needs to be shipped in Chrome (https://chromestatus.com/feature/5172892632875008)

Additional information

No response

Are you willing to support this work?

Can support with reviews and feedback.

nathanmemmott avatar Nov 14 '23 18:11 nathanmemmott

@chrisdavidmills are you handling this? If so let me know otherwise I'll add to our team tasks

Rumyra avatar Nov 16 '23 14:11 Rumyra

@Rumyra I'm happy to do this; I'll add it to my worklist.

Proposal makes sense and looks pretty solid; ideally we should wait until it's actually in the spec before documenting. I'll keep an eye on https://github.com/whatwg/fs/pull/151 for progress on this.

chrisdavidmills avatar Nov 17 '23 11:11 chrisdavidmills

The feature will be shipped in Chrome stable on Tue, Jan 23, 2024.

nathanmemmott avatar Dec 11 '23 19:12 nathanmemmott

@nathanmemmott I've added docs to cover these features: https://github.com/mdn/content/pull/35334. Would you be able to provide me with a tech review of this work, or is there someone more appropriate to ask?

Also pinging @tomayac as I know he is heavily involved with APIs around this area.

chrisdavidmills avatar Aug 06 '24 12:08 chrisdavidmills

Reviewed this PR. Thanks for working on it!

tomayac avatar Aug 06 '24 15:08 tomayac

Left a few comments on the PR. Looks good!

nathanmemmott avatar Aug 06 '24 18:08 nathanmemmott

Great stuff, thanks @tomayac and @nathanmemmott!

chrisdavidmills avatar Aug 07 '24 10:08 chrisdavidmills