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

feat(image_services): Add mention of new validateOptions hook #2859

Merged
merged 2 commits into from
Mar 21, 2023

Conversation

Princesseuh
Copy link
Member

@Princesseuh Princesseuh commented Mar 15, 2023

What kind of changes does this PR include?

  • New or updated content

Description

withastro/astro#6555 adds a new hook to the Image Service API that can be used to validate and augment the passed options. The built-in services uses this hook to set the default format as webp if the user hasn't passed a format, for example.

It takes the same options as the other hooks, so an ImageTransform and it returns an ImageTransform as well. Returning an ImageTransform is mandatory, so the implementation should probably always end with return options;

This PR additionally contain some misc fix to the rest of the file

@netlify
Copy link

netlify bot commented Mar 15, 2023

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit f627227
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/6419a5a4bbfe140007be392b
😎 Deploy Preview https://deploy-preview-2859--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 Mar 15, 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.

LGTM, @Princesseuh! 🎉

@Jutanium
Copy link
Contributor

Could we add validateOptions to one of the examples so it's clear how to e.g. warn the user?

Copy link
Member

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! But I do agree with @Jutanium here, might be helpful to have an example.

@Princesseuh
Copy link
Member Author

Core PR has been merged, will merge this when it's released

@sarah11918
Copy link
Member

Merging-on-release, but we have an example ready to add in a separate PR.

@sarah11918 sarah11918 merged commit 5491421 into main Mar 21, 2023
@sarah11918 sarah11918 deleted the feat/image-validate-options branch March 21, 2023 13:10
@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
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.

4 participants