Intent to Ship: Fetch: Request.bytes() and Response.bytes()

183 views
Skip to first unread message

Chromestatus

unread,
Oct 4, 2024, 6:41:16 AM10/4/24
to blin...@chromium.org, perry...@chromium.org

Contact emails

perry...@chromium.org

Explainer

None

Specification

https://fetch.spec.whatwg.org/#dom-body-bytes

Summary

Add a bytes() method to the Request and Response interfaces, which returns a promise that resolves with a Uint8Array. While Request and Response have an arrayBuffer() method, we can't read directly from a buffer. We have to create a view such as a Uint8Array to read it. The bytes() method improves the ergonomics of getting the body of Request and Response.



Blink component

Blink>Network>FetchAPI

TAG review

None

TAG review status

Issues addressed

Risks



Interoperability and Compatibility

None



Gecko: Shipped/Shipping (https://bugzilla.mozilla.org/show_bug.cgi?id=1896475)

WebKit: Shipped/Shipping (https://bugs.webkit.org/show_bug.cgi?id=274102)

Web developers: No signals

Other signals:

Activation

The feature can be easily polyfilled.



Security

The feature adds no capabilities that developers don't already have. The implementation mostly reuses existing logic, reducing the security risk.



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

Automatically supported as a feature implemented in WebIDL.



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

No

Flag name on chrome://flags

FetchBodyBytes

Finch feature name

None

Non-finch justification

None

Requires code in //chrome?

False

Tracking bug

https://issues.chromium.org/issues/340206277

Estimated milestones

Shipping on desktop 132
Shipping on Android 132
Shipping on WebView 132


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5239268180754432?gate=6644384851034112

This intent message was generated by Chrome Platform Status.

Mike Taylor

unread,
Oct 4, 2024, 9:18:58 AM10/4/24
to perry...@chromium.org, Chromestatus, blin...@chromium.org

LGTM1


Flag name on chrome://flags

FetchBodyBytes

Finch feature name

None

Non-finch justification

None

Requires code in //chrome?

False

Tracking bug

https://issues.chromium.org/issues/340206277

Estimated milestones

Shipping on desktop 132
Shipping on Android 132
Shipping on WebView 132


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5239268180754432?gate=6644384851034112

This intent message was generated by Chrome Platform Status.
--
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+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/66ffc642.2b0a0220.d54b7.14c4.GAE%40google.com.

Yoav Weiss (@Shopify)

unread,
Oct 4, 2024, 9:21:08 AM10/4/24
to Mike Taylor, perry...@chromium.org, Chromestatus, blin...@chromium.org
LGTM2

Thanks for catching us up here!!

Daniel Bratell

unread,
Oct 4, 2024, 11:09:19 AM10/4/24
to Yoav Weiss (@Shopify), Mike Taylor, perry...@chromium.org, Chromestatus, blin...@chromium.org
Reply all
Reply to author
Forward
0 new messages