Add .apng to supported image formats and TypeScript declarations - #17774
Conversation
🦋 Changeset detectedLatest commit: 3f95c5a The changes in this PR will be included in the next version bump. This PR includes changesets to release 420 packages
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 |
|
| 📦 Package | 🔒 Before | 🔓 After |
|---|---|---|
| postcss | stagedPublish | none |
| @markdoc/markdoc | trustedPublisher | none |
| preact | stagedPublish | none |
| nanoid | stagedPublish | none |
| unifont | stagedPublish | trustedPublisher |
|
Going to fix the build errors and update the changeset. |
Merging this PR will degrade performance by 16.44%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| 👁 | Simulation | Build: hybrid site (static + server) |
1.4 s | 1.7 s | -16.44% |
Comparing triagebot/fix-17709 (3f95c5a) with main (dac1768)
|
I think this should have been a minor. It's something new that Astro couldn't do before. At the very least, we should document the gotcha, it doesn't seem to be a changeset thing only |
|
I think both are defensible. In the Imports reference, we say that "Images & Assets (.svg, .jpg, .png, etc.)" are supported. Because But, yes, if we do not support all extensions with |
#17783) * fix(content): add apng to the image() schema format union `apng` was added to VALID_INPUT_FORMATS in #17774, but the ImageFunction type in content/config.ts was not updated to match, so passing an image from a collection schema to a component failed to type-check. Add a type test asserting the schema's format union matches ImageInputFormat, and widen the check workflow's path filter so changes under packages/astro/src and the shipped .d.ts files run the examples check before merge. * revert: keep astro check path filter as-is
Changes
.apngimports to resolve asImageMetadatawith their source, dimensions, and APNG format for use with standard<img>elements.getImage(),<Image>, and<Picture>report an unsupported format instead of stripping animation.Testing
2x3dimensions andapngmetadata format.<img>rendering and rejection throughgetImage(),<Image>, and<Picture>.Docs
<img>element.