05:30
<Domenic>
maybe it's just that the arrayBuffer method predates the more general tendency to prefer Uint8Array?
I think this is likely.
05:40
<bakkot>
Figure there's any appetite for adding a .bytes() method to get a Uint8Array? It feels a bit unnecessary given that you can just do new Uint8Array(await body.arrayBuffer()), but it would be more consistent in allowing people to never think about ArrayBuffers
05:56
<Domenic>
I think so. Seems uncontroversial, but also the kind of thing that would benefit from someone being willing to submit patches since it's not exactly fitting into any team's quarterly goals.
07:45
<annevk>
bakkot: that seems reasonable. We'd have to add it to some other APIs too that copied Fetch. And maybe we should annotate arrayBuffer() somehow so it doesn't get copied further.
07:59
<bakkot>
a quick glance through https://dontcallmedom.github.io/webidlpedia/names/ArrayBuffer.html suggests it has been copied only to PushMessageData and Blob, which isn't too bad so far
08:00
<annevk>
Yeah, that sounds about right.
08:00
<bakkot>
FileReader also has readAsArrayBuffer which is a bit odd
08:00
<annevk>
Right, we don't have to care about updating FileReader though. It's kinda like XHR (which also has responseType = "arraybuffer" come to think of it).
08:01
<bakkot>
huh, wonder why that doesn't show up on the WebIDLpedia page
08:01
<bakkot>
anyway yeah
08:02
<annevk>
Probably because it's an enum value?
08:02
<bakkot>
I'd expect it to show up in the algorithm, though. maybe the enum value gets threaded through to Fetch?
08:03
<bakkot>
anyway, if "things which vend bytes should vend Uint8Arrays specifically, not ArrayBuffer" is indeed a general principle to follow, might also be worth documenting in the design principles?
08:14
<annevk>
bakkot: XHR has responseType (takes an enum) and response (which returns the type corresponding to the enum)
08:21
<bakkot>
hmm, https://xhr.spec.whatwg.org/#the-response-attribute does refer to "a new ArrayBuffer object", and ArrayBuffer links; not sure why WebIDLpedia wouldn't pick up on it.
08:21
<bakkot>
possibly because of https://github.com/whatwg/xhr/issues/376 I guess
08:21
<bakkot>
anyway, not super important
08:58
<annevk>
bakkot: I think you are confusing the IDL index with https://dontcallmedom.github.io/webdex/a.html#ArrayBuffer%40%40%40%40interface
08:58
<annevk>
bakkot: response uses any in its IDL which is why it's not on WebIDLpedia
13:16
<annevk>
Andreas Kling: https://twitter.com/eatonphil/status/1747732476468826446 hah! The independent SQL implementation WebSQL wanted, but never got.