Instead of doing a roundtrip from Blob to Response (with a handcrafted ReadableStream), this just lets you pass a Promise<Blob> to browser-fs-access. Much simpler, and much harder to mess up. I've tried many variations of creating a ReadableStream object that works across browsers as the data of a Response. There are almost no examples of properly doing so, it's very easy to get it wrong, and it's unnecessary indirection for both browser-fs-access and module consumers if the data is originally in some Blob or string format.
Okay, this is another approach to https://github.com/GoogleChromeLabs/browser-fs-access/pull/104 because it is turning out to be extremely difficult to support Safari and Firefox and implement streams.
Instead of doing a roundtrip from Blob to Response (with a handcrafted ReadableStream), this just lets you pass a
Promise<Blob>
to browser-fs-access. Much simpler, and much harder to mess up. I've tried many variations of creating a ReadableStream object that works across browsers as the data of a Response. There are almost no examples of properly doing so, it's very easy to get it wrong, and it's unnecessary indirection for both browser-fs-access and module consumers if the data is originally in some Blob or string format.