-
Notifications
You must be signed in to change notification settings - Fork 28.9k
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
Implement bytes()
method on Blob for reading bytes into a Uint8Array
#52972
Comments
@nodejs/web-standards |
@RedYetiDev blob is a web standard, this method is added to the spec, we should definitely implement it (as experimental and remove experimental status when it lands). |
I won't implement it into fetch until it becomes standardized. I don't think node should land it either until then. |
I don't think it is standard yet ( |
Implementing before the spec lands is almost always a good idea since it's literally our last realistic chance to request changes or provide feedback when we see an API is problematic. |
That's a good point, but either way, I'm not involved in that process, undici handles this, right? |
Node handles this for Blob and undici handles it for request/response |
Thanks for the info. I'm marking this as |
If implemented, this would be experimental, hence the label |
There won't be anything problematic with it 😄. |
it did land in the spec already and I've opened a PR to add it to fetch |
The Request/Response one landed but Blob - this issue - is technically a different spec, and that PR is still open. (It's slightly more annoying because that spec lives in W3C, unlike fetch, and I haven't gone through the process of joining the relevant W3C working group.) |
The Blob PR is now merged. |
Just an update on the Big 3 Landed in WebKit: WebKit/WebKit#28657 |
See w3c/FileAPI#198. This is like the existing
arrayBuffer()
method, but gives you a Uint8Array instead.Tests at web-platform-tests/wpt#46232
See also nodejs/undici#3256 for the issue for doing the same for Request/Response.
There's also a PR adding the same method to PushMessageData, but I don't think it's relevant to node. Mentioning it here anyway just in case I'm wrong.
The text was updated successfully, but these errors were encountered: