Repository navigation
fix(render): strip image preload links with imagesrcset or imagesizes when as=image is omitted - #3754
Closed
Tyagiquamar wants to merge 1 commit into
Closed
Tyagiquamar wants to merge 1 commit into
Tyagiquamar wants to merge 1 commit into
Conversation
… when as=image is omitted
🦋 Changeset detectedLatest commit: 17e3d5f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Contributor
|
@Tyagiquamar is attempting to deploy a commit to the resend Team on Vercel. A member of the Team first needs to authorize it. |
Member
|
I could not reproduce the issue, so I am closing this PR. The details are in #3753. |
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
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.
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
imagesrcsetorimagesizeseven whenas="image"is omitted, so React 19 responsive-image hints no longer leak into rendered email HTML. Closes #3753. Non-image preloads likeas="style"andas="font"are still kept.Written for commit 17e3d5f. Summary will update on new commits.