-
Notifications
You must be signed in to change notification settings - Fork 41
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! |
This issue was brought to my attention. I believe @martinthomson in #369 (review) was alluding to https://www.w3.org/2003/12/22-pp-faq.html#non-participants If joining is not an option, an alternative mechanism available is https://www.w3.org/2023/Process-20231103/#contributor-license As per the W3C Patent Policy it is generally not appropriate for a WG participant to take a substantive change proposed by a non-participant and merge it on behalf of the non-participant to a document intended to become a W3C Recommendation. This can be seen as a red flag from a Patent Policy perspective. My recommendation is to consult the W3C Team to get this addressed properly. I believe @plehegar is in the best position to help you with that. |
This PR was not merged and can therefore be regarded as merely making the team aware of a change to an upstream API (i.e. the WHATWG @marcoscaceres's PR implements the corresponding change in exactly the way I would have because there are no possible decisions about this change, but it was his PR which landed, not mine. |
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