-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
feat(vercel): Add support for image optimization API #6845
Conversation
🦋 Changeset detectedLatest commit: f6b4e0a The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
!preview vercel-image |
|
!preview vercel-image |
2 similar comments
!preview vercel-image |
!preview vercel-image |
!preview vercel-image |
|
!preview vercel-image |
|
!preview vercel-image |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of minor nits from me, @Princesseuh , and just checking on the "Added in" field since it exists!
Note: I checked on Vercel's page, and it looks like the name of the API is "Image Optimization" which means you have the choice of saying "Vercel's Image Optimization API" or "the Vercel Image Optimization API" whenever it comes up. But it should be one or the other: possessive, or with a "the" in front of it. I made a suggestion below for the one you didn't use later (for sentence variety!) but it's totally your call.
Co-authored-by: Sarah Rainsberger <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs LGTM!
Changes
This adds support for the Vercel Image Optimization API:tm: to the Vercel adapter. An image service for
astro:assets
using the API is additionally provided behind a config flagimageService
. In dev, a slightly modified base Squoosh service is used instead.Using the image service is optional, you can just provide an image config, like such :
adapter: vercel({imageConfig: {sizes: [...]}})
and use the API directly. The image service handles it all for you though, including an hopefully helpful default configurationTesting
Added tests. We don't fully E2E test it, but we make sure to generate the proper URLs at least
Docs
Added docs