Removes whole-file buffering on both send and receive paths by wiring up the Web Streams API throughout the WASM/JS Taildrop bridge.
Changes
Send — sendFile now accepts a ReadableStreamDefaultReader stream + declaredSize. A new jsStreamReader (io.ReadCloser) pulls chunks from the JS stream by awaiting reader.read() Promises via the channel+js.FuncOf pattern. The full file is never copied into Go memory.
Receive — openWaitingFile resolves with a JS ReadableStream instead of a Uint8Array. A new jsReadableStream(rc io.ReadCloser) helper creates a pull-based stream: each pull returns a Promise; a goroutine reads up to 64 KiB and enqueues the chunk. No io.ReadAll.
FileOps — jsFileOps.OpenReader now expects JS to return a ReadableStream; it wraps it in jsStreamReader for streaming delivery to Go.
openWaitingFile(name) resolves with ReadableStream<Uint8Array> instead of Uint8Array
IPNFileOps.openReader callback now passes ReadableStream<Uint8Array> instead of Uint8Array
Companion PR in webnet for the JS/TS side: TBD
Removes whole-file buffering on both send and receive paths by wiring up the Web Streams API throughout the WASM/JS Taildrop bridge.
## Changes
**Send** — `sendFile` now accepts a `ReadableStreamDefaultReader` stream + `declaredSize`. A new `jsStreamReader` (`io.ReadCloser`) pulls chunks from the JS stream by awaiting `reader.read()` Promises via the channel+`js.FuncOf` pattern. The full file is never copied into Go memory.
**Receive** — `openWaitingFile` resolves with a JS `ReadableStream` instead of a `Uint8Array`. A new `jsReadableStream(rc io.ReadCloser)` helper creates a pull-based stream: each `pull` returns a Promise; a goroutine reads up to 64 KiB and enqueues the chunk. No `io.ReadAll`.
**FileOps** — `jsFileOps.OpenReader` now expects JS to return a `ReadableStream`; it wraps it in `jsStreamReader` for streaming delivery to Go.
## JS API changes (breaking)
- `sendFile(stableNodeID, filename, data: Uint8Array)` → `sendFile(stableNodeID, filename, stream: ReadableStream<Uint8Array>, declaredSize: number)`
- `openWaitingFile(name)` resolves with `ReadableStream<Uint8Array>` instead of `Uint8Array`
- `IPNFileOps.openReader` callback now passes `ReadableStream<Uint8Array>` instead of `Uint8Array`
Companion PR in webnet for the JS/TS side: TBD
Send: accept a ReadableStreamDefaultReader instead of a Uint8Array.
jsStreamReader (new io.ReadCloser) awaits reader.read() Promises via the
channel+FuncOf pattern, feeding chunks directly to the HTTP PUT body.
No js.CopyBytesToGo of the full file.
Receive: openWaitingFile now returns a pull-based ReadableStream backed by
the Go io.ReadCloser (jsReadableStream helper). Each pull call reads up
to 64 KiB and enqueues a Uint8Array chunk; no io.ReadAll.
jsFileOps.OpenReader: JS now returns a ReadableStream instead of a
Uint8Array; Go wraps it in jsStreamReader for streaming delivery.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Removes whole-file buffering on both send and receive paths by wiring up the Web Streams API throughout the WASM/JS Taildrop bridge.
Changes
Send —
sendFilenow accepts aReadableStreamDefaultReaderstream +declaredSize. A newjsStreamReader(io.ReadCloser) pulls chunks from the JS stream by awaitingreader.read()Promises via the channel+js.FuncOfpattern. The full file is never copied into Go memory.Receive —
openWaitingFileresolves with a JSReadableStreaminstead of aUint8Array. A newjsReadableStream(rc io.ReadCloser)helper creates a pull-based stream: eachpullreturns a Promise; a goroutine reads up to 64 KiB and enqueues the chunk. Noio.ReadAll.FileOps —
jsFileOps.OpenReadernow expects JS to return aReadableStream; it wraps it injsStreamReaderfor streaming delivery to Go.JS API changes (breaking)
sendFile(stableNodeID, filename, data: Uint8Array)→sendFile(stableNodeID, filename, stream: ReadableStream<Uint8Array>, declaredSize: number)openWaitingFile(name)resolves withReadableStream<Uint8Array>instead ofUint8ArrayIPNFileOps.openReadercallback now passesReadableStream<Uint8Array>instead ofUint8ArrayCompanion PR in webnet for the JS/TS side: TBD