fix(render): strip image preload links with imagesrcset or imagesizes when as=image is omitted

Closed
TY
11d ago
+18-1

Closes #3753.

React 19 can emit image preload hints that carry imagesrcset/imagesizes without an as=image attribute. stripImagePreloadLinks only removed preloads with as=image, so these tags survived into the rendered email HTML even though email clients ignore link rel=preload.

This widens isImagePreloadLink to also strip preload links carrying imagesrcset or imagesizes attributes. Non-image preloads (as=style, as=font) and other link tags are still kept, covered by the existing tests.

Verification: added a regression test (fails before the fix, passes after); full @react-email/render suite passes (9/9 in the touched spec; the only full-suite failure observed was a flaky pretty.spec.ts timeout that passes in isolation).

Note: this supersedes #3743, which was closed for targeting main, missing an issue, and containing an unrelated commit. This submission follows the requested flow: issue #3753 first, clean branch from current upstream canary containing only this fix.


Summary by cubic

Strips image preload links that carry imagesrcset or imagesizes even when as="image" is omitted, so React 19 responsive-image hints no longer leak into rendered email HTML. Closes #3753. Non-image preloads like as="style" and as="font" are still kept.