-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a dedicated section for interfacing with other specs #1073
Conversation
This incorporates much of https://fetch.spec.whatwg.org/commit-snapshots/ad9a84ad91fb6bd3a2dcdf0406321785f51c4c11/#streams, as well as https://wicg.github.io/compression/#generic-transform-stream. It also looks at how https://wicg.github.io/native-file-system/ uses writable streams, and creates wrapper algorithms to make that easier. Closes #372.
This should also have a section on duplex streams like https://reillyeon.github.io/serial/#serialport-interface. I don't think they need any new algorithms, but stating things like "use the names |
Note that w3c/media-source#14 may eventually also be resolved such that Media Source Extensions becomes another interface point for the Streams API. |
I've had an initial read-through and it looks good. |
We will also need to integrate with https://wicg.github.io/web-transport/ but that should be straightforward. |
Mostly adding a lot of "-ing" linking text variants
Follows whatwg/streams#1073. Also includes minor editorial touchups to the algorithms as I was editing them.
OK, PRs sent to all of the above; I updated the OP with them. I got all ready to send one for WebTransport, but they don't appear to be currently at a level of rigor where this makes sense; they just talk about "Set X to a ReadableStream of Uint8Arrays representing (some abstract concept), currently empty". I guess the assumption is that all the enqueuing/closing/erroring is encapsulated in that "represents", hmm. |
No problem, we have to increase the level of rigor anyway, so we can adopt the new interfaces at the same time. Sorry for wasting your time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from my concern about read-loop, this lgtm.
Sorry for the delayed review.
1. If |chunk| is not a {{Uint8Array}} object, [=reject=] |promise| with a {{TypeError}} and | ||
abort these steps. | ||
1. Append the bytes represented by |chunk| to |bytes|. | ||
1. [=Read-loop=] given |reader|, |bytes|, and |promise|. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can call ReadableStreamDefaultReaderRead re-entrantly, which is a bit scary. As far as I can tell it's safe in the standard language, but implementations can fail due to stack overflow. Easiest fix would probably be to post a microtask.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Given that there's already a note explaining that this might be implemented rather differently, I think it'd be best to make a note of the danger, and encourage implementations to mitigate it in a way that doesn't require "read all bytes" to delay for (number of chunks) microtasks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I guess such a requirement wouldn't be observable either, so scratch that part of my comment. But still.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Follows whatwg/streams#1073. Co-authored-by: Andreu Botella <abb@randomunok.com> Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
* Use new Streams algorithms Follows whatwg/streams#1073. * Namespacing tweaks * No subsubsteps Co-authored-by: Jake Archibald <jaffathecake@gmail.com> * Missing :: Co-authored-by: Jake Archibald <jaffathecake@gmail.com>
Follows whatwg/streams#1073. Also includes minor editorial touchups to the algorithms as I was editing them. Also improves the Makefile.
This incorporates much of https://fetch.spec.whatwg.org/#streams, as well as https://wicg.github.io/compression/#generic-transform-stream. It also looks at how https://wicg.github.io/native-file-system/ uses writable streams, and creates wrapper algorithms to make that easier.
Closes #372.
This is probably ready for review, but we shouldn't merge it until I have created update pull requests for at least:
and have validated that this suffices for their purposes.
Also, I'll be opening another issue about GenericTransformStream.
Preview | Diff