feat: accept ArrayBuffer and ArrayBufferView parts in Blob and File - #58030
Open
paradowstack wants to merge 3 commits into
Open
feat: accept ArrayBuffer and ArrayBufferView parts in Blob and File#58030paradowstack wants to merge 3 commits into
paradowstack wants to merge 3 commits into
Conversation
paradowstack
force-pushed
the
feat/blob-from-array-buffer
branch
from
August 20, 2026 13:33
199fb07 to
fabef5a
Compare
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
paradowstack
force-pushed
the
feat/blob-from-array-buffer
branch
2 times, most recently
from
August 20, 2026 14:06
049beb5 to
551fa69
Compare
paradowstack
marked this pull request as ready for review
August 20, 2026 14:08
paradowstack
force-pushed
the
feat/blob-from-array-buffer
branch
from
August 20, 2026 14:38
551fa69 to
28267b7
Compare
paradowstack
force-pushed
the
feat/blob-from-array-buffer
branch
from
August 21, 2026 06:41
28267b7 to
9f53665
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebase Note:
This branch is stacked on #57937 (
Promise<ArrayBuffer>for Java/ObjC TurboModules) and #58029 (feat: support Array as a TurboModule method parameter) and must be rebased ontomainonce that lands. For now review only the last commit.Summary:
new Blob([arrayBuffer])threwCreating blobs from 'ArrayBuffer' and 'ArrayBufferView' are not supported. The wire format carried only{type: 'string' | 'blob'}descriptors through aReadableArray, which has no way to carry raw bytes, so binary parts had nowhere to go.createFromPartsgains a second argument,binaryParts: Array<ArrayBuffer>. A binary part becomes{type: 'binaryPart', data: <index>}in the existing ordered descriptor list, pointing into that parallel array — ordering is preserved, and the bytes travel over theArray<ArrayBuffer>path rather than being encoded into a string. A whole buffer is forwarded as-is; only a partialArrayBufferViewis sliced, because the wire format carries whole buffers. Detached and zero-length parts contribute nothing and are dropped.Changelog:
[GENERAL] [BREAKING] -
BlobandFileconstructors acceptArrayBufferandArrayBufferViewpartsTest Plan:
Blob-test/BlobManager-test/File-testcover binary parts, mixed-part ordering, whole-buffer vs. partial-view forwarding, empty and detached buffers,Float64ArrayandDataViewsizing, and the W3CUSVStringfallback for everything that is neither aBlobnor aBufferSource.BlobModuleTestcoverscreateFromPartswith one, several and out-of-range binary parts, mixed-part ordering, and that a stored part does not alias the source buffer.RCTBlobManagerTestscoverscreateFromPartswith binary parts, an out-of-range index, and a wrongly-typed part.globals.d.tsand theglobals.tsxtype tests accept the newBlobPartconstructor arguments.