Files
node/lib
Ian Kerins 1781f63633 fs: make FileHandle.readableWebStream always create byte streams
The original implementation of the experimental
`FileHandle.readableWebStream` API created non-`type: 'bytes'` streams,
which prevented callers from creating `mode: 'byob'` readers from the
returned stream, which means they could not achieve the associated
"zero-copy" performance characteristics.

Then, #46933 added a parameter allowing callers to pass the `type`
parameter down to the ReadableStream constructor, exposing the same
semantics to callers of `FileHandle.readableWebStream`.

But there is no point to giving callers this choice: FileHandle-derived
streams are by their very nature byte streams. We should not require
callers to explicitly opt in to having byte stream semantics. Moreover,
I do not see a situation in which callers would ever want to have a
non-bytes stream: bytes-streams only do anything differently than normal
ones if `mode: 'byob'` is passed to `getReader`.

So, remove the `options` parameter and always create a ReadableStream
with `type: 'bytes'`.

Fixes #54041.

PR-URL: https://github.com/nodejs/node/pull/55461
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-02-10 03:40:31 +00:00
..
…
…
…
2024-09-24 19:48:15 +00:00
2024-10-09 06:42:16 +00:00
2024-10-09 06:42:16 +00:00
2024-10-09 06:42:16 +00:00
2024-12-15 14:19:27 +00:00
2024-10-17 13:18:28 +00:00
2024-01-12 16:09:48 +00:00
2024-07-08 15:55:43 +00:00
2024-12-06 04:36:24 +00:00
2024-10-09 06:42:16 +00:00
2024-10-09 06:42:16 +00:00
2024-02-02 15:25:34 +01:00
2025-01-04 18:30:04 +00:00
2024-10-09 06:42:16 +00:00
2024-07-07 00:56:04 +00:00
2025-02-01 02:13:57 +00:00
2025-02-08 12:43:53 +00:00