yutakahirano / fetch-with-streams

Fetch API integrated with Streams.
66 stars 8 forks source link

Do not conflate IDL ReadableStream and JS ReadableStream implicitly. #52

Closed yutakahirano closed 6 years ago

yutakahirano commented 8 years ago

Branched from #50.

We need to distinguish "fetch" (or "IDL") ReadableStream and "JavaScript" ReadableStream, and make their relationship clean.

yutakahirano commented 8 years ago

I think defining operations such as close and enqueue in the infrastructure section and using them from other parts are good for readability and modularity - We can say that we define IDL ReadableStream in the infrastructure section and we can move it to the WebIDL spec or the Streams spec later. Even if we choose the first option of https://github.com/yutakahirano/fetch-with-streams/pull/50#issuecomment-126411742, handling ReadableStream as an IDL type in main fetch sections would be beneficial.

What do you think, @annevk, @domenic?

annevk commented 8 years ago

Yeah, having it in the infrastructure temporarily makes sense.

domenic commented 8 years ago

I guess this makes sense if you prefer saying "enqueue idlChunk into idlReadableStream" instead of using EnqueueReadableStream directly on JS objects. It is probably a good refactoring.

annevk commented 7 years ago

Maybe we should open an issue against IDL for this?