Tags:
- 💥 Breaking Change
- 👓 Spec Compliance
- 🚀 New Feature
- 🐛 Bug Fix
- 👎 Deprecation
- 📝 Documentation
- 🏠 Internal
- 💅 Polish
- 💥 Rework the list of variants to have more modern defaults. The table below shows how to upgrade your v3 import to their equivalent v4 import. See the migration guide for more information. (#82, #139)
- 💥 Remove the ES2018 variant, in favor of the ES2015 variant.
- 💥 Switch to subpath exports for variants.
- Node 12 or higher is required to
import
orrequire()
a variant. - When using TypeScript, version 4.7 or higher is now required. Additionally,
moduleResolution
must be set to"node16"
,"nodenext"
or"bundler"
.
- Node 12 or higher is required to
- 🚀 Support importing as ESM in Node.
- 💅 Minify all code in the published package, to reduce the download size.
- 💅 Rework
ReadableStream.from()
implementation to avoid depending onasync function*
down-leveling for ES5. (#144)
v3 import | v4 import | description |
---|---|---|
web-streams-polyfill |
web-streams-polyfill/polyfill/es5 |
ES5+ polyfill |
web-streams-polyfill/es6 |
web-streams-polyfill/polyfill |
ES2015+ polyfill |
web-streams-polyfill/es2018 |
web-streams-polyfill/polyfill |
ES2015+ polyfill |
web-streams-polyfill/ponyfill |
web-streams-polyfill/es5 |
ES5+ ponyfill |
web-streams-polyfill/ponyfill/es6 |
web-streams-polyfill |
ES2015+ ponyfill |
web-streams-polyfill/ponyfill/es2018 |
web-streams-polyfill |
ES2015+ ponyfill |
- 🐛 Fix bad publish to npm.
- 🐛 Revert
engines
bump inpackage.json
. (#137, #138) - 🐛 Re-introduce support for TypeScript 3.5 and below. (#137, #138)
- 🚀 Added global augmentations for
ReadableStream
to the polyfill's type definitions. (#130)- This allows TypeScript users to use new methods such as
ReadableStream.prototype[Symbol.asyncIterator]()
, even when TypeScript doesn't yet have a built-in type definition for them.
- This allows TypeScript users to use new methods such as
💥 The type definitions now require TypeScript 3.6 or higher. (#130)(Reverted in version 3.3.1)- 👓 Align with spec version
4dc123a
(#115, #134)- Added
ReadableStream.from(asyncIterable)
, which creates aReadableStream
wrapping the given iterable or async iterable. This can also be used to wrap a nativeReadableStream
(e.g. aResponse.body
fromfetch()
), even if the nativeReadableStream
doesn't yet support async iteration. (#135) - Added
Transformer.cancel
method, which is called when the readable side of aTransformStream
is cancelled or when its writable side is aborted. - Added
min
option toReadableStreamBYOBReader.read(view, options)
. - Added support for
AbortSignal.reason
when aborting a pipe.
- Added
- 🚀 Buffers passed to
ReadableStreamBYOBReader.read(view)
will now be correctly transferred if eitherArrayBuffer.prototype.transfer()
orstructuredClone()
is available. (#136) - 🐛 Prevent warnings from Bluebird about a promise being created within a handler but not being returned from a handler. (#131)
- 🏠 Improve internal
DOMException
polyfill. (#133)
- 🐛 Fix an error in very old browsers where
Function.name
is non-configurable. (#112)
- 👎 Deprecate
WritableStreamDefaultController.abortReason
(#102)- Use
WritableStreamDefaultController.signal.reason
instead.
- Use
- 👓 Align with spec version
4b6b93c
(#103)
- 🚀 Calling
ReadableStream.tee()
on a readable byte stream now returns two readable byte streams. (#81) - 🚀 Add
WritableStreamDefaultController.signal
and.abortReason
. (#81).signal
requires a globalAbortController
constructor to be available. If necessary, use a polyfill.
- 🐛 Make sure streams created with a different version of the polyfill do not pass the brand checks. (#75, #77)
- 👓 Align with spec version
cada812
(#79, #81)
- 💅 Change
Promise<void>
toPromise<undefined>
in TypeScript type definitions (#72) - 🐛 Fix
ReadableStream.tee()
resolving itscancel()
promise too early (#73) - 👓 Align with spec version
6762cdb
(#73)
- 👓 Align with spec version
200c971
(#69)
- 📝 Add documentation to type definitions (#62)
- 👓 Align with spec version
6cd5e81
(#63) - 🐛 Fix an issue where the polyfill could throw an error when resolving/rejecting
reader.closed
when it was already resolved/rejected (#66, #67)
- 💥 Align with spec version
62fe4c8
(#52, #57, #59)
This includes the following breaking changes:- All classes are now exposed globally. Concretely, this adds the following classes:
ReadableStreamDefaultController
ReadableByteStreamController
ReadableStreamBYOBRequest
ReadableStreamDefaultReader
ReadableStreamBYOBReader
WritableStreamDefaultController
WritableStreamDefaultWriter
TransformStreamDefaultController
ReadableStream.getIterator()
is renamed toReadableStream.values()
ReadableByteStreamController.byobRequest
can benull
(instead ofundefined
) if there is no current BYOB request.ReadableStreamBYOBRequest.view
can benull
(instead ofundefined
) if the BYOB request has already been responded to.- Constructors and methods have stricter type checking for object arguments. For example,
new ReadableStream(null)
would previously behave likenew ReadableStream({})
, but now it throws aTypeError
instead. - Some constructors and methods may throw slightly different errors when given invalid arguments.
- Various byte-stream-related APIs now prohibit zero-length views or buffers.
- The async iterator of a
ReadableStream
now behaves more like an async generator, e.g. returning promises fulfilled with{ value: undefined, done: true }
afterreturn()
ing the iterator, instead of returning a rejected promise.
- All classes are now exposed globally. Concretely, this adds the following classes:
- 💥 Updated TypeScript types to align with new specification (#60)
While these are technically breaking changes, you should only be affected if you manually reference these types from your code.PipeOptions
is renamed toStreamPipeOptions
ReadResult
is replaced byReadableStreamDefaultReadResult
andReadableStreamBYOBReadResult
ReadableStreamDefaultControllerCallback
is replaced byUnderlyingSourceStartCallback
andUnderlyingSourcePullCallback
ReadableByteStreamControllerCallback
is replaced byUnderlyingByteSourceStartCallback
andUnderlyingByteSourcePullCallback
ReadableStreamErrorCallback
is renamed toUnderlyingSourceCancelCallback
WritableStreamDefaultControllerStartCallback
is renamed toUnderlyingSinkStartCallback
WritableStreamDefaultControllerWriteCallback
is renamed toUnderlyingSinkWriteCallback
WritableStreamDefaultControllerCloseCallback
is renamed toUnderlyingSinkCloseCallback
WritableStreamErrorCallback
is renamed toUnderlyingSinkAbortCallback
TransformStreamDefaultControllerCallback
is replaced byTransformerStartCallback
andTransformerFlushCallback
TransformStreamDefaultControllerTransformCallback
is renamed toTransformerTransformCallback
- 👓 Align with spec version
ed00d2f
(#43, #44) - 🏠 Down-level type definitions for older TypeScript versions. (#41)
- 👓 Align with spec version
ae5e0cb
(#33) - 🐛 Fix support for non-browser environments, such as Node.
- 🐛 Fix pipe not aborting when both
preventAbort
andpreventCancel
are set (#31) - 👓 Align with spec version
e4d3b1a
(#31)
- 👓 Align with spec version
6f94580
(#21) - 🏠 Run web platform tests on ES5 variant (#19)
-
💥 Ownership change: @mattiasbuelens/web-streams-polyfill has been republished as web-streams-polyfill. For the full list of changes between web-streams-polyfill v1.3.2 and this version, visit the fork's changelog.
-
💥 CommonJS entry points have been moved to
dist/
:index.js
➡dist/polyfill.js
index.es6.js
➡dist/polyfill.es6.js
However, we recommend migrating to a variant sub-package instead:
require('web-streams-polyfill/index.js')
➡require('web-streams-polyfill')
require('web-streams-polyfill/index.es6.js')
➡require('web-streams-polyfill/es6')
-
👓 Align with spec version
2c8f35e
-
🏠 Code moved from creatorrr/web-streams-polyfill to MattiasBuelens/web-streams-polyfill