Skip to content

Multiple improvements to blob implementation#6466

Open
jasnell wants to merge 2 commits intomainfrom
jasnell/blob-improvements
Open

Multiple improvements to blob implementation#6466
jasnell wants to merge 2 commits intomainfrom
jasnell/blob-improvements

Conversation

@jasnell
Copy link
Copy Markdown
Collaborator

@jasnell jasnell commented Mar 31, 2026

  • Better handling of recursive slices
  • Better handling of empty blobs
  • Performance optimizations for single-Blob inputs
  • Move away from using BufferSource in blob
  • Avoid extraneous allocation/copy in text()
  • Add compat flag to error when creating a Blob from a resizable ArrayBuffer

@jasnell jasnell requested review from guybedford and npaun March 31, 2026 16:13
@jasnell jasnell requested review from a team as code owners March 31, 2026 16:13
ask-bonk[bot]

This comment was marked as resolved.

@ask-bonk

This comment was marked as resolved.

@jasnell jasnell force-pushed the jasnell/blob-improvements branch from 8b87a5b to eb31d8d Compare March 31, 2026 16:25
@codspeed-hq

This comment was marked as outdated.

* Better handling of recursive slices
* Better handling of empty blobs
* Performance optimizations for single-Blob inputs
* Move away from using BufferSource in blob
@jasnell jasnell force-pushed the jasnell/blob-improvements branch from eb31d8d to 95b7e15 Compare March 31, 2026 17:49
@codecov-commenter

This comment was marked as outdated.

@jasnell jasnell force-pushed the jasnell/blob-improvements branch from 6ee9c5b to bbd7dab Compare March 31, 2026 20:12
@jasnell jasnell force-pushed the jasnell/blob-improvements branch from bbd7dab to 7c1e106 Compare March 31, 2026 21:42
Copy link
Copy Markdown
Contributor

@guybedford guybedford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that this is the behaviour in V8, but I don't see that behaviour actually specified?

Is there somewhere to find this discussion / or a WPT that covers this case? Would be much more reassuring to see that.

@jasnell
Copy link
Copy Markdown
Collaborator Author

jasnell commented Apr 1, 2026

It's more the absence of mention in the spec. Blob does not have the AllowResizable webidl attribute.

Browser implementations (chrome, firefox) throw appropriately. Node.js, Deno, and Bun do not... but they should. There does not appear to be any WPT's... but I think in this case it's just safer to follow the behavior of the browsers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants