-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
docs: update assets related pages for new configuration shape #3096
Conversation
✅ Deploy Preview for astro-docs-2 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
I'll ask @Jutanium to also review this, since he has the most experience with the original. I've left a comment that's more for him than for you, @Princesseuh and otherwise, I'm happy when Dan's happy! 🥳
@@ -116,20 +125,20 @@ At build time for static sites and pre-rendered routes, both `<Image />` and `ge | |||
|
|||
In dev mode and SSR mode, Astro doesn't know ahead of time which images need to be optimized. Astro uses a GET endpoint (by default, `/_image`) to process the images at runtime. `<Image />` and `getImage()` pass their options to `getURL()`, which will return the endpoint URL. Then, the endpoint calls `parseURL()` and passes the resulting properties to `transform()`. | |||
|
|||
#### getConfiguredImageService | |||
#### getConfiguredImageService & imageServiceConfig |
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.
@Jutanium - How do you feel about these two being combined into one heading? Ideally, I think we'd normally split them up, and define/explain each one separately.
Since you went through these examples extensively the first time around, do you have a suggestion for a sensible way to devote space to each one separately that doesn't force us to duplicate examples and make this long and terrible?
Not blocking, because the example below is entirely reasonable. But I do think it would be preferable if each were treated separately, if we had a good way of doing it.
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.
fwiw, I decided on purpose to put them together since you should always be using them together
What kind of changes does this PR include?
Description
withastro/astro#6848 updates the configuration setting for the image service to be an object of the following shape :
service: {entrypoint: string, config: Record<string, any>}
instead of just being a string. This allow user to pass configuration to the image service. For instance, Vercel uses this to provide a list of allowed widths.This PR updates the Assets and Image Service pages to include this new information and all the associated utilities it added. Additionally, this PR adds an example for
validateOptions
, as it was previously missing.