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

Re: [whatwg] Fetch API: asHTML

From: Anne van Kesteren <annevk@annevk.nl>
Date: Mon, 23 Jun 2014 17:28:36 +0200
Message-ID: <CADnb78iC9BQJDRBCc4UTi7jxwpz-HVY9ahJgQja2ehjnh9zuxg@mail.gmail.com>
To: Adam Barth <w3c@adambarth.com>
Cc: Joshua Peek <josh@joshpeek.com>, WHATWG <whatwg@whatwg.org>
On Mon, Jun 23, 2014 at 5:11 PM, Adam Barth <w3c@adambarth.com> wrote:
> XMLHttpRequest isn't particularly cleanly layered.  It's sounds like
> you're not overly concerned about layering, which is probably fine.

I think I see what you mean. If you wanted to implement this in terms
of JavaScript then indeed you would end up importing several modules
other than the fetch module to implement these methods. E.g. encoding,
for asText, filesystem and MIME for asBlob, and encoding and JSON for
asJSON. For asHTML you'd need encoding and HTML.

This seems fine to me.

However, I could see it instead has to go the other way around.
Instead of having a bunch of methods on stream to convert it into
various other pieces. Other pieces could have ways of dealing with
streams. That might make coding a bit more awkward though.


-- 
http://annevankesteren.nl/
Received on Monday, 23 June 2014 15:29:02 UTC

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