-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Support CF Images binding #14027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Support CF Images binding #14027
Conversation
|
|
Thanks for this. We're looking to see the best way to access the binding in the image service so it can be implemented more neatly. |
|
@penalosa, thank you for this contribution. It appears to be a fantastic addition to the adapter. I conducted an initial review of the code, and overall, it seems to be in good shape. However, I’d like to explore the possibility of enhancing its integration, which would allow us to utilize the bindings more efficiently. I’ll address this matter tomorrow morning, in European time. On a related note, could you please provide information regarding the compatibility of the |
|
@alexanderniebuhr it's supported by |
|
As already said on Discord, after trying it myself I don't seem to have a good way to access the bindings in the |
|
This needs a changeset, and if possible tests |
|
I'll take this over. I want to make this the new default option. And deprecate some other options. |
|
@alexanderniebuhr can this PR be closed then? Thanks for handling this! |
|
I think Alex will use this PR. I've already cherry-picked it into our environment API branch, so I'm expecting it will use this. |
|
@penalosa yeah sorry for being a bit quite here. I will use this PR to ship this. |
|
@alexanderniebuhr is there anything I can do to help this move along? |
|
@alexanderniebuhr if you prefer, we can leave this as it's already in the |
|
I would like to find a way to make this as similar as possible to the next branch. For users it should not be a breaking update once we use the workerd runtime. I think the change I want here is to utilize platformProxy in dev instead of our sharp implementation. I will finalize this this week! |
Changes
This adds a
cloudflare-bindingImage Service option to the Astro Cloudflare adapter. This is to support using Cloudflare images on deployments which may not have Cloudflare Images enabled on the zone (i.e. workers.dev). It's a new type rather than a replacement of the existingcloudflareimage service so as not to break backwards compat (given anIMAGESbinding is required in the user'swrangler.jsonconfig file.I'm not sure if this is the right approach! Very open to changing it, but this seemed like the only way to have access to the Images binding while transforming an image. The
transform()hook on an Image Service looked perfect, but I couldn't figure out how to get the Images binding accessible there.Testing
This has been tested manually with a deployed site using a local build of the adapter.
Docs