Closed yutakahirano closed 9 years ago
@annevk, @domenic, can you take a look?
So I think some of this needs to move to IDL, since otherwise it doesn't work technically. You can't really mix operations on IDL objects and JavaScript objects freely like that.
Otherwise this seems fine. The harder aspect is when the stream is controlled by the developer.
Fixed IDL.
I think some of this needs to move to IDL, since otherwise it doesn't work technically. You can't really mix operations on IDL objects and JavaScript objects freely like that.
Sorry I don't understand. Can you give an example?
What we return is an IDL ReadableStream
. What JavaScript sees is a JavaScript ReadableStream
. IDL needs to be updated to handle this. I filed https://www.w3.org/Bugs/Public/show_bug.cgi?id=28988 a while ago to get this added by the way.
(To even use ReadableStream
in IDL, it needs to be listed there.)
Thanks.
Then operations such as construction, en-queuing, closing, etc. will be defined in WebIDL, right? Will dependency to the Streams spec be replaced by dependency to WebIDL?
Yeah, sounds about right.
This seems good but I think we should add a note about ReadableStream vs. ReadableByteStream as I kind of said in #46. I will try to draft such a note later.
Then operations such as construction, en-queuing, closing, etc. will be defined in WebIDL, right? Will dependency to the Streams spec be replaced by dependency to WebIDL?
This seems kind of sucky. Web IDL should not need to be updated in such close tandem with the operations on streams. My preference would be, from most preferable to least:
The additions to Web IDL should be minor. I am thinking just the two type conversion rules.
Also, I do think maybe streams should incorporate the "to construct a fixed ReadableStream" or "to construct an empty ReadableStream." I can try to move those over to streams. They would operate on JS objects by default though.
With JavaScript, IDL had to take care of all the conversions. Now we define JavaScript features outside of JavaScript, perhaps both could carry some weight as you suggest. I would prefer us to be formally correct, but I'm okay with short term hacks.
Thanks, @domenic, I added description about Readable[Byte]Stream.
I filed a new issue #52 for ReadableStream distinction.
Thanks!
For #46.