You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(runtime): WHATWG Web Streams cluster in the JSC realm
Adds the web-streams surface to Home's own JSC realm (pure JS), authored +
adversarially verified via a multi-agent workflow, integrated and shipped in
one build:
- web_globals: ReadableStream (getReader/read/releaseLock/cancel/closed,
[Symbol.asyncIterator], pipeTo, pipeThrough, tee, static from) + default
reader/controller, WritableStream (getWriter/write/close/abort/ready/
desiredSize), TransformStream (readable/writable, transform/flush/start),
CountQueuingStrategy, ByteLengthQueuingStrategy.
- node_modules: node:"stream/web" (re-exports the realm globals) and
node:"stream/consumers" (text/json/arrayBuffer/buffer/bytes/blob — drains a
web ReadableStream or node Readable).
- bun_global: Bun.readableStreamTo{Text,JSON,ArrayBuffer,Bytes,Blob,Array}.
18 focused tests (enqueue/read, for-await, from, tee, pipeThrough, consumers
text/json/buffer, Bun drains). Full home_rt gate: 1549/1549.
(TextEncoderStream/TextDecoderStream are a follow-up.)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
\\ B.readableStreamToArrayBuffer = function(stream) { return drainStream(stream).then(function(chunks) { var b = concatChunkBytes(chunks); return b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength); }); };
351
+
\\ B.readableStreamToBlob = function(stream) { return drainStream(stream).then(function(chunks) { var Blob = globalThis.Blob; if (typeof Blob !== "function") throw new TypeError("Blob is not defined in this realm"); return new Blob(chunks); }); };
0 commit comments