Just curious, I saw this go by

>  Blob.bytes collapses this two-step ritual into a single call, returning
a Uint8Array. By removing the extra allocation and copy, it trims
garbage-collection overhead and lowers latency when processing large blobs.

There should be no extra allocation as it is

     const bytes = new Uint8Array(async someBlob.arrayBuffer())

Does not make 2 allocations (AFAIK). It makes one allocation (the array
buffer). And it makes TypeArrayView of that same array buffer




On Tue, Jul 29, 2025 at 4:02 PM Chromestatus <
ad...@cr-status.appspotmail.com> wrote:

> Contact emails zeesuy...@gmail.com, z...@chromium.org
>
> Explainer None
>
> Specification https://www.w3.org/TR/FileAPI
>
> Design docs
> https://w3c.github.io/FileAPI/#dom-blob-bytes
>
> Summary
>
> The bytes() method of the Blob interface returns a Promise that resolves
> with a Uint8Array containing the contents of the blob as an array of bytes.
>
>
> Blink component Blink>Storage>FileAPI
> <https://issues.chromium.org/issues?q=customfield1222907:%22Blink%3EStorage%3EFileAPI%22>
>
> Motivation
>
> Developers currently need to invoke the arrayBuffer method on a Blob and
> then convert the result into a Uint8Array whenever they want raw bytes.
> Blob.bytes collapses this two-step ritual into a single call, returning a
> Uint8Array. By removing the extra allocation and copy, it trims
> garbage-collection overhead and lowers latency when processing large blobs.
>
>
> Initial public proposal None
>
> TAG review None
>
> TAG review status Not applicable
>
> Risks
>
>
> Interoperability and Compatibility
>
> Safari 18 and Firefox 128 have already shipped the feature.
>
>
> *Gecko*: Shipped/Shipping (
> https://www.firefox.com/en-US/firefox/128.0/releasenotes)
>
> *WebKit*: Shipped/Shipping (
> https://webkit.org/blog/15865/webkit-features-in-safari-18-0)
>
> *Web developers*: No signals
>
> *Other signals*:
>
> WebView application risks
>
> Does this intent deprecate or change behavior of existing APIs, such that
> it has potentially high risk for Android WebView-based applications?
>
> None
>
>
> Debuggability
>
> None
>
>
> Is this feature fully tested by web-platform-tests
> <https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md>
> ? Yes
>
> https://wpt.fyi/results/FileAPI/Blob-methods-from-detached-frame.html
> https://wpt.fyi/results/FileAPI/blob/Blob-bytes.any.html
> https://wpt.fyi/results/FileAPI/blob/Blob-bytes.any.worker.html
>
>
> Flag name on about://flags None
>
> Finch feature name None
>
> Non-finch justification None
>
> Requires code in //chrome? False
>
> Estimated milestones
>
> No milestones specified
>
>
> Link to entry on the Chrome Platform Status
> https://chromestatus.com/feature/4830298126417920?gate=4565118389846016
>
> This intent message was generated by Chrome Platform Status
> <https://chromestatus.com>.
>
> --
> You received this message because you are subscribed to the Google Groups
> "blink-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to blink-dev+unsubscr...@chromium.org.
> To view this discussion visit
> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/688952f5.2b0a0220.35091d.0040.GAE%40google.com
> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/688952f5.2b0a0220.35091d.0040.GAE%40google.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to blink-dev+unsubscr...@chromium.org.
To view this discussion visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAKZ%2BBNo2yTNNZ2p6UqWt6bWxhomKrEY4fm9J%3D53ySjVHPjz4hg%40mail.gmail.com.

Reply via email to