Closed Bug 1772772 Opened 2 years ago Closed 5 months ago

Implement ReadableStream.from


(Core :: DOM: Streams, task, P3)




117 Branch
Tracking Status
relnote-firefox --- 117+
firefox117 --- fixed


(Reporter: evilpie, Assigned: evilpie)


(Blocks 1 open bug)


(Keywords: dev-doc-complete)


(1 file)

The static method ReadableStream.from is still waiting to be merged into the spec. I wrote an implementation to evaluate the design.

My observations:

  • We don't actually expose any of the Iterator functionally outside of self-hosting and mostly just do everything in bytecode. This made interacting with iterators from C++ not really possible or at least more difficult
  • To implement the cancelAlgorithm we would need to additionally expose GetMethod which is currently self-hosted (except for Proxies?). It's unfortunate this this doesn't just use IteratorClose, but I think this might be related to having the return value of the return() call available?
Assignee: nobody → evilpies

Wow, this is a really nice piece of work. '

To your second point, looking at the contract for an underlying source cancel promise, it's weird that unlike almost all the other cancel algorithms its producing a complicated IteratorResult value; perhaps the feedback here from us ought to just be "Use {Async}IteratorClose, and either have the promise be undefined or throw."

Severity: -- → S3
Priority: -- → P3
Assignee: nobody → evilpies
Depends on: 1684272

ReadableStream.from was merged into the spec proper yesterday. I've updated the patch and we are passing everything on

Summary: Maybe implement ReadableStream.from → Implement ReadableStream.from
Attachment #9279798 - Attachment description: WIP: Bug 1772772 - WIP: ReadableStream.from → Bug 1772772 - Implement ReadableStream.from. r?saschanaz!,#spidermonkey-reviewers!
Keywords: dev-doc-needed
Pushed by
Implement ReadableStream.from. r=saschanaz,spidermonkey-reviewers,webidl,mgaudet
Created web-platform-tests PR for changes under testing/web-platform/tests
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch
Upstream PR merged by moz-wptsync-bot

Is this something we should call out in the Fx117 relnotes?

Flags: needinfo?(evilpies)

I wonder all dev-doc-needed should also have relnote.

Release Note Request (optional, but appreciated)
[Why is this notable]: Normally I wouldn't call this really notable, but we seem to be documenting similar stuff in e.g. 115
[Affects Firefox for Android]: yes
[Suggested wording]: The ReadableStream.from allows creating a ReadableStream from an (async) iterable.
[Links (documentation, blog post, etc)]: We probably want to link to MDN when ready.

relnote-firefox: --- → ?
Flags: needinfo?(evilpies)

Added to the Fx117 relnotes.

FF117 MDN docs for this can be tracked in

FF117 MDN docs work can be tracked in

Regressions: 1857925
No longer regressions: 1857925
You need to log in before you can comment on or make changes to this bug.