IMAGES-2139: switch images binding to a chainable handle#6288
Merged
ascorbic merged 1 commit intocloudflare:mainfrom Apr 1, 2026
Merged
Conversation
cc7218a to
eecb4cf
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
eecb4cf to
888ea1c
Compare
888ea1c to
8692340
Compare
mglewis
added a commit
to mglewis/workers-sdk
that referenced
this pull request
Mar 30, 2026
Tests are skipped pending the workerd API change in cloudflare/workerd#6288
This was referenced Mar 30, 2026
2cfb8ac to
8692340
Compare
danlapid
approved these changes
Apr 1, 2026
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.
This PR updates the Images Binding interface to adopt a chainable handle pattern for per-image operations, bringing it more in line with the upcoming Stream Binding.
CRUD support was originally added in #5912 but has yet to be made generally available - at present it is gated to my developer account. This is technically a breaking change to the interface, but is safe as no external users will be impacted.
Changes
Previously, per-image operations were flat methods on the hosted namespace:
These operations now go via an intermediate handle, returned synchronously from hosted.image(id):
Note that
upload()andlist()are unchanged.Reviewer considerations
image()tobytes()on the handle is deliberate, to avoid confusion now thatimage()is the handle factory.Testing
Unit tests. Will verify E2E against gated developer account before releasing more widely