[Webkit-unassigned] [Bug 283065] New: Support BYOB byte streams
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Nov 13 10:44:24 PST 2024
https://bugs.webkit.org/show_bug.cgi?id=283065
Bug ID: 283065
Summary: Support BYOB byte streams
Product: WebKit
Version: WebKit Nightly Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: WebCore Misc.
Assignee: webkit-unassigned at lists.webkit.org
Reporter: adam.zielinski at automattic.com
WebKit doesn't seem to fully support the following BYOB stream APIs:
* ReadableByteStreamController
* ReadableStreamBYOBReader
* ReadableStream.getReader({ mode: "byob" });
For example, this code snippet errors out:
```js
const readableStream = new ReadableStream({
type: 'bytes',
});
const reader = readableStream.getReader({ mode: 'byob' });
```
I'm a WordPress core committer sponsored by Automattic to work on WordPress Playground [1] – a version of WordPress that runs in browsers, CLI, etc. via WebAssembly. Most Playground applications are about instructing WordPress to preinstall specific plugins and themes. This works by downloading a ZIP file, decompressing it, and running the plugin installation hooks.
Buffering the entire ZIP file before decompressing it can be slow, so we developed a JavaScript library to stream-decompress ZIP files [2]. Unfortunately, it relies on BYOB stream support and doesn't work in Safari. I've tried many different ways of getting the stream decompression to work in Safari in a way that can still interop with other readable and writable streams, but they all failed [3].
The next best solution is using stream decompression in Firefox and Chrome and falling back to noticeably slower buffering and decompression in Safari. However, I would really like Safari users to have the same good experience with WordPress Playground as folks using other browsers. Playground is becoming an important part of the WordPress ecosystem and have been used by hundreds of thousands of people in the community.
[1] https://w.org/playground
[2] https://github.com/WordPress/wordpress-playground/blob/trunk/packages/php-wasm/stream-compression/src/zip/decode-zip.ts
[3] https://github.com/WordPress/wordpress-playground/pull/1799
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20241113/cafd77f5/attachment.htm>
More information about the webkit-unassigned
mailing list