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

Make ReadableStream properly implement AsyncIterable #142

Merged
merged 6 commits into from
Jan 14, 2024

Conversation

MattiasBuelens
Copy link
Owner

The ReadableStream class from the polyfill didn't exactly match the AsyncIterable<R> type from TypeScript. This caused type errors for downstream users.

Also, if Symbol.asyncIterator doesn't exist, we now try to use Symbol.for("Symbol.asyncIterator") instead to match core-js 3, or fall back to the string "@@asyncIterator" as a last resort.

Fixes #141.

@MattiasBuelens MattiasBuelens merged commit 726af09 into master Jan 14, 2024
5 checks passed
@MattiasBuelens MattiasBuelens deleted the fix-async-iterator branch January 14, 2024 20:59
@jacoblee93
Copy link

Thank you!

@jacoblee93
Copy link

@MattiasBuelens from the release on the main page here, it doesn't look like this made it to prod yet - would you be able to ship a new 3.3.3 release?

@MattiasBuelens MattiasBuelens added this to the v3.3.3 milestone Feb 16, 2024
@MattiasBuelens
Copy link
Owner Author

@jacoblee93 Woops, I thought I already made a release for this. Sorry!

Version 3.3.3 is now up. 🚀

@jacoblee93
Copy link

Ah let's go! Thank you 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ReadableStream typing does not match async iterator spec
2 participants