web-streams-polyfill 2.1.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,56 @@
9
9
  > - 🏠 Internal
10
10
  > - 💅 Polish
11
11
 
12
+ ## v3.0.3 (2020-04-09)
13
+
14
+ * 💅 Change `Promise<void>` to `Promise<undefined>` in TypeScript type definitions ([#72](https://github.com/MattiasBuelens/web-streams-polyfill/pull/72))
15
+ * 🐛 Fix `ReadableStream.tee()` resolving its `cancel()` promise too early ([#73](https://github.com/MattiasBuelens/web-streams-polyfill/pull/73))
16
+ * 👓 Align with [spec version `6762cdb`](https://github.com/whatwg/streams/tree/6762cdb4c6421cfa0da1d834d5a14fdd7326aaa5/) ([#73](https://github.com/MattiasBuelens/web-streams-polyfill/pull/73))
17
+
18
+ ## v3.0.2 (2020-02-10)
19
+
20
+ * 👓 Align with [spec version `200c971`](https://github.com/whatwg/streams/tree/200c971563b1a695fce3eebe6dab45c348ff0ac0/) ([#69](https://github.com/MattiasBuelens/web-streams-polyfill/pull/69))
21
+
22
+ ## v3.0.1 (2020-11-12)
23
+
24
+ * 📝 Add documentation to type definitions ([#62](https://github.com/MattiasBuelens/web-streams-polyfill/pull/62))
25
+ * 👓 Align with [spec version `6cd5e81`](https://github.com/whatwg/streams/tree/6cd5e81f6191fed9e7d99ee73d4941e3060311ce/) ([#63](https://github.com/MattiasBuelens/web-streams-polyfill/pull/63))
26
+ * 🐛 Fix an issue where the polyfill could throw an error when resolving/rejecting `reader.closed` when it was already resolved/rejected ([#66](https://github.com/MattiasBuelens/web-streams-polyfill/issues/66), [#67](https://github.com/MattiasBuelens/web-streams-polyfill/pull/67))
27
+
28
+ ## v3.0.0 (2020-07-20)
29
+
30
+ * 💥 Align with [spec version `62fe4c8`](https://github.com/whatwg/streams/tree/62fe4c8c0df34cec4ff28db9bfa69aec6c65e38d/) ([#52](https://github.com/MattiasBuelens/web-streams-polyfill/pull/52), [#57](https://github.com/MattiasBuelens/web-streams-polyfill/pull/57), [#59](https://github.com/MattiasBuelens/web-streams-polyfill/pull/59))
31
+ This includes the following **breaking changes**:
32
+ * All classes are now exposed globally. Concretely, this adds the following classes:
33
+ * `ReadableStreamDefaultController`
34
+ * `ReadableByteStreamController`
35
+ * `ReadableStreamBYOBRequest`
36
+ * `ReadableStreamDefaultReader`
37
+ * `ReadableStreamBYOBReader`
38
+ * `WritableStreamDefaultController`
39
+ * `WritableStreamDefaultWriter`
40
+ * `TransformStreamDefaultController`
41
+ * `ReadableStream.getIterator()` is renamed to `ReadableStream.values()`
42
+ * `ReadableByteStreamController.byobRequest` can be `null` (instead of `undefined`) if there is no current BYOB request.
43
+ * `ReadableStreamBYOBRequest.view` can be `null` (instead of `undefined`) if the BYOB request has already been responded to.
44
+ * Constructors and methods have stricter type checking for object arguments. For example, `new ReadableStream(null)` would previously behave like `new ReadableStream({})`, but now it throws a `TypeError` instead.
45
+ * Some constructors and methods may throw slightly different errors when given invalid arguments.
46
+ * Various byte-stream-related APIs now prohibit zero-length views or buffers.
47
+ * The async iterator of a `ReadableStream` now behaves more like an async generator, e.g. returning promises fulfilled with `{ value: undefined, done: true }` after `return()`ing the iterator, instead of returning a rejected promise.
48
+ * 💥 Updated TypeScript types to align with new specification ([#60](https://github.com/MattiasBuelens/web-streams-polyfill/pull/60))
49
+ While these are _technically_ breaking changes, you should only be affected if you manually reference these types from your code.
50
+ * `PipeOptions` is renamed to `StreamPipeOptions`
51
+ * `ReadResult` is replaced by `ReadableStreamDefaultReadResult` and `ReadableStreamBYOBReadResult`
52
+ * `ReadableStreamDefaultControllerCallback` is replaced by `UnderlyingSourceStartCallback` and `UnderlyingSourcePullCallback`
53
+ * `ReadableByteStreamControllerCallback` is replaced by `UnderlyingByteSourceStartCallback` and `UnderlyingByteSourcePullCallback`
54
+ * `ReadableStreamErrorCallback` is renamed to `UnderlyingSourceCancelCallback`
55
+ * `WritableStreamDefaultControllerStartCallback` is renamed to `UnderlyingSinkStartCallback`
56
+ * `WritableStreamDefaultControllerWriteCallback` is renamed to `UnderlyingSinkWriteCallback`
57
+ * `WritableStreamDefaultControllerCloseCallback` is renamed to `UnderlyingSinkCloseCallback`
58
+ * `WritableStreamErrorCallback` is renamed to `UnderlyingSinkAbortCallback`
59
+ * `TransformStreamDefaultControllerCallback` is replaced by `TransformerStartCallback` and `TransformerFlushCallback`
60
+ * `TransformStreamDefaultControllerTransformCallback` is renamed to `TransformerTransformCallback`
61
+
12
62
  ## v2.1.1 (2020-04-11)
13
63
 
14
64
  * 💅 Improve `ReadResult` in TypeScript type definitions. ([759506e](https://github.com/MattiasBuelens/web-streams-polyfill/commit/759506e00e55289ae6f92f30922b8855fcddd9ab), [#49](https://github.com/MattiasBuelens/web-streams-polyfill/pull/49))
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019 Mattias Buelens
3
+ Copyright (c) 2020 Mattias Buelens
4
4
  Copyright (c) 2016 Diwank Singh Tomer
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
package/README.md CHANGED
@@ -66,11 +66,11 @@ The `polyfill/es2018` and `ponyfill/es2018` variants work in any ES2018-compatib
66
66
 
67
67
  ### Compliance
68
68
 
69
- The polyfill implements [version `ed00d2f` (17 Feb 2020)][spec-snapshot] of the streams specification.
69
+ The polyfill implements [version `6762cdb` (31 Mar 2021)][spec-snapshot] of the streams specification.
70
70
 
71
71
  The polyfill is tested against the same [web platform tests][wpt] that are used by browsers to test their native implementations.
72
72
  The polyfill aims to pass all tests, although it allows some exceptions for practical reasons:
73
- * The `es2018` variant passes all of the tests, except for the [detached buffer tests for readable byte streams][wpt-detached-buffer].
73
+ * The `es2018` variant passes all of the tests, except for the ["bad buffers and views" tests for readable byte streams][wpt-bad-buffers].
74
74
  These tests require the implementation to synchronously transfer the contents of an `ArrayBuffer`, which is not yet possible from JavaScript (although there is a [proposal][proposal-arraybuffer-transfer] to make it possible).
75
75
  The reference implementation "cheats" on these tests [by making a copy instead][ref-impl-transferarraybuffer], but that is unacceptable for the polyfill's performance ([#3][issue-3]).
76
76
  * The `es6` variant passes the same tests as the `es2018` variant, except for the [test for the prototype of `ReadableStream`'s async iterator][wpt-async-iterator-prototype].
@@ -99,12 +99,12 @@ Thanks to these people for their work on [the original polyfill][creatorrr-polyf
99
99
  [promise-support]: https://kangax.github.io/compat-table/es6/#test-Promise
100
100
  [promise-polyfill]: https://www.npmjs.com/package/promise-polyfill
101
101
  [rs-asynciterator]: https://streams.spec.whatwg.org/#rs-asynciterator
102
- [spec-snapshot]: https://streams.spec.whatwg.org/commit-snapshots/ed00d2fe2d53ac5ad9ff8e727c7ef0a68f424074/
103
- [wpt]: https://github.com/web-platform-tests/wpt/tree/0ba0c4c07c8d2c23efdcc84dfc9043a3fdccbf19/streams
104
- [wpt-detached-buffer]: https://github.com/web-platform-tests/wpt/blob/0ba0c4c07c8d2c23efdcc84dfc9043a3fdccbf19/streams/readable-byte-streams/detached-buffers.any.js
102
+ [spec-snapshot]: https://streams.spec.whatwg.org/commit-snapshots/6762cdb4c6421cfa0da1d834d5a14fdd7326aaa5/
103
+ [wpt]: https://github.com/web-platform-tests/wpt/tree/1bdb43faa7434d36645ab5c64e754b5caefbc9d2/streams
104
+ [wpt-bad-buffers]: https://github.com/web-platform-tests/wpt/blob/1bdb43faa7434d36645ab5c64e754b5caefbc9d2/streams/readable-byte-streams/bad-buffers-and-views.any.js
105
105
  [proposal-arraybuffer-transfer]: https://github.com/domenic/proposal-arraybuffer-transfer
106
- [ref-impl-transferarraybuffer]: https://github.com/whatwg/streams/blob/ed00d2fe2d53ac5ad9ff8e727c7ef0a68f424074/reference-implementation/lib/helpers.js#L120
106
+ [ref-impl-transferarraybuffer]: https://github.com/whatwg/streams/blob/6762cdb4c6421cfa0da1d834d5a14fdd7326aaa5/reference-implementation/lib/abstract-ops/ecmascript.js#L16
107
107
  [issue-3]: https://github.com/MattiasBuelens/web-streams-polyfill/issues/3
108
- [wpt-async-iterator-prototype]: https://github.com/web-platform-tests/wpt/blob/0ba0c4c07c8d2c23efdcc84dfc9043a3fdccbf19/streams/readable-streams/async-iterator.any.js#L17
108
+ [wpt-async-iterator-prototype]: https://github.com/web-platform-tests/wpt/blob/1bdb43faa7434d36645ab5c64e754b5caefbc9d2/streams/readable-streams/async-iterator.any.js#L24
109
109
  [stub-async-iterator-prototype]: https://github.com/MattiasBuelens/web-streams-polyfill/blob/v2.0.0/src/target/es5/stub/async-iterator-prototype.ts
110
110
  [creatorrr-polyfill]: https://github.com/creatorrr/web-streams-polyfill