W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: Is BlobBuilder needed?

From: Rick Waldron <waldron.rick@gmail.com>
Date: Wed, 26 Oct 2011 19:44:23 -0400
Message-ID: <4ea89b61.8221e00a.78ec.7835@mx.google.com>
To: "Jonas Sicking" <jonas@sicking.cc>, "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: "Ojan Vafai" <ojan@chromium.org>, "Michael Nordman" <michaeln@google.com>, "Erik Arvidsson" <arv@chromium.org>, "Eric U" <ericu@google.com>, "Webapps WG" <public-webapps@w3.org>
var b = new Blob([foo, bar], { contentType: "text/plain" });

This is really nice looking and feeling. Options objects are definitely a win


On Oct 26, 2011 7:17 PM, Jonas Sicking &lt;jonas@sicking.cc&gt; wrote: 

On Tue, Oct 25, 2011 at 12:57 PM, Tab Atkins Jr. &lt;jackalmage@gmail.com&gt; wrote:

&gt; On Tue, Oct 25, 2011 at 12:53 PM, Ojan Vafai &lt;ojan@chromium.org&gt; wrote:

&gt;&gt; The new API is smaller and simpler. Less to implement and less for web

&gt;&gt; developers to understand. If it can meet all our use-cases without

&gt;&gt; significant performance problems, then it's a win and we should do it.


&gt;&gt; For line-endings, you could have the Blob constructor also take an optional

&gt;&gt; endings argument:

&gt;&gt; new Blob(String|Array|Blob|ArrayBuffer data,&nbsp;[optional]&nbsp;String contentType,

&gt;&gt; [optional] String endings);


&gt; I believe (or at least, I maintain) that we're trying to do

&gt; dictionaries for this sort of thing. &nbsp;Multiple optional arguments are

&gt; *horrible* unless they are truly, actually, order-dependent such that

&gt; you wouldn't ever specify a later one without already specifying a

&gt; former one.

I don't have a super strong opinion. I will however note that I think

it'll be very common to specify a content-type, but much much more

rare to specify any of the other types. But maybe using the syntax

b = new Blob([foo, bar], { contentType: "text/plain" })


isn't too bad. The other properties that I could think of that we'd

want to add sometime in the future would be encoding for strings,

including endianness for utf16 strings.

/ Jonas
Received on Wednesday, 26 October 2011 23:45:02 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:36 UTC