Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAntoine du Hamel <duhamelantoine1995@gmail.com>2022-04-04 11:36:54 +0300
committerGitHub <noreply@github.com>2022-04-04 11:36:54 +0300
commit560cbc584908768f5802f835cb34bed783446939 (patch)
tree3ecf6a9efa7bc531ff9ae20c470665d1090dca85 /doc
parente6a7300a10eb7de8a79e1ace26631fb611b64bfe (diff)
stream: expose web streams globals, remove runtime experimental warning
PR-URL: https://github.com/nodejs/node/pull/42225 Fixes: https://github.com/nodejs/node/issues/40950 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/globals.md187
-rw-r--r--doc/api/webstreams.md86
2 files changed, 256 insertions, 17 deletions
diff --git a/doc/api/globals.md b/doc/api/globals.md
index 5d9e81d9afc..7274ff3d801 100644
--- a/doc/api/globals.md
+++ b/doc/api/globals.md
@@ -229,6 +229,16 @@ added: v0.1.103
Used to handle binary data. See the [buffer section][].
+## Class: `ByteLengthQueuingStrategy`
+
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental.
+
+A browser-compatible implementation of [`ByteLengthQueuingStrategy`][].
+
## `__dirname`
This variable may appear to be global but is not. See [`__dirname`][].
@@ -295,6 +305,16 @@ added: v0.0.1
[`clearTimeout`][] is described in the [timers][] section.
+## Class: `CompressionStream`
+
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental.
+
+A browser-compatible implementation of [`CompressionStream`][].
+
## `console`
<!-- YAML
@@ -307,6 +327,16 @@ added: v0.1.100
Used to print to stdout and stderr. See the [`console`][] section.
+## Class: `CountQueuingStrategy`
+
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental.
+
+A browser-compatible implementation of [`CountQueuingStrategy`][].
+
## `Crypto`
<!-- YAML
@@ -344,6 +374,16 @@ A browser-compatible implementation of {CryptoKey}. This global is available
only if the Node.js binary was compiled with including support for the
`crypto` module.
+## Class: `DecompressionStream`
+
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental.
+
+A browser-compatible implementation of [`DecompressionStream`][].
+
## `Event`
<!-- YAML
@@ -516,6 +556,66 @@ DataHandler.prototype.load = async function load(key) {
};
```
+## Class: `ReadableByteStreamController`
+
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental.
+
+A browser-compatible implementation of [`ReadableByteStreamController`][].
+
+## Class: `ReadableStream`
+
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental.
+
+A browser-compatible implementation of [`ReadableStream`][].
+
+## Class: `ReadableStreamBYOBReader`
+
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental.
+
+A browser-compatible implementation of [`ReadableStreamBYOBReader`][].
+
+## Class: `ReadableStreamBYOBRequest`
+
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental.
+
+A browser-compatible implementation of [`ReadableStreamBYOBRequest`][].
+
+## Class: `ReadableStreamDefaultController`
+
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental.
+
+A browser-compatible implementation of [`ReadableStreamDefaultController`][].
+
+## Class: `ReadableStreamDefaultReader`
+
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental.
+
+A browser-compatible implementation of [`ReadableStreamDefaultReader`][].
+
## `require()`
This variable may appear to be global but is not. See [`require()`][].
@@ -615,6 +715,16 @@ added: v11.0.0
The WHATWG `TextDecoder` class. See the [`TextDecoder`][] section.
+## Class: `TextDecoderStream`
+
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental.
+
+A browser-compatible implementation of [`TextDecoderStream`][].
+
## `TextEncoder`
<!-- YAML
@@ -625,6 +735,36 @@ added: v11.0.0
The WHATWG `TextEncoder` class. See the [`TextEncoder`][] section.
+## Class: `TextEncoderStream`
+
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental.
+
+A browser-compatible implementation of [`TextEncoderStream`][].
+
+## Class: `TransformStream`
+
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental.
+
+A browser-compatible implementation of [`TransformStream`][].
+
+## Class: `TransformStreamDefaultController`
+
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental.
+
+A browser-compatible implementation of [`TransformStreamDefaultController`][].
+
## `URL`
<!-- YAML
@@ -659,19 +799,66 @@ The object that acts as the namespace for all W3C
[WebAssembly][webassembly-org] related functionality. See the
[Mozilla Developer Network][webassembly-mdn] for usage and compatibility.
+## Class: `WritableStream`
+
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental.
+
+A browser-compatible implementation of [`WritableStream`][].
+
+## Class: `WritableStreamDefaultController`
+
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental.
+
+A browser-compatible implementation of [`WritableStreamDefaultController`][].
+
+## Class: `WritableStreamDefaultWriter`
+
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental.
+
+A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
+
[Web Crypto API]: webcrypto.md
[`--experimental-global-webcrypto`]: cli.md#--experimental-global-webcrypto
[`--no-experimental-fetch`]: cli.md#--no-experimental-fetch
[`AbortController`]: https://developer.mozilla.org/en-US/docs/Web/API/AbortController
+[`ByteLengthQueuingStrategy`]: webstreams.md#class-bytelengthqueuingstrategy
+[`CompressionStream`]: webstreams.md#class-compressionstream
+[`CountQueuingStrategy`]: webstreams.md#class-countqueuingstrategy
[`DOMException`]: https://developer.mozilla.org/en-US/docs/Web/API/DOMException
+[`DecompressionStream`]: webstreams.md#class-decompressionstream
[`EventTarget` and `Event` API]: events.md#eventtarget-and-event-api
[`MessageChannel`]: worker_threads.md#class-messagechannel
[`MessageEvent`]: https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent/MessageEvent
[`MessagePort`]: worker_threads.md#class-messageport
+[`ReadableByteStreamController`]: webstreams.md#class-readablebytestreamcontroller
+[`ReadableStreamBYOBReader`]: webstreams.md#class-readablestreambyobreader
+[`ReadableStreamBYOBRequest`]: webstreams.md#class-readablestreambyobrequest
+[`ReadableStreamDefaultController`]: webstreams.md#class-readablestreamdefaultcontroller
+[`ReadableStreamDefaultReader`]: webstreams.md#class-readablestreamdefaultreader
+[`ReadableStream`]: webstreams.md#class-readablestream
+[`TextDecoderStream`]: webstreams.md#class-textdecoderstream
[`TextDecoder`]: util.md#class-utiltextdecoder
+[`TextEncoderStream`]: webstreams.md#class-textencoderstream
[`TextEncoder`]: util.md#class-utiltextencoder
+[`TransformStreamDefaultController`]: webstreams.md#class-transformstreamdefaultcontroller
+[`TransformStream`]: webstreams.md#class-transformstream
[`URLSearchParams`]: url.md#class-urlsearchparams
[`URL`]: url.md#class-url
+[`WritableStreamDefaultController`]: webstreams.md#class-writablestreamdefaultcontroller
+[`WritableStreamDefaultWriter`]: webstreams.md#class-writablestreamdefaultwriter
+[`WritableStream`]: webstreams.md#class-writablestream
[`__dirname`]: modules.md#__dirname
[`__filename`]: modules.md#__filename
[`buffer.atob()`]: buffer.md#bufferatobdata
diff --git a/doc/api/webstreams.md b/doc/api/webstreams.md
index cde2addc7d0..9f356360078 100644
--- a/doc/api/webstreams.md
+++ b/doc/api/webstreams.md
@@ -2,25 +2,17 @@
<!--introduced_in=v16.5.0-->
-> Stability: 1 - Experimental
-
-An implementation of the [WHATWG Streams Standard][].
+<!-- YAML
+added: v16.5.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/42225
+ description: Use of this API no longer emit a runtime warning.
+-->
-```mjs
-import {
- ReadableStream,
- WritableStream,
- TransformStream,
-} from 'node:stream/web';
-```
+> Stability: 1 - Experimental.
-```cjs
-const {
- ReadableStream,
- WritableStream,
- TransformStream,
-} = require('stream/web');
-```
+An implementation of the [WHATWG Streams Standard][].
## Overview
@@ -101,6 +93,10 @@ const stream = new ReadableStream({
<!-- YAML
added: v16.5.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/42225
+ description: This class is now exposed on the global object.
-->
#### `new ReadableStream([underlyingSource [, strategy]])`
@@ -387,6 +383,10 @@ port2.postMessage(stream, [stream]);
<!-- YAML
added: v16.5.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/42225
+ description: This class is now exposed on the global object.
-->
By default, calling `readableStream.getReader()` with no arguments
@@ -454,6 +454,10 @@ Releases this reader's lock on the underlying {ReadableStream}.
<!-- YAML
added: v16.5.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/42225
+ description: This class is now exposed on the global object.
-->
The `ReadableStreamBYOBReader` is an alternative consumer for
@@ -701,6 +705,10 @@ Signals an error that causes the {ReadableStream} to error and close.
<!-- YAML
added: v16.5.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/42225
+ description: This class is now exposed on the global object.
-->
When using `ReadableByteStreamController` in byte-oriented
@@ -747,6 +755,10 @@ added: v16.5.0
<!-- YAML
added: v16.5.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/42225
+ description: This class is now exposed on the global object.
-->
The `WritableStream` is a destination to which stream data is sent.
@@ -863,6 +875,10 @@ port2.postMessage(stream, [stream]);
<!-- YAML
added: v16.5.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/42225
+ description: This class is now exposed on the global object.
-->
#### `new WritableStreamDefaultWriter(stream)`
@@ -950,6 +966,10 @@ Appends a new chunk of data to the {WritableStream}'s queue.
<!-- YAML
added: v16.5.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/42225
+ description: This class is now exposed on the global object.
-->
The `WritableStreamDefaultController` manage's the {WritableStream}'s
@@ -980,6 +1000,10 @@ with currently pending writes canceled.
<!-- YAML
added: v16.5.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/42225
+ description: This class is now exposed on the global object.
-->
A `TransformStream` consists of a {ReadableStream} and a {WritableStream} that
@@ -1082,6 +1106,10 @@ port2.postMessage(stream, [stream]);
<!-- YAML
added: v16.5.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/42225
+ description: This class is now exposed on the global object.
-->
The `TransformStreamDefaultController` manages the internal state
@@ -1132,6 +1160,10 @@ to be abruptly closed with an error.
<!-- YAML
added: v16.5.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/42225
+ description: This class is now exposed on the global object.
-->
#### `new ByteLengthQueuingStrategy(options)`
@@ -1165,6 +1197,10 @@ added: v16.5.0
<!-- YAML
added: v16.5.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/42225
+ description: This class is now exposed on the global object.
-->
#### `new CountQueuingStrategy(options)`
@@ -1198,6 +1234,10 @@ added: v16.5.0
<!-- YAML
added: v16.6.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/42225
+ description: This class is now exposed on the global object.
-->
#### `new TextEncoderStream()`
@@ -1238,6 +1278,10 @@ added: v16.6.0
<!-- YAML
added: v16.6.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/42225
+ description: This class is now exposed on the global object.
-->
#### `new TextDecoderStream([encoding[, options]])`
@@ -1309,6 +1353,10 @@ added: v16.6.0
<!-- YAML
added: v17.0.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/42225
+ description: This class is now exposed on the global object.
-->
#### `new CompressionStream(format)`
@@ -1339,6 +1387,10 @@ added: v17.0.0
<!-- YAML
added: v17.0.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/42225
+ description: This class is now exposed on the global object.
-->
#### `new DecompressionStream(format)`