Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(react-email): Realtime props customization for preview server #1855

Draft
wants to merge 26 commits into
base: 4.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6738426
feat(react-email): Link checker for preview server on a toolbar (#1799)
gabrielmfern Jan 27, 2025
5d7ef3e
chore: Bump for 4.0.0-alpha.0 release
gabrielmfern Jan 27, 2025
932cc60
bump create-email as well
gabrielmfern Jan 27, 2025
6d4ac23
fix(react-email): Padding on the file tree
gabrielmfern Jan 29, 2025
6a2256c
feat(react-email): Image validation checking (#1884)
gabrielmfern Feb 3, 2025
5aafe32
use the oficial lottie react library
gabrielmfern Feb 3, 2025
7d47f1b
initial effort
gabrielmfern Jan 2, 2025
2a06320
write sketch of PreviewPropsControls
gabrielmfern Jan 2, 2025
1f23b00
initial working effort
gabrielmfern Jan 3, 2025
80a46bd
add cache for rendering ç[][]
gabrielmfern Jan 3, 2025
a3c9dcd
lint
gabrielmfern Jan 3, 2025
fa8338a
add setup for other emails
gabrielmfern Jan 3, 2025
a3421fe
fix imports
gabrielmfern Jan 6, 2025
12c6c39
fix cache not being invalidated properly
gabrielmfern Jan 6, 2025
aa128bd
add rendering feedback again
gabrielmfern Jan 6, 2025
5521f78
add styles for Select control
gabrielmfern Jan 6, 2025
14e4fbc
move the fileContents to be cached with the getEmailComponent
gabrielmfern Jan 6, 2025
35ca8d9
fix linting
gabrielmfern Jan 6, 2025
028d65c
add sketch of API for exporting zod schema
gabrielmfern Jan 16, 2025
68f838b
lint
gabrielmfern Jan 16, 2025
4f640fa
write intial working version with zod
gabrielmfern Feb 3, 2025
c51ee46
remove setupForPreview articacts
gabrielmfern Feb 3, 2025
18a8832
fix default props not being filled as best as possible
gabrielmfern Feb 5, 2025
5624af1
fix types
gabrielmfern Feb 5, 2025
0d62001
lint
gabrielmfern Feb 5, 2025
6fce7b9
remove unused imports
gabrielmfern Feb 5, 2025
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
5 changes: 5 additions & 0 deletions .changeset/angry-bugs-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-email": minor
---

Add image validation checking
5 changes: 5 additions & 0 deletions .changeset/empty-rivers-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-email": major
---

Added toolbar with a link checker
5 changes: 5 additions & 0 deletions .changeset/loud-clouds-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-email": patch
---

Fix padding on the file tree
45 changes: 45 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"mode": "pre",
"tag": "alpha",
"initialVersions": {
"demo": "0.0.0",
"web": "0.0.0",
"@benchmarks/preview-server": "0.0.0",
"@benchmarks/tailwind-component": "0.0.0",
"react-email-with-aws-ses": "1.0.7",
"react-email-with-mailersend": "1.0.7",
"react-email-with-nodemailer": "1.0.7",
"react-email-with-plunk": "1.0.7",
"react-email-with-postmark": "1.0.7",
"react-email-with-resend": "1.0.7",
"react-email-with-next-scaleway": "1.0.7",
"react-email-with-node-scaleway": "1.0.7",
"react-email-with-sendgrid": "1.0.7",
"@react-email/body": "0.0.11",
"@react-email/button": "0.0.19",
"@react-email/code-block": "0.0.11",
"@react-email/code-inline": "0.0.5",
"@react-email/column": "0.0.13",
"@react-email/components": "0.0.32",
"@react-email/container": "0.0.15",
"create-email": "0.1.8",
"react-email-starter": "0.1.8",
"@react-email/font": "0.0.9",
"@react-email/head": "0.0.12",
"@react-email/heading": "0.0.15",
"@react-email/hr": "0.0.11",
"@react-email/html": "0.0.11",
"@react-email/img": "0.0.11",
"@react-email/link": "0.0.12",
"@react-email/markdown": "0.0.14",
"@react-email/preview": "0.0.12",
"react-email": "3.0.6",
"@react-email/render": "1.0.4",
"@react-email/row": "0.0.12",
"@react-email/section": "0.0.16",
"@react-email/tailwind": "1.0.4",
"@react-email/text": "0.0.11",
"tsconfig": "0.0.0"
},
"changesets": ["empty-rivers-laugh"]
}
18 changes: 13 additions & 5 deletions apps/demo/emails/magic-links/aws-verify-email.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ import {
Section,
Text,
} from '@react-email/components';
import * as React from 'react';
import { z } from 'zod';

interface AWSVerifyEmailProps {
verificationCode?: string;
}
const AWSVerifyEmailProps = z.object({
verificationCode: z.string(),
});

type AWSVerifyEmailProps = z.infer<typeof AWSVerifyEmailProps>;

const baseUrl = process.env.VERCEL_URL
? `https://${process.env.VERCEL_URL}`
: '';

export default function AWSVerifyEmail({
verificationCode = '596853',
verificationCode,
}: AWSVerifyEmailProps) {
return (
<Html>
Expand Down Expand Up @@ -84,6 +86,12 @@ export default function AWSVerifyEmail({
);
}

AWSVerifyEmail.PreviewProps = {
verificationCode: '596583',
} satisfies AWSVerifyEmailProps;

AWSVerifyEmail.PreviewSchema = AWSVerifyEmailProps;

const main = {
backgroundColor: '#fff',
color: '#212121',
Expand Down
5 changes: 2 additions & 3 deletions apps/demo/emails/magic-links/linear-login-code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ import {
Section,
Text,
} from '@react-email/components';
import * as React from 'react';

interface LinearLoginCodeEmailProps {
validationCode?: string;
validationCode: string;
}

const baseUrl = process.env.VERCEL_URL
Expand Down Expand Up @@ -59,7 +58,7 @@ export const LinearLoginCodeEmail = ({

LinearLoginCodeEmail.PreviewProps = {
validationCode: 'tt226-5398x',
} as LinearLoginCodeEmailProps;
};

export default LinearLoginCodeEmail;

Expand Down
5 changes: 2 additions & 3 deletions apps/demo/emails/magic-links/notion-magic-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ import {
Preview,
Text,
} from '@react-email/components';
import * as React from 'react';

interface NotionMagicLinkEmailProps {
loginCode?: string;
loginCode: string;
}

const baseUrl = process.env.VERCEL_URL
Expand Down Expand Up @@ -89,7 +88,7 @@ export const NotionMagicLinkEmail = ({

NotionMagicLinkEmail.PreviewProps = {
loginCode: 'sparo-ndigo-amurt-secan',
} as NotionMagicLinkEmailProps;
};

export default NotionMagicLinkEmail;

Expand Down
5 changes: 2 additions & 3 deletions apps/demo/emails/magic-links/plaid-verify-identity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ import {
Section,
Text,
} from '@react-email/components';
import * as React from 'react';

interface PlaidVerifyIdentityEmailProps {
validationCode?: string;
validationCode: string;
}

const baseUrl = process.env.VERCEL_URL
Expand Down Expand Up @@ -56,7 +55,7 @@ export const PlaidVerifyIdentityEmail = ({

PlaidVerifyIdentityEmail.PreviewProps = {
validationCode: '144833',
} as PlaidVerifyIdentityEmailProps;
};

export default PlaidVerifyIdentityEmail;

Expand Down
5 changes: 2 additions & 3 deletions apps/demo/emails/magic-links/raycast-magic-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ import {
Section,
Text,
} from '@react-email/components';
import * as React from 'react';

interface RaycastMagicLinkEmailProps {
magicLink?: string;
magicLink: string;
}

const baseUrl = process.env.VERCEL_URL
Expand Down Expand Up @@ -72,7 +71,7 @@ export const RaycastMagicLinkEmail = ({

RaycastMagicLinkEmail.PreviewProps = {
magicLink: 'https://raycast.com',
} as RaycastMagicLinkEmailProps;
};

export default RaycastMagicLinkEmail;

Expand Down
5 changes: 2 additions & 3 deletions apps/demo/emails/magic-links/slack-confirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ import {
Section,
Text,
} from '@react-email/components';
import * as React from 'react';

interface SlackConfirmEmailProps {
validationCode?: string;
validationCode: string;
}

const baseUrl = process.env.VERCEL_URL
Expand Down Expand Up @@ -157,7 +156,7 @@ export const SlackConfirmEmail = ({

SlackConfirmEmail.PreviewProps = {
validationCode: 'DJZ-TLX',
} as SlackConfirmEmailProps;
};

export default SlackConfirmEmail;

Expand Down
5 changes: 3 additions & 2 deletions apps/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
"@react-email/components": "workspace:*",
"react": "^19",
"react-dom": "^19",
"react-email": "workspace:*"
"react-email": "workspace:*",
"zod": "3.24.1"
},
"devDependencies": {
"next": "15.1.2",
"@types/react": "^19",
"@types/react-dom": "^19",
"next": "15.1.2",
"tsx": "4.9.0"
}
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"@types/node": "22.10.2",
"@types/react": "19.0.1",
"@types/react-dom": "19.0.1",
"eslint": "8.50.0",
"happy-dom": "15.10.2",
"prettier": "3.4.2",
"prettier-plugin-tailwindcss": "0.6.6",
Expand Down
2 changes: 2 additions & 0 deletions packages/create-email/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# create-email

## 0.1.9-alpha.0

## 0.1.8

## 0.1.7
Expand Down
2 changes: 1 addition & 1 deletion packages/create-email/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-email",
"version": "0.1.8",
"version": "0.1.9-alpha.0",
"description": "The easiest way to get started with React Email",
"main": "src/index.js",
"type": "module",
Expand Down
6 changes: 6 additions & 0 deletions packages/create-email/template/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# react-email-starter

## 0.1.9-alpha.0

### Patch Changes

- react-email@4.0.0-alpha.0

## 0.1.8

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/create-email/template/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-email-starter",
"version": "0.1.8",
"version": "0.1.9-alpha.0",
"private": true,
"scripts": {
"build": "email build",
Expand All @@ -15,6 +15,6 @@
"devDependencies": {
"@types/react": "19.0.1",
"@types/react-dom": "19.0.1",
"react-email": "workspace:3.0.6"
"react-email": "workspace:4.0.0-alpha.0"
}
}
6 changes: 6 additions & 0 deletions packages/react-email/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# react-email

## 4.0.0-alpha.0

### Major Changes

- f7d352e: Added toolbar with a link checker

## 3.0.6

### Patch Changes
Expand Down
33 changes: 29 additions & 4 deletions packages/react-email/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
{
"name": "react-email",
"version": "3.0.6",
"version": "4.0.0-alpha.0",
"description": "A live preview of your emails right in your browser.",
"bin": {
"email": "./dist/cli/index.js"
},
"main": "./dist/package/index.js",
"module": "./dist/package/index.mjs",
"types": "./dist/package/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/package/index.d.mts",
"default": "./dist/package/index.mjs"
},
"require": {
"types": "./dist/package/index.d.ts",
"default": "./dist/package/index.js"
}
}
},
"scripts": {
"build": "tsup-node && node build-preview-server.mjs",
"dev": "tsup-node --watch",
"dev": "cd ../../apps/demo && tsx ../../packages/react-email/src/cli/index.ts dev",
"test": "vitest run",
"test:watch": "vitest",
"clean": "rm -rf dist"
Expand All @@ -23,8 +38,8 @@
"node": ">=18.0.0"
},
"dependencies": {
"@babel/core": "7.24.5",
"@babel/parser": "7.24.5",
"@babel/traverse": "7.25.6",
"chalk": "4.1.2",
"chokidar": "4.0.3",
"commander": "11.1.0",
Expand All @@ -39,15 +54,20 @@
"socket.io": "4.8.0"
},
"devDependencies": {
"@lottiefiles/dotlottie-react": "0.12.3",
"@radix-ui/colors": "1.0.1",
"@radix-ui/react-checkbox": "1.1.3",
"@radix-ui/react-collapsible": "1.1.0",
"@radix-ui/react-popover": "1.1.1",
"@radix-ui/react-select": "2.1.2",
"@radix-ui/react-slot": "1.1.0",
"@radix-ui/react-tabs": "1.1.1",
"@radix-ui/react-toggle-group": "1.1.0",
"@radix-ui/react-tooltip": "1.1.2",
"@react-email/render": "workspace:*",
"@swc/core": "1.4.15",
"@types/babel__core": "7.20.5",
"@types/babel__traverse": "*",
"@types/fs-extra": "11.0.1",
"@types/mime-types": "2.1.4",
"@types/node": "22.10.2",
Expand All @@ -59,7 +79,10 @@
"autoprefixer": "10.4.20",
"clsx": "2.1.0",
"framer-motion": "12.0.0-alpha.2",
"node-html-parser": "6.1.13",
"postcss": "8.4.40",
"prettier-plugin-tailwindcss": "0.6.6",
"pretty-bytes": "6.1.1",
"prism-react-renderer": "2.1.0",
"react": "^19",
"react-dom": "^19",
Expand All @@ -73,6 +96,8 @@
"tsup": "7.2.0",
"tsx": "4.9.0",
"typescript": "5.1.6",
"vitest": "1.1.3"
"use-debounce": "10.0.4",
"vitest": "1.1.3",
"zod": "3.24.1"
}
}
Loading
Loading