Use async iterable webidl type in ReadableStream.from#1310
Use async iterable webidl type in ReadableStream.from#1310lucacasonato wants to merge 5 commits intowhatwg:mainfrom
async iterable webidl type in ReadableStream.from#1310Conversation
MattiasBuelens
left a comment
There was a problem hiding this comment.
Looks good so far! 👍
Once the Web IDL spec change lands, we'll need to update webidl2js to implement the new algorithms for async iterables, and then we can update our reference implementation. Let's keep this PR as a draft until that's sorted out.
|
@MattiasBuelens Updated! I am planning to submit a PR to EDIT: PR for webidl2.js: w3c/webidl2.js#775 |
|
Moving over the question of whether this API should support The question posed is, "Should I think there are three possible outcomes here:
The current behaviour of the spec is option 2. Option 1 would be a more significant breaking change than option 3, but both are unlikely to have web compat issues. I say this because a) If we want to support passing strings, option 3 would likely be faster than option 2, because of the lower number of enqueue operations, string allocations, and object allocations involved. It would also mirror the behaviour of On the other hand, if we do not support strings at all (option 1), users would never be suprised by the choice we made between 1 and 2. Instead, they always get an explicit error that they can then deal with themselves. Both options are still trivially expressible using minimal changes by the developer. If they wanted to emulate the behaviour of option 2, they can do My preference is to option 1, followed by option 2 (if we want to support strings at all). I acknowledge that there would then be divergence between |
|
My preference is also for option 1. |
|
Mozilla has no use counter for string case. I can't imagine the use case either, but might be worth checking first. |
|
@ricea @saschanaz can we take your comments to count as implementer interest for this change? That would also unblock the IDL change. |
|
Yes, you can consider Blink interested. |
|
Also LGTM for stream change. |
MattiasBuelens
left a comment
There was a problem hiding this comment.
Still LGTM, with one small nit.
|
|
||
| <div algorithm> | ||
| <dfn abstract-op lt="ReadableStreamFromIterable" id="readable-stream-from-iterable"> | ||
| <dfn abstract-op export lt="ReadableStreamFromIterable" id="readable-stream-from-iterable"> |
There was a problem hiding this comment.
Will be needed to resolve whatwg/fetch#1291, which is my next project :)
There was a problem hiding this comment.
In that case you would want a separate op in section 9, this one is in section 4 and not supposed to be directly used by other specs.
There was a problem hiding this comment.
Ok, will revert this here
|
@lucacasonato any reason this hasn't moved forward? |
|
@annevk I did not have time yet to finish the WebIDL PR - I am doing that now though :) |
|
@lucacasonato Do you mind if I pick this up again? I noticed that the specification changed a little bit: I've opened jsdom/webidl2js#278. Once that lands, we can update the reference implementation to let webidl2js handle the conversion. |
Ref whatwg/webidl#1397
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff