Skip to content

Commit 560cbc5

Browse files
authored
stream: expose web streams globals, remove runtime experimental warning
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>
1 parent e6a7300 commit 560cbc5

File tree

10 files changed

+410
-121
lines changed

10 files changed

+410
-121
lines changed

.eslintrc.js

+17
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,28 @@ module.exports = {
317317
'node-core/no-duplicate-requires': 'error',
318318
},
319319
globals: {
320+
ByteLengthQueuingStrategy: 'readable',
321+
CompressionStream: 'readable',
322+
CountQueuingStrategy: 'readable',
320323
Crypto: 'readable',
321324
CryptoKey: 'readable',
325+
DecompressionStream: 'readable',
322326
fetch: 'readable',
323327
FormData: 'readable',
328+
ReadableStream: 'readable',
329+
ReadableStreamDefaultReader: 'readable',
330+
ReadableStreamBYOBReader: 'readable',
331+
ReadableStreamBYOBRequest: 'readable',
332+
ReadableByteStreamController: 'readable',
333+
ReadableStreamDefaultController: 'readable',
324334
Response: 'readable',
335+
TextDecoderStream: 'readable',
336+
TextEncoderStream: 'readable',
337+
TransformStream: 'readable',
338+
TransformStreamDefaultController: 'readable',
325339
SubtleCrypto: 'readable',
340+
WritableStream: 'readable',
341+
WritableStreamDefaultWriter: 'readable',
342+
WritableStreamDefaultController: 'readable',
326343
},
327344
};

doc/api/globals.md

+187
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,16 @@ added: v0.1.103
229229

230230
Used to handle binary data. See the [buffer section][].
231231

232+
## Class: `ByteLengthQueuingStrategy`
233+
234+
<!-- YAML
235+
added: REPLACEME
236+
-->
237+
238+
> Stability: 1 - Experimental.
239+
240+
A browser-compatible implementation of [`ByteLengthQueuingStrategy`][].
241+
232242
## `__dirname`
233243

234244
This variable may appear to be global but is not. See [`__dirname`][].
@@ -295,6 +305,16 @@ added: v0.0.1
295305

296306
[`clearTimeout`][] is described in the [timers][] section.
297307

308+
## Class: `CompressionStream`
309+
310+
<!-- YAML
311+
added: REPLACEME
312+
-->
313+
314+
> Stability: 1 - Experimental.
315+
316+
A browser-compatible implementation of [`CompressionStream`][].
317+
298318
## `console`
299319

300320
<!-- YAML
@@ -307,6 +327,16 @@ added: v0.1.100
307327

308328
Used to print to stdout and stderr. See the [`console`][] section.
309329

330+
## Class: `CountQueuingStrategy`
331+
332+
<!-- YAML
333+
added: REPLACEME
334+
-->
335+
336+
> Stability: 1 - Experimental.
337+
338+
A browser-compatible implementation of [`CountQueuingStrategy`][].
339+
310340
## `Crypto`
311341

312342
<!-- YAML
@@ -344,6 +374,16 @@ A browser-compatible implementation of {CryptoKey}. This global is available
344374
only if the Node.js binary was compiled with including support for the
345375
`crypto` module.
346376

377+
## Class: `DecompressionStream`
378+
379+
<!-- YAML
380+
added: REPLACEME
381+
-->
382+
383+
> Stability: 1 - Experimental.
384+
385+
A browser-compatible implementation of [`DecompressionStream`][].
386+
347387
## `Event`
348388

349389
<!-- YAML
@@ -516,6 +556,66 @@ DataHandler.prototype.load = async function load(key) {
516556
};
517557
```
518558

559+
## Class: `ReadableByteStreamController`
560+
561+
<!-- YAML
562+
added: REPLACEME
563+
-->
564+
565+
> Stability: 1 - Experimental.
566+
567+
A browser-compatible implementation of [`ReadableByteStreamController`][].
568+
569+
## Class: `ReadableStream`
570+
571+
<!-- YAML
572+
added: REPLACEME
573+
-->
574+
575+
> Stability: 1 - Experimental.
576+
577+
A browser-compatible implementation of [`ReadableStream`][].
578+
579+
## Class: `ReadableStreamBYOBReader`
580+
581+
<!-- YAML
582+
added: REPLACEME
583+
-->
584+
585+
> Stability: 1 - Experimental.
586+
587+
A browser-compatible implementation of [`ReadableStreamBYOBReader`][].
588+
589+
## Class: `ReadableStreamBYOBRequest`
590+
591+
<!-- YAML
592+
added: REPLACEME
593+
-->
594+
595+
> Stability: 1 - Experimental.
596+
597+
A browser-compatible implementation of [`ReadableStreamBYOBRequest`][].
598+
599+
## Class: `ReadableStreamDefaultController`
600+
601+
<!-- YAML
602+
added: REPLACEME
603+
-->
604+
605+
> Stability: 1 - Experimental.
606+
607+
A browser-compatible implementation of [`ReadableStreamDefaultController`][].
608+
609+
## Class: `ReadableStreamDefaultReader`
610+
611+
<!-- YAML
612+
added: REPLACEME
613+
-->
614+
615+
> Stability: 1 - Experimental.
616+
617+
A browser-compatible implementation of [`ReadableStreamDefaultReader`][].
618+
519619
## `require()`
520620

521621
This variable may appear to be global but is not. See [`require()`][].
@@ -615,6 +715,16 @@ added: v11.0.0
615715

616716
The WHATWG `TextDecoder` class. See the [`TextDecoder`][] section.
617717

718+
## Class: `TextDecoderStream`
719+
720+
<!-- YAML
721+
added: REPLACEME
722+
-->
723+
724+
> Stability: 1 - Experimental.
725+
726+
A browser-compatible implementation of [`TextDecoderStream`][].
727+
618728
## `TextEncoder`
619729

620730
<!-- YAML
@@ -625,6 +735,36 @@ added: v11.0.0
625735

626736
The WHATWG `TextEncoder` class. See the [`TextEncoder`][] section.
627737

738+
## Class: `TextEncoderStream`
739+
740+
<!-- YAML
741+
added: REPLACEME
742+
-->
743+
744+
> Stability: 1 - Experimental.
745+
746+
A browser-compatible implementation of [`TextEncoderStream`][].
747+
748+
## Class: `TransformStream`
749+
750+
<!-- YAML
751+
added: REPLACEME
752+
-->
753+
754+
> Stability: 1 - Experimental.
755+
756+
A browser-compatible implementation of [`TransformStream`][].
757+
758+
## Class: `TransformStreamDefaultController`
759+
760+
<!-- YAML
761+
added: REPLACEME
762+
-->
763+
764+
> Stability: 1 - Experimental.
765+
766+
A browser-compatible implementation of [`TransformStreamDefaultController`][].
767+
628768
## `URL`
629769

630770
<!-- YAML
@@ -659,19 +799,66 @@ The object that acts as the namespace for all W3C
659799
[WebAssembly][webassembly-org] related functionality. See the
660800
[Mozilla Developer Network][webassembly-mdn] for usage and compatibility.
661801

802+
## Class: `WritableStream`
803+
804+
<!-- YAML
805+
added: REPLACEME
806+
-->
807+
808+
> Stability: 1 - Experimental.
809+
810+
A browser-compatible implementation of [`WritableStream`][].
811+
812+
## Class: `WritableStreamDefaultController`
813+
814+
<!-- YAML
815+
added: REPLACEME
816+
-->
817+
818+
> Stability: 1 - Experimental.
819+
820+
A browser-compatible implementation of [`WritableStreamDefaultController`][].
821+
822+
## Class: `WritableStreamDefaultWriter`
823+
824+
<!-- YAML
825+
added: REPLACEME
826+
-->
827+
828+
> Stability: 1 - Experimental.
829+
830+
A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
831+
662832
[Web Crypto API]: webcrypto.md
663833
[`--experimental-global-webcrypto`]: cli.md#--experimental-global-webcrypto
664834
[`--no-experimental-fetch`]: cli.md#--no-experimental-fetch
665835
[`AbortController`]: https://developer.mozilla.org/en-US/docs/Web/API/AbortController
836+
[`ByteLengthQueuingStrategy`]: webstreams.md#class-bytelengthqueuingstrategy
837+
[`CompressionStream`]: webstreams.md#class-compressionstream
838+
[`CountQueuingStrategy`]: webstreams.md#class-countqueuingstrategy
666839
[`DOMException`]: https://developer.mozilla.org/en-US/docs/Web/API/DOMException
840+
[`DecompressionStream`]: webstreams.md#class-decompressionstream
667841
[`EventTarget` and `Event` API]: events.md#eventtarget-and-event-api
668842
[`MessageChannel`]: worker_threads.md#class-messagechannel
669843
[`MessageEvent`]: https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent/MessageEvent
670844
[`MessagePort`]: worker_threads.md#class-messageport
845+
[`ReadableByteStreamController`]: webstreams.md#class-readablebytestreamcontroller
846+
[`ReadableStreamBYOBReader`]: webstreams.md#class-readablestreambyobreader
847+
[`ReadableStreamBYOBRequest`]: webstreams.md#class-readablestreambyobrequest
848+
[`ReadableStreamDefaultController`]: webstreams.md#class-readablestreamdefaultcontroller
849+
[`ReadableStreamDefaultReader`]: webstreams.md#class-readablestreamdefaultreader
850+
[`ReadableStream`]: webstreams.md#class-readablestream
851+
[`TextDecoderStream`]: webstreams.md#class-textdecoderstream
671852
[`TextDecoder`]: util.md#class-utiltextdecoder
853+
[`TextEncoderStream`]: webstreams.md#class-textencoderstream
672854
[`TextEncoder`]: util.md#class-utiltextencoder
855+
[`TransformStreamDefaultController`]: webstreams.md#class-transformstreamdefaultcontroller
856+
[`TransformStream`]: webstreams.md#class-transformstream
673857
[`URLSearchParams`]: url.md#class-urlsearchparams
674858
[`URL`]: url.md#class-url
859+
[`WritableStreamDefaultController`]: webstreams.md#class-writablestreamdefaultcontroller
860+
[`WritableStreamDefaultWriter`]: webstreams.md#class-writablestreamdefaultwriter
861+
[`WritableStream`]: webstreams.md#class-writablestream
675862
[`__dirname`]: modules.md#__dirname
676863
[`__filename`]: modules.md#__filename
677864
[`buffer.atob()`]: buffer.md#bufferatobdata

0 commit comments

Comments
 (0)