[whatwg] [Fetch] ambiguity problem?

Not wanting to start a giant bikeshed here but if you have a look at Jake's
Service Worker Examples as an early use of fetch and streams, it seems
clear that many developers would be surprised by behavior of not being
about to refer back to the response body.  I'd like to suggest that this is
less a problem with service workers and more with the (current at least)
unfamiliarity with the idea that body is a stream, and maybe a lack of
recognizable way to tell the difference from native apis.  It seems like
this is always going to be the case with code using fetch, not unique to
ServiceWorkers.  I think that commonly as developers we are used to
response being a string or an already parsed object or something, and since
both will persist in the platform.  As such, I'd like to pose the idea of
changing the IDL in

5.4 Response Class

To add the word stream.  I think in this case, the extra characters aren't
bad and the clarity outweighs the cost.  As in:

readonly attribute FetchBodyStream
<http://fetch.spec.whatwg.org/#fetchbodystream> body
<http://fetch.spec.whatwg.org/#dom-request-body>Stream;

Received on Tuesday, 12 August 2014 13:08:13 UTC