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 for reading bytes into a Uint8Array #369
Conversation
I couldn't find any existing tests to extend here, presumably due to #365. So I haven't written any tests for this. Happy to do so if there's a way to do it. |
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.
This looks fine. IPR commitments, less so. The IPR bot points to the necessary instructions.
Pinging @martinthomson and @beverloo for input and additional implementer support. This is implemented in WebKit (thanks @annevk) @bakkot, argh... small blocker on IPR, as this is substantive contribution. I'll need you to "make a non-member patent licensing commitment" unless you somehow join the working group. I'll see how we make that as painless as possible (hi @siusin, can you help us!). |
Signing such a commitment may be problematic since I do work for a web technologies company which is not a W3C member, even though this work was not done on their behalf. Given that this PR is basically trivial and involved no decisions, I'd prefer not to bother the lawyers just for this. I am happy to close it and let a member make an identical PR if it really can't be marked as non-substantive. |
Sweet, thanks. Closing in favor of #370. |
Thanks for doing the actual work bakkot! |
Edit: Replaced by #370.
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
PushMessageData
, 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.It's unfortunate that
getKey
andapplicationServerKey
vendArrayBuffer
s instead ofUint8Array
s, but it's too late to fix those now.Implementation commitment:
Preview | Diff