-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Support extending the image API props type #15014
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
Merged
Merged
+9
−2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🦋 Changeset detectedLatest commit: 7da3e3d 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 |
CodSpeed Performance ReportMerging #15014 will not alter performanceComparing Summary
Footnotes |
Princesseuh
approved these changes
Dec 13, 2025
Contributor
|
@delucis oh my, thank you! ❤️ |
dadezzz
pushed a commit
to dadezzz/ice-notes
that referenced
this pull request
Dec 19, 2025
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [astro](https://astro.build) ([source](https://github.com/withastro/astro/tree/HEAD/packages/astro)) | [`5.16.5` -> `5.16.6`](https://renovatebot.com/diffs/npm/astro/5.16.5/5.16.6) |  |  | --- ### Release Notes <details> <summary>withastro/astro (astro)</summary> ### [`v5.16.6`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5166) [Compare Source](https://github.com/withastro/astro/compare/[email protected]@5.16.6) ##### Patch Changes - [#​14982](withastro/astro#14982) [`6849e38`](withastro/astro@6849e38) Thanks [@​Princesseuh](https://github.com/Princesseuh)! - Fixes images outside the project directory not working when using astro:assets in development mode - [#​14987](withastro/astro#14987) [`9dd9fca`](withastro/astro@9dd9fca) Thanks [@​Princesseuh](https://github.com/Princesseuh)! - Fixes SVGs not working in dev mode when using the passthrough image service - [#​15014](withastro/astro#15014) [`a178422`](withastro/astro@a178422) Thanks [@​delucis](https://github.com/delucis)! - Adds support for extending the type of the props accepted by Astro’s `<Image>` component, `<Picture>` component, and `getImage()` API. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi41Mi44IiwidXBkYXRlZEluVmVyIjoiNDIuNTIuOCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: Renovate Bot <[email protected]> Co-committed-by: Renovate Bot <[email protected]>
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Adds an
Astro.CustomImagePropsinterface that users can extend to support additional props in<Image>,<Picture>, andgetImage(). Handling non-standard props is already supported in the Image Service API, there’s just no way to type them.For example, with this PR, an image service that supports blurring images can add a custom
blurprop:Notes:
<Image>,<Picture>, andgetImage()). Maybe hypothetically someone only wants to extend one of these? But I feel like if you’re saying any of these APIs should behave differently, you may want to export specific wrapper components/functions instead of reusing Astro’s.getImage()uses a different type from the components, which doesn’t seem to share anything even though many of the properties overlap, so this required a separate change to theImageTransformtype.Testing
Tested by patching
node_modulesin a project with a custom image service.Docs
Includes a changeset and has an accompanying docs PR: withastro/docs#12897
/cc @withastro/maintainers-docs for feedback!