Repository navigation
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Parents: #140, #143
Profiles: #163, #164
Roadmap: #134
Implement the six pinned readable-stream consumption boundaries on top of a real Web Streams state machine. This is not a permission to accept an arbitrary array/iterator as a stream: the exported ABI must preserve locked, disturbed, cancellation, chunk, and Promise behavior.
Scope
- Pin Home
7ed99c02, Bun4982b91e,ReadableStream.cpp, generated builtin behavior, and exact source identities. - Implement realm-local
ReadableStream, default reader, controller, queue, close/error/cancel, lock release, and disturbed state needed by the pinned consumers. - Consume synchronously and asynchronously enqueued chunks in order without invoking user code while engine/GC locks are held.
- Implement
ZigGlobalObject__readableStreamToArrayBufferwith exact byte concatenation, detached/view bounds, overflow, rejection, and Promise identity. - Implement
ZigGlobalObject__readableStreamToBytesas the pinnedUint8Arrayresult without an avoidable second payload copy. - Implement
ZigGlobalObject__readableStreamToTextwith streaming UTF-8 decoding, split sequences, BOM/error behavior, and lone-surrogate safety. - Implement
ZigGlobalObject__readableStreamToJSONthrough the engine JSON parser, with decode/parse failures delivered through the returned Promise. - Implement
ZigGlobalObject__readableStreamToBlobwith exact byte/type ownership and Blob integration. - Implement
ZigGlobalObject__readableStreamToFormDatafor pinned multipart and URL-encoded content types, boundaries, filenames, binary values, duplicates, and malformed bodies. - Preserve locked/already-consumed/errored/cancelled streams, abrupt pull/cancel callbacks, empty bodies, mixed/invalid chunks, sibling realms, invalid encoded handles, and OOM/failure atomicity.
- Add bounded Home/Bun Debug, ReleaseSafe, and TSan fixtures; refresh inventories, concise README counts, docs, and roadmap evidence.
- Close only after the exact fixing
mainCI job is green.
No placeholder resolved Promise, eager whole-source shortcut, or host-only stream shape. All six exports must consume the same engine-native stream machinery that JavaScript observes.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Activity
feat(abi): implement readable stream consumers (#405)
test(abi): cover readable stream boundaries (#405)
docs(abi): publish readable stream coverage (#405)
chrisbbreuer commentedon Jul 20, 2026
Implementation is on
mainin three cohesive commits:5244b82d(realm-local stream machinery and six C ABI consumers),4ccbe6c8(Home/Bun compiled consumers plus Debug/ReleaseSafe/TSan CI), and4275f7c2(exact contracts, audit validators, inventories, docs, and concise README counts). Local evidence is green across focused engine and 6/6-symbol external fixtures in Debug, ReleaseSafe, and TSan, with Home 439/471 and Bun 430/461. Closure remains gated on the exact4275f7c2main job.chrisbbreuer commentedon Jul 20, 2026
Exact fixing-main CI is green, including the complete private-ABI boundary: https://github.com/zig-utils/zig-js/actions/runs/29785272707/job/88495394827