Closed Bug 1772772 Opened 2 years ago Closed 1 year ago

Implement ReadableStream.from

Categories

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

task

Tracking

()

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

People

(Reporter: evilpie, Assigned: evilpie)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete)

Attachments

(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 https://wpt.live/streams/readable-streams/from.any.html.

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 evilpies@gmail.com: https://hg.mozilla.org/integration/autoland/rev/c9d9d8e3fae1 Implement ReadableStream.from. r=saschanaz,spidermonkey-reviewers,webidl,mgaudet
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/40875 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 1 year 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 https://github.com/mdn/content/issues/28282

Regressions: 1846893

FF117 MDN docs work can be tracked in https://github.com/mdn/content/issues/28282

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

Attachment

General

Created:
Updated:
Size: