Skip to content

feat(react-email): export compatibility checking#3329

Draft
gabrielmfern wants to merge 7 commits intocanaryfrom
feat/export-compatibility-checking
Draft

feat(react-email): export compatibility checking#3329
gabrielmfern wants to merge 7 commits intocanaryfrom
feat/export-compatibility-checking

Conversation

@gabrielmfern
Copy link
Copy Markdown
Member

@gabrielmfern gabrielmfern commented Apr 16, 2026

Summary by cubic

Move email compatibility checking and Caniemail data into react-email, and update the preview server to use the new API. Also relocate the CLI to src/cli with a dedicated build output while keeping the email binary unchanged.

  • New Features

    • Added a public Caniemail API in react-email:
      • checkSupportForElement, checkSupportForAttribute, checkSupportForStyleDeclaration
      • Parsed types and helpers exported from react-email
      • Bundled Caniemail data and a script to refresh it (caniemail:fetch)
    • Preview server streams compatibility insights using the react-email API when traversing JSX elements, attributes, and inline styles.
  • Refactors

    • Removed duplicated Caniemail parsing and data from preview-server; now imports from react-email.
    • Moved the CLI to src/cli and built it to dist/cli; bin.email now points to dist/cli/index.js.
    • Updated react-email exports map and build to emit ESM/CJS for the library and a separate ESM bundle for the CLI.
    • Reorganized AST/Tailwind utility paths in preview-server.
    • Added react-email as a dependency in preview-server and cleaned unused scripts/deps.

Written for commit ebd4b1c. Summary will update on new commits.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-email Error Error Apr 16, 2026 5:48pm
react-email-demo Error Error Apr 16, 2026 5:48pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 16, 2026

⚠️ No Changeset found

Latest commit: ebd4b1c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

}
} else if (entry.type === 'css-functions') {
const functionRegex = /(?<functionName>[a-zA-Z_][a-zA-Z0-9_-]*)\s*\(/g;
const functionName = functionRegex.exec(value)?.groups?.functionName;
Comment on lines +165 to +166
return title
.split(/\s*,\s*/)
Comment on lines +187 to +188
return title
.split(/\s*&\s*/)
Comment on lines +196 to +197
return title
.split(/\s*,\s*/)
Comment on lines +205 to +206
return keywords
.split(/\s*,\s*/)
/(?<propertyName>[a-z-]+)\s*:\s*(?<propertyValue>[a-zA-Z\-0-9()+*/_ ]+)/;

export function parseCssPropertyWithValue({ title }: SupportEntry) {
const match = propertyRegex.exec(title.trim());
}

export function parseElementNames({ title, keywords }: SupportEntry) {
const match = /<(?<elementName>[^>]*)> element/.exec(title);
Comment on lines +251 to +253
return keywords
.toLowerCase()
.split(/\s*,\s*/)
Comment on lines +258 to +260
return title
.toLowerCase()
.split(/\s*,\s*/)
Comment on lines +24 to +28
`import type { SupportEntry } from "./support-entry-parsing.js";

export const nicenames = ${JSON.stringify(response.nicenames, null, 2)};

export const supportEntries: SupportEntry[] = ${JSON.stringify(response.data, null, 2)}`,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants