Skip to content
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

Use new Streams algorithms #1533

Merged
merged 4 commits into from
Sep 15, 2020
Merged

Conversation

domenic
Copy link
Contributor

@domenic domenic commented Aug 27, 2020

Follows whatwg/streams#1073.

Do not merge until that PR is merged. But, feel free to review.

See also speced/bikeshed#1758.


Preview | Diff

@ricea
Copy link
Contributor

ricea commented Sep 10, 2020

Drive-by lgtm.

docs/index.bs Outdated Show resolved Hide resolved
docs/index.bs Outdated
Comment on lines 1599 to 1603
: [=read request/close steps=]
::
1. Set |end-of-body| to true.
: [=read request/error steps=]
1. [=ReadableStream/error=] |newStream| with a {{TypeError}}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The markup seems inconsistent here. With the error steps, the steps aren't in a definition item. Given that they're both a single step, do they need to be in an ordered list at all? Should it be:

Suggested change
: [=read request/close steps=]
::
1. Set |end-of-body| to true.
: [=read request/error steps=]
1. [=ReadableStream/error=] |newStream| with a {{TypeError}}.
: [=read request/close steps=]
:: Set |end-of-body| to true.
: [=read request/error steps=]
:: [=ReadableStream/error=] |newStream| with a {{TypeError}}.

Also, is it typical to use lower case for "close steps" and "error" even though they're at the beginning of a sentence?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching the missing ::!

I find it clearer when steps are numbered, but we could remove it if you'd prefer; the reader can understand.

I don't think of <dd>s as "sentences", personally, but instead terms. So I don't capitalize them unless they're proper nouns.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. Add in the :: then it's good to go.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to push; should be good now!

1. When |promise| is fulfilled with a value that matches with neither of the above patterns, or |promise| is rejected, [=ReadableStream/error=] |newStream| with a `TypeError`.
1. Let |cancel| be an action that [=ReadableStream/cancels=] |response|'s [=response/body=]'s [=stream=] with |reader|.
1. Let |newStream| be the result of [=ReadableStream/construct a ReadableStream object=] with |highWaterMark|, |sizeAlgorithm|, |pull|, and |cancel| in |targetRealm|.
1. Let |newStream| be the result of [=ReadableStream/creating=] a {{ReadableStream}} with <a for=ReadableStream/create><var ignore>pullAlgorithm</var></a> set to |pullAlgorithm|, <a for=ReadableStream/create><var ignore>cancelAlgorithm</var></a> set to |cancelAlgorithm|, <a for=ReadableStream/create><var ignore>highWaterMark</var></a> set to |highWaterMark|, and <a for=ReadableStream/create><var ignore>sizeAlgorithm</var></a> set to |sizeAlgorithm|, in |targetRealm|.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, was this the agreed markup for this? It seems weird to create a var that you have to ignore. And of course it doesn't work with bikeshed's shorthand.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with this, but in general I don't see the need for the vars here.

When we "Set document's foo to bar", we don't wrap foo in a <var>, so I don't see the need to do it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the discussion in whatwg/infra#320

domenic and others added 2 commits September 14, 2020 16:01
Co-authored-by: Jake Archibald <jaffathecake@gmail.com>
@jakearchibald jakearchibald merged commit eab774e into w3c:master Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants