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

Response construction with ReadableStream #283

Merged
merged 5 commits into from Apr 14, 2016

Conversation

yutakahirano
Copy link
Member

This change enables constructing a Response from ReadableStream, as discussed in
yutakahirano/fetch-with-streams#63.

@@ -3842,7 +3842,8 @@ <h4 id="should-response-to-request-be-blocked-due-to-nosniff?"><dfn title="shoul
<h3>Body mixin</h3>

<pre class=idl>typedef any <dfn>JSON</dfn>;
typedef (<span data-anolis-spec=fileapi>Blob</span> or BufferSource or <span data-anolis-spec=xhr>FormData</span> or <span data-anolis-spec=url>URLSearchParams</span> or USVString) <dfn>BodyInit</dfn>;</pre>
typedef (<span data-anolis-spec=fileapi>Blob</span> or BufferSource or <span data-anolis-spec=xhr>FormData</span> or <span data-anolis-spec=url>URLSearchParams</span> or USVString) <dfn>RequestBodyInit</dfn>;
typedef (<span data-anolis-spec=fileapi>Blob</span> or BufferSource or <span data-anolis-spec=xhr>FormData</span> or <span data-anolis-spec=url>URLSearchParams</span> or USVString or <code title=concept-ReadableStream>ReadableStream</code>) <dfn>ResponseBodyInit</dfn>;</pre>
Copy link
Member

Choose a reason for hiding this comment

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

Why not typedef (<span>BodyInit</span> or <span title=concept-ReadableStream>ReadableStream</span>) <dfn>ResponseBodyInit</dfn> or just inline that for the Response constructor since it's only used once? Changing BodyInit is problematic since other specifications use it too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed. I'd like to define ResponseBodyInit here because with ResponseBodyInit it's easier to understand why we have ReadableStream clause in "extract a body and a Content-Type value" algorithm.

Copy link
Member

Choose a reason for hiding this comment

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

Fair.

@@ -3842,7 +3842,8 @@ <h4 id="should-response-to-request-be-blocked-due-to-nosniff?"><dfn title="shoul
<h3>Body mixin</h3>

<pre class=idl>typedef any <dfn>JSON</dfn>;
typedef (<span data-anolis-spec=fileapi>Blob</span> or BufferSource or <span data-anolis-spec=xhr>FormData</span> or <span data-anolis-spec=url>URLSearchParams</span> or USVString) <dfn>BodyInit</dfn>;</pre>
typedef (<span data-anolis-spec=fileapi>Blob</span> or BufferSource or <span data-anolis-spec=xhr>FormData</span> or <span data-anolis-spec=url>URLSearchParams</span> or USVString) <dfn>BodyInit</dfn>;
typedef (<span>BodyInit</span> or <code title=concept-ReadableStream>ReadableStream</code>) <dfn>ResponseBodyInit</dfn>;</pre>
Copy link
Member

Choose a reason for hiding this comment

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

I was about to merge, but you need to use <span> inside <pre>, not <code>. Otherwise the coloring gets weird. A <pre class=idl> block is code already in a way.

Copy link
Member Author

Choose a reason for hiding this comment

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

I see, thanks. Fixed.

@annevk annevk merged commit 4924f6d into master Apr 14, 2016
@annevk annevk deleted the response-construction-with-stream branch April 14, 2016 08:37
@annevk
Copy link
Member

annevk commented Apr 14, 2016

\o/

@yutakahirano
Copy link
Member Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants