Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/img/src/img.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('<Img> component', () => {
<Img alt="Cat" height="300" src="cat.jpg" width="300" />,
);
expect(actualOutput).toMatchInlineSnapshot(
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><link rel="preload" as="image" href="cat.jpg"/><!--$--><img alt="Cat" height="300" src="cat.jpg" style="display:block;outline:none;border:none;text-decoration:none" width="300"/><!--/$-->"`,
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!--$--><img alt="Cat" fetchPriority="low" height="300" src="cat.jpg" style="display:block;outline:none;border:none;text-decoration:none" width="300"/><!--/$-->"`,
);
});
});
4 changes: 4 additions & 0 deletions packages/img/src/img.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export const Img = React.forwardRef<HTMLImageElement, ImgProps>(
<img
{...props}
alt={alt}
// Setting fetchPriority to "low" prevents React 19's SSR from
// auto-injecting <link rel="preload"> tags for every image, which are
// unnecessary noise in email HTML. Email clients ignore this attribute.
fetchPriority="low"
height={height}
ref={ref}
src={src}
Expand Down
4 changes: 0 additions & 4 deletions packages/preview-server/src/utils/get-email-component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ describe('getEmailComponent()', () => {
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" lang="en">
<head>
<link rel="preload" as="image" href="/static/vercel-logo.png" />
<link rel="preload" as="image" href="/static/vercel-user.png" />
<link rel="preload" as="image" href="/static/vercel-arrow.png" />
<link rel="preload" as="image" href="/static/vercel-team.png" />
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<meta name="x-apple-disable-message-reformatting" />
<!--$-->
Expand Down
2 changes: 0 additions & 2 deletions packages/react-email/src/commands/testing/export.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@
path.resolve(pathToDumpMarkup, './vercel-invite-user.html'),
'utf8',
),
).toMatchInlineSnapshot(`

Check failure on line 19 in packages/react-email/src/commands/testing/export.spec.ts

View workflow job for this annotation

GitHub Actions / tests

src/commands/testing/export.spec.ts > email export

Error: Snapshot `email export 1` mismatched - Expected + Received @@ -48,10 +48,11 @@ <tbody> <tr> <td> <img alt="Vercel Logo" + fetchpriority="low" height="37" src="/static/vercel-logo.png" style="display:block;outline:none;border:none;text-decoration:none;margin-right:auto;margin-left:auto;margin-bottom:0;margin-top:0" width="40" /> </td> @@ -98,29 +99,32 @@ <td align="right" data-id="__react-email-column"> <img alt="undefined&#x27;s profile picture" + fetchpriority="low" height="64" style="display:block;outline:none;border:none;text-decoration:none;border-radius:9999px" width="64" /> </td> <td align="center" data-id="__react-email-column"> <img alt="Arrow indicating invitation" + fetchpriority="low" height="9" src="/static/vercel-arrow.png" style="display:block;outline:none;border:none;text-decoration:none" width="12" /> </td> <td align="left" data-id="__react-email-column"> <img alt="undefined team logo" + fetchpriority="low" height="64" style="display:block;outline:none;border:none;text-decoration:none;border-radius:9999px" width="64" /> </td> </tr> ❯ src/commands/testing/export.spec.ts:19:5

Check failure on line 19 in packages/react-email/src/commands/testing/export.spec.ts

View workflow job for this annotation

GitHub Actions / tests

src/commands/testing/export.spec.ts > email export

Error: Snapshot `email export 1` mismatched - Expected + Received @@ -48,10 +48,11 @@ <tbody> <tr> <td> <img alt="Vercel Logo" + fetchpriority="low" height="37" src="/static/vercel-logo.png" style="display:block;outline:none;border:none;text-decoration:none;margin-right:auto;margin-left:auto;margin-bottom:0;margin-top:0" width="40" /> </td> @@ -98,29 +99,32 @@ <td align="right" data-id="__react-email-column"> <img alt="undefined&#x27;s profile picture" + fetchpriority="low" height="64" style="display:block;outline:none;border:none;text-decoration:none;border-radius:9999px" width="64" /> </td> <td align="center" data-id="__react-email-column"> <img alt="Arrow indicating invitation" + fetchpriority="low" height="9" src="/static/vercel-arrow.png" style="display:block;outline:none;border:none;text-decoration:none" width="12" /> </td> <td align="left" data-id="__react-email-column"> <img alt="undefined team logo" + fetchpriority="low" height="64" style="display:block;outline:none;border:none;text-decoration:none;border-radius:9999px" width="64" /> </td> </tr> ❯ src/commands/testing/export.spec.ts:19:5

Check failure on line 19 in packages/react-email/src/commands/testing/export.spec.ts

View workflow job for this annotation

GitHub Actions / tests

src/commands/testing/export.spec.ts > email export

Error: Snapshot `email export 1` mismatched - Expected + Received @@ -48,10 +48,11 @@ <tbody> <tr> <td> <img alt="Vercel Logo" + fetchpriority="low" height="37" src="/static/vercel-logo.png" style="display:block;outline:none;border:none;text-decoration:none;margin-right:auto;margin-left:auto;margin-bottom:0;margin-top:0" width="40" /> </td> @@ -98,29 +99,32 @@ <td align="right" data-id="__react-email-column"> <img alt="undefined&#x27;s profile picture" + fetchpriority="low" height="64" style="display:block;outline:none;border:none;text-decoration:none;border-radius:9999px" width="64" /> </td> <td align="center" data-id="__react-email-column"> <img alt="Arrow indicating invitation" + fetchpriority="low" height="9" src="/static/vercel-arrow.png" style="display:block;outline:none;border:none;text-decoration:none" width="12" /> </td> <td align="left" data-id="__react-email-column"> <img alt="undefined team logo" + fetchpriority="low" height="64" style="display:block;outline:none;border:none;text-decoration:none;border-radius:9999px" width="64" /> </td> </tr> ❯ src/commands/testing/export.spec.ts:19:5

Check failure on line 19 in packages/react-email/src/commands/testing/export.spec.ts

View workflow job for this annotation

GitHub Actions / tests

src/commands/testing/export.spec.ts > email export

Error: Snapshot `email export 1` mismatched - Expected + Received @@ -48,10 +48,11 @@ <tbody> <tr> <td> <img alt="Vercel Logo" + fetchpriority="low" height="37" src="/static/vercel-logo.png" style="display:block;outline:none;border:none;text-decoration:none;margin-right:auto;margin-left:auto;margin-bottom:0;margin-top:0" width="40" /> </td> @@ -98,29 +99,32 @@ <td align="right" data-id="__react-email-column"> <img alt="undefined&#x27;s profile picture" + fetchpriority="low" height="64" style="display:block;outline:none;border:none;text-decoration:none;border-radius:9999px" width="64" /> </td> <td align="center" data-id="__react-email-column"> <img alt="Arrow indicating invitation" + fetchpriority="low" height="9" src="/static/vercel-arrow.png" style="display:block;outline:none;border:none;text-decoration:none" width="12" /> </td> <td align="left" data-id="__react-email-column"> <img alt="undefined team logo" + fetchpriority="low" height="64" style="display:block;outline:none;border:none;text-decoration:none;border-radius:9999px" width="64" /> </td> </tr> ❯ src/commands/testing/export.spec.ts:19:5
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" lang="en">
<head>
<link rel="preload" as="image" href="/static/vercel-logo.png" />
<link rel="preload" as="image" href="/static/vercel-arrow.png" />
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<meta name="x-apple-disable-message-reformatting" />
<!--$-->
Expand Down
4 changes: 2 additions & 2 deletions packages/render/src/browser/render-web.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('render on the browser environment', () => {
const actualOutput = await render(<Template firstName="Jim" />);

expect(actualOutput).toMatchInlineSnapshot(
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><link rel="preload" as="image" href="img/test.png"/><!--$--><h1>Welcome, <!-- -->Jim<!-- -->!</h1><img alt="test" src="img/test.png"/><p>Thanks for trying our product. We&#x27;re thrilled to have you on board!</p><!--/$-->"`,
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!--$--><h1>Welcome, <!-- -->Jim<!-- -->!</h1><img alt="test" fetchPriority="low" src="img/test.png"/><p>Thanks for trying our product. We&#x27;re thrilled to have you on board!</p><!--/$-->"`,
);
});

Expand Down Expand Up @@ -108,7 +108,7 @@ describe('render on the browser environment', () => {
const actualOutput = await render(<Template firstName="Jim" />);

expect(actualOutput).toMatchInlineSnapshot(
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><link rel="preload" as="image" href="img/test.png"/><!--$--><h1>Welcome, <!-- -->Jim<!-- -->!</h1><img alt="test" src="img/test.png"/><p>Thanks for trying our product. We&#x27;re thrilled to have you on board!</p><!--/$-->"`,
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!--$--><h1>Welcome, <!-- -->Jim<!-- -->!</h1><img alt="test" fetchPriority="low" src="img/test.png"/><p>Thanks for trying our product. We&#x27;re thrilled to have you on board!</p><!--/$-->"`,
);
});

Expand Down
4 changes: 2 additions & 2 deletions packages/render/src/edge/render.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('render on the edge', () => {
const actualOutput = await render(<Template firstName="Jim" />);

expect(actualOutput).toMatchInlineSnapshot(
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><link rel="preload" as="image" href="img/test.png"/><!--$--><h1>Welcome, <!-- -->Jim<!-- -->!</h1><img alt="test" src="img/test.png"/><p>Thanks for trying our product. We&#x27;re thrilled to have you on board!</p><!--/$-->"`,
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!--$--><h1>Welcome, <!-- -->Jim<!-- -->!</h1><img alt="test" fetchPriority="low" src="img/test.png"/><p>Thanks for trying our product. We&#x27;re thrilled to have you on board!</p><!--/$-->"`,
);
});

Expand Down Expand Up @@ -108,7 +108,7 @@ describe('render on the edge', () => {
const actualOutput = await render(<Template firstName="Jim" />);

expect(actualOutput).toMatchInlineSnapshot(
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><link rel="preload" as="image" href="img/test.png"/><!--$--><h1>Welcome, <!-- -->Jim<!-- -->!</h1><img alt="test" src="img/test.png"/><p>Thanks for trying our product. We&#x27;re thrilled to have you on board!</p><!--/$-->"`,
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!--$--><h1>Welcome, <!-- -->Jim<!-- -->!</h1><img alt="test" fetchPriority="low" src="img/test.png"/><p>Thanks for trying our product. We&#x27;re thrilled to have you on board!</p><!--/$-->"`,
);
});

Expand Down
6 changes: 3 additions & 3 deletions packages/render/src/node/render-edge.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('render on the edge', () => {
const actualOutput = await render(<Template firstName="Jim" />);

expect(actualOutput).toMatchInlineSnapshot(
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><link rel="preload" as="image" href="img/test.png"/><!--$--><h1>Welcome, <!-- -->Jim<!-- -->!</h1><img alt="test" src="img/test.png"/><p>Thanks for trying our product. We&#x27;re thrilled to have you on board!</p><!--/$-->"`,
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!--$--><h1>Welcome, <!-- -->Jim<!-- -->!</h1><img alt="test" fetchPriority="low" src="img/test.png"/><p>Thanks for trying our product. We&#x27;re thrilled to have you on board!</p><!--/$-->"`,
);

vi.resetAllMocks();
Expand Down Expand Up @@ -92,7 +92,7 @@ describe('render on the edge', () => {
const actualOutput = await render(<Template firstName="Jim" />);

expect(actualOutput).toMatchInlineSnapshot(
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><link rel="preload" as="image" href="img/test.png"/><!--$--><h1>Welcome, <!-- -->Jim<!-- -->!</h1><img alt="test" src="img/test.png"/><p>Thanks for trying our product. We&#x27;re thrilled to have you on board!</p><!--/$-->"`,
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!--$--><h1>Welcome, <!-- -->Jim<!-- -->!</h1><img alt="test" fetchPriority="low" src="img/test.png"/><p>Thanks for trying our product. We&#x27;re thrilled to have you on board!</p><!--/$-->"`,
);
});

Expand Down Expand Up @@ -141,7 +141,7 @@ describe('render on the edge', () => {
const actualOutput = await render(<Template firstName="Jim" />);

expect(actualOutput).toMatchInlineSnapshot(
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><link rel="preload" as="image" href="img/test.png"/><!--$--><h1>Welcome, <!-- -->Jim<!-- -->!</h1><img alt="test" src="img/test.png"/><p>Thanks for trying our product. We&#x27;re thrilled to have you on board!</p><!--/$-->"`,
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!--$--><h1>Welcome, <!-- -->Jim<!-- -->!</h1><img alt="test" fetchPriority="low" src="img/test.png"/><p>Thanks for trying our product. We&#x27;re thrilled to have you on board!</p><!--/$-->"`,
);
});
});
Expand Down
4 changes: 2 additions & 2 deletions packages/render/src/node/render-node.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('render on node environments', () => {
const actualOutput = await render(<Template firstName="Jim" />);

expect(actualOutput).toMatchInlineSnapshot(
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><link rel="preload" as="image" href="img/test.png"/><!--$--><h1>Welcome, <!-- -->Jim<!-- -->!</h1><img alt="test" src="img/test.png"/><p>Thanks for trying our product. We&#x27;re thrilled to have you on board!</p><!--/$-->"`,
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!--$--><h1>Welcome, <!-- -->Jim<!-- -->!</h1><img alt="test" fetchPriority="low" src="img/test.png"/><p>Thanks for trying our product. We&#x27;re thrilled to have you on board!</p><!--/$-->"`,
);

vi.resetAllMocks();
Expand Down Expand Up @@ -125,7 +125,7 @@ describe('render on node environments', () => {
const actualOutput = await render(<Template firstName="Jim" />);

expect(actualOutput).toMatchInlineSnapshot(
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><link rel="preload" as="image" href="img/test.png"/><!--$--><h1>Welcome, <!-- -->Jim<!-- -->!</h1><img alt="test" src="img/test.png"/><p>Thanks for trying our product. We&#x27;re thrilled to have you on board!</p><!--/$-->"`,
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!--$--><h1>Welcome, <!-- -->Jim<!-- -->!</h1><img alt="test" fetchPriority="low" src="img/test.png"/><p>Thanks for trying our product. We&#x27;re thrilled to have you on board!</p><!--/$-->"`,
);
});

Expand Down
2 changes: 1 addition & 1 deletion packages/render/src/shared/utils/testing/template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface TemplateProps {
export const Template: React.FC<Readonly<TemplateProps>> = ({ firstName }) => (
<>
<h1>Welcome, {firstName}!</h1>
<img alt="test" src="img/test.png" />
<img alt="test" fetchPriority="low" src="img/test.png" />
<p>Thanks for trying our product. We're thrilled to have you on board!</p>
</>
);
Loading