Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v6] Drop support for native Node Readable stream: require passing Node Web Streams #1716

Merged
merged 4 commits into from
Jan 26, 2024

Conversation

larabr
Copy link
Collaborator

@larabr larabr commented Jan 25, 2024

Breaking change: all functions taking streams as inputs will now require passing Web Streams in Node.js . If given a native stream.Readable input, they will throw. The browser build is unaffected by this change.

More context about WebStream stream support in Node.js:
Node v16.5.0 adds supports for the Web Stream API, see https://nodejs.org/api/webstreams.html#web-streams-api .
Utils to convert from and to Web Streams in Node are available from v17,
see https://nodejs.org/api/stream.html#streamreadabletowebstreamreadable-options .

Previously, we automatically converted between Node native streams and custom, Web-like Readable streams.
This led to occasional issues (fix #1690).

…b Streams

Utils to convert from and to Web Streams in Node are available from v17,
see https://nodejs.org/api/stream.html#streamreadabletowebstreamreadable-options .

Previously, we automatically converted between Node native streams and custom, Web-like Readable streams.
This led to occasional issues.
Avoid interfaces, since the original types are not interfaces either,
and in TS v5 it could cause type inference issues between GenericWebStreams
and the redefined WebStreams.
Move to away from Node native streams.
@larabr larabr merged commit 99899d1 into openpgpjs:v6 Jan 26, 2024
12 checks passed
@larabr larabr mentioned this pull request Feb 1, 2024
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants