W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2014

Re: [whatwg] Fetch: use separate methods instead of one `to` method in FetchBodyStream

From: Jussi Kalliokoski <jussi.kalliokoski@gmail.com>
Date: Mon, 16 Jun 2014 16:03:37 +0300
Message-ID: <CAJhzemX0X+a+vMzppauauX1iGN5O3kd81wXPA-149Tz=eMnrog@mail.gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
Cc: WHATWG <whatwg@whatwg.org>
On Mon, Jun 16, 2014 at 3:00 PM, Anne van Kesteren <annevk@annevk.nl> wrote:

> On Mon, Jun 16, 2014 at 12:57 PM, Jussi Kalliokoski
> <jussi.kalliokoski@gmail.com> wrote:
> > Another bad example of using strings for these kind of things, from much
> > closer, is XHR's responseType where it's excruciatingly painful to try to
> > detect for example whether responseType "json" (it may throw when you set
> > it, it may result in the `error` event or it may silently fail and set
> the
> > JSON as string to response) is supported, let alone "arraybuffer".
>
> Those sound like bugs in the implementation. If a given value is not
> supported, setting should not happen. (And in the case of to(), it'll
> reject.)
>

Bugs indeed.


>
> > Feature detection is not the only concern though, another one is that it
> > encourages putting a lot of complexity behind one flag (just like
> > responseType) which is likely to lead to interoperability issues.
>
> It's not that much complexity really.
>

Fair enough. However, I'm curious as to what's the rationale behind having
it all behind one function as opposed to a function per action?

Cheers, Jussi


>
>
> --
> http://annevankesteren.nl/
>
Received on Monday, 16 June 2014 13:04:04 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:21 UTC