Skip to content
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

Merged
merged 1 commit into from
May 1, 2023

Conversation

Princesseuh
Copy link
Member

What kind of changes does this PR include?

  • New or updated content

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.

@netlify
Copy link

netlify bot commented Apr 25, 2023

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit ee5a5de
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/6447fff684d5d00008e78d62
😎 Deploy Preview https://deploy-preview-3096--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@Princesseuh Princesseuh added the merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) label Apr 26, 2023
Copy link
Member

@sarah11918 sarah11918 left a 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
Copy link
Member

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.

Copy link
Member Author

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

@sarah11918 sarah11918 added the improve documentation Enhance existing documentation (e.g. add an example, improve description) label Apr 26, 2023
@Princesseuh Princesseuh merged commit f57bbae into main May 1, 2023
@Princesseuh Princesseuh deleted the feat/new-image-shape branch May 1, 2023 17:00
@sarah11918 sarah11918 added the minor-release For the next minor release; in the milestone, "merge queue" when approved by Sarah! label Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improve documentation Enhance existing documentation (e.g. add an example, improve description) merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) minor-release For the next minor release; in the milestone, "merge queue" when approved by Sarah!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants