Skip to content

Conversation

@rahuld109
Copy link
Contributor

Summary

Skips the "Use the Image component" audit warning for images inside framework components (React, Vue, Svelte, etc.).

Images inside <astro-island> elements now skip the warning, since these components can't directly use Astro's <Image> component.

Changes

  • Added check in perf.ts to skip the audit if the image is inside an <astro-island> element

Note

This only covers hydrated components (with client:* directives). Server-only framework components don't get the astro-island wrapper, so they'd still see the warning - but as the docs mention, those can receive optimized URLs from Astro.

Fixes #15048

@changeset-bot
Copy link

changeset-bot bot commented Jan 8, 2026

🦋 Changeset detected

Latest commit: 66cd640

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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jan 8, 2026
@rahuld109 rahuld109 force-pushed the fix/audit-skip-framework-images branch from d6e19b1 to 499319a Compare January 8, 2026 18:57
Images inside astro-island elements (React, Vue, Svelte, etc. with client:* directives) now skip the 'Use the Image component' audit warning, since these components can't directly use Astro's Image component.

Fixes withastro#15048
@rahuld109 rahuld109 force-pushed the fix/audit-skip-framework-images branch from 499319a to ac8eddc Compare January 8, 2026 19:02
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 8, 2026

Merging this PR will not alter performance

Summary

✅ 6 untouched benchmarks


Comparing rahuld109:fix/audit-skip-framework-images (66cd640) with main (6f6f8f8)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (353ebf1) during the generation of this report, so 6f6f8f8 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Copy link
Member

@Princesseuh Princesseuh left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!

@Princesseuh Princesseuh merged commit 34f84c2 into withastro:main Jan 8, 2026
26 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Use the Image component" with astro dev when using react

2 participants