-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bytes() method to Blob for reading bytes into a Uint8Array #197
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me; it certainly was the intention of Blob to mimic Body as much as possible.
And while getting support signals from implementers is probably not needed for this PR, filing implementation bugs would still be a good thing. (also the IPR bot seems to not know who you are/if you've joined the webapps working group). |
I'll file implementation requests. Joining W3C working groups is something of a pain, especially just for trivial changes like this. Is there a way to... not do that? If not I am happy to close this and let someone else to make exactly the same change in their own PR. I'll still file the implementation requests. |
Filed the implementation issues, linked in the OP. I didn't check the boxes because they're not technically implementation commitments at the moment. |
Pinged the @siusin for help with getting the IPR commitment on this. Will get it sorted ASAP. |
(worst case, I'll copy/pasta the PR... the change is substantive so we need the commitments) |
wow! great minds think alike 😜: |
Thanks! |
Edit: Replaced by #198.
The Fetch API is getting a
Uint8Array
-returningbytes()
method alongside its existingarrayBuffer()
method, following the principle that APIs should generally vend byte buffers asUint8Array
s.This PR makes the same change for
Blob
, which has its own distinctarrayBuffer
method.I'm assuming this is uncontroversial given the support from the three major implementations for doing this on
Body
, but I can open an issue and solicit explicit support separately if you'd prefer.I'll write tests if I get a signal that this is able to go forward.Tests written, see link.Implementation commitment:
Preview | Diff