Closed Bug 1896475 Opened 2 months ago Closed 2 months ago

Implement Request/Response `.bytes()` method

Categories

(Core :: DOM: Networking, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
relnote-firefox --- 128+
firefox128 --- fixed

People

(Reporter: bakkot, Assigned: evilpie)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete, Whiteboard: [necko-triaged][necko-priority-next], [wptsync upstream])

Attachments

(2 files)

Steps to reproduce:

See https://github.com/whatwg/fetch/issues/1732.

Tests at https://github.com/web-platform-tests/wpt/pull/46198.

The above spec PR adds a bytes() method to get a Uint8Array to Body, instead of requiring users to get an ArrayBuffer with arrayBuffer() and then wrap it.

There are also PRs to do the same for Blob and PushMessageData, which copy relevant parts of the Body interface:

Severity: -- → S3
Component: Networking → DOM: Networking
Priority: -- → P2
Whiteboard: [necko-triaged][necko-priority-new]
Blocks: fetch
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [necko-triaged][necko-priority-new] → [necko-triaged][necko-priority-next]

Sounds interesting, I will have a look.

Assignee: nobody → evilpies
Depends on: 1896059
Keywords: dev-doc-needed
Blocks: 1897871
Attachment #9402179 - Attachment description: WIP: Bug 1896475 - Make BodyConsumer::ConsumeType an enum class → Bug 1896475 - Make BodyConsumer::ConsumeType an enum class. r?saschanaz
Attachment #9402180 - Attachment description: WIP: Bug 1896475 - Implement Request/Response `.bytes()` method → Bug 1896475 - Implement Request/Response `.bytes()` method. r?saschanaz
Blocks: 1896509
See Also: 1896509
Pushed by evilpies@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/b9d4c74f4162
Make BodyConsumer::ConsumeType an enum class. r=saschanaz
https://hg.mozilla.org/integration/autoland/rev/deb6dfcd6d8c
Implement Request/Response `.bytes()` method. r=saschanaz,webidl

Backed out for causing assertions on Interpreter.cpp.

Flags: needinfo?(evilpies)
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/46444 for changes under testing/web-platform/tests
Whiteboard: [necko-triaged][necko-priority-next] → [necko-triaged][necko-priority-next], [wptsync upstream]
Upstream PR was closed without merging
Pushed by evilpies@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/66113edf97b9
Make BodyConsumer::ConsumeType an enum class. r=saschanaz
https://hg.mozilla.org/integration/autoland/rev/05cad689932f
Implement Request/Response `.bytes()` method. r=saschanaz,webidl
Flags: needinfo?(evilpies)
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
Upstream PR merged by moz-wptsync-bot

Is this worth an Fx128 relnote?

Flags: needinfo?(evilpies)

Seems a bit minor for a relnote.

Flags: needinfo?(evilpies)

Release Note Request (optional, but appreciated)
[Why is this notable]: New convenience function on many objects
[Affects Firefox for Android]: yes
[Suggested wording]: A new methods bytes() is provided on many objects like Request/Response and Blob that provides a convenient way of getting an Uint8Array typed array.
[Links (documentation, blog post, etc)]: Not yet really? https://github.com/w3ctag/design-principles/issues/463

relnote-firefox: --- → ?

Added to the Fx128 relnotes.

FF128 MDN docs for this covered in https://github.com/mdn/content/issues/33984

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: