Skip to content

Commit

Permalink
stream: expose web streams globals, remove runtime experimental warning
Browse files Browse the repository at this point in the history
PR-URL: #42225
Fixes: #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>
  • Loading branch information
aduh95 authored Apr 4, 2022
1 parent e6a7300 commit 560cbc5
Show file tree
Hide file tree
Showing 10 changed files with 410 additions and 121 deletions.
17 changes: 17 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,28 @@ module.exports = {
'node-core/no-duplicate-requires': 'error',
},
globals: {
ByteLengthQueuingStrategy: 'readable',
CompressionStream: 'readable',
CountQueuingStrategy: 'readable',
Crypto: 'readable',
CryptoKey: 'readable',
DecompressionStream: 'readable',
fetch: 'readable',
FormData: 'readable',
ReadableStream: 'readable',
ReadableStreamDefaultReader: 'readable',
ReadableStreamBYOBReader: 'readable',
ReadableStreamBYOBRequest: 'readable',
ReadableByteStreamController: 'readable',
ReadableStreamDefaultController: 'readable',
Response: 'readable',
TextDecoderStream: 'readable',
TextEncoderStream: 'readable',
TransformStream: 'readable',
TransformStreamDefaultController: 'readable',
SubtleCrypto: 'readable',
WritableStream: 'readable',
WritableStreamDefaultWriter: 'readable',
WritableStreamDefaultController: 'readable',
},
};
187 changes: 187 additions & 0 deletions doc/api/globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`][].
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()`][].
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 560cbc5

Please sign in to comment.