nodejs / nodejs/node

Streams: use Web IDL `async_sequence` in `ReadableStream.from`

Open
#64,288 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

web streams web-standards
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.