Streams: use Web IDL `async_sequence` in `ReadableStream.from`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 122k
- Forks
- 37.3k
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 283
Description
We are updating the Streams specification to use Web IDL's async_sequence<T> type for the input of ReadableStream.from(). The new IDL is:
interface ReadableStream {
static ReadableStream from(async_sequence<any> asyncIterable);
}
This comes with one behavioral change: ReadableStream.from("abc") used to iterate over the Unicode code points of the string (per String.prototype[Symbol.iterator]), but this will now throw a TypeError instead. The WPT tests have been updated to reflect this.
Specification change: https://github.com/whatwg/streams/pull/1372
Tests: https://github.com/web-platform-tests/wpt/pull/59594
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the ReadableStream.from() entry point and read the linked Streams specification change in PR 1372. Compare the updated WPT coverage in PR 59594, then verify that async_sequence inputs work and that passing "abc" produces a TypeError rather than iterating its code points.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100