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

Optimize ReadableStream.from() #144

Merged
merged 4 commits into from
Feb 28, 2024
Merged

Optimize ReadableStream.from() #144

merged 4 commits into from
Feb 28, 2024

Conversation

MattiasBuelens
Copy link
Owner

The current implementation of CreateAsyncFromSyncIterator uses an async function* to turn a sync iterator into an async iterator. This reduces the amount of code we have to write, but it does pull in a lot of extra helpers to down-level the async generator function (such as __generator and __asyncGenerator from tslib).

This PR re-implements CreateAsyncFromSyncIterator manually, based on the spec. The code isn't that much longer, but the package size is smaller.

@MattiasBuelens MattiasBuelens added this to the v4.0.0 milestone Feb 28, 2024
@MattiasBuelens MattiasBuelens merged commit 7ffbb95 into v4 Feb 28, 2024
@MattiasBuelens MattiasBuelens deleted the optimize-rs-from branch February 28, 2024 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant