refactor(cos): use singular requestFileHandle() instead of requestFileHandles()#1709
Conversation
…les() Switch to the new singular API as adopted in: WICG/cross-origin-storage#61
…les() Switch to the new singular API as adopted in: WICG/cross-origin-storage#61
|
Thank you very much for the PR. When will the new singular API be available in the browser? And is there a fallback in place for the transition to avoid any syntax errors? |
|
In the browser we don't know yet, it's already in the extension and it accepts both variants, so no breakage at all. |
|
Oh yes, sure. I meant in the extension😄 |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
I mean, it's a very legitimate question The unit test failure seems unrelated:
|
Yes, we have seen this issue in other places too. We are working on it :) |
Switches from the deprecated plural
requestFileHandles([hash])to the new singularrequestFileHandle(hash)API, which returns aFileSystemFileHandledirectly rather than a single-element array. Also updates the bundled type definitions to match.The rename was adopted in the COS spec after a survey of all known real-world implementations found that every call site passed a single-element array and immediately destructured it to one handle — no implementation ever used the plural form as intended.
FYI @nico-martin @xenova — as the author and reviewer of the original COS PR (#1549).
See WICG/cross-origin-storage#61 for details.