feat(react-email): export compatibility checking#3329
Draft
gabrielmfern wants to merge 7 commits intocanaryfrom
Draft
feat(react-email): export compatibility checking#3329gabrielmfern wants to merge 7 commits intocanaryfrom
gabrielmfern wants to merge 7 commits intocanaryfrom
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
| } | ||
| } 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)}`, |
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.
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 tosrc/cliwith a dedicated build output while keeping theemailbinary unchanged.New Features
react-email:checkSupportForElement,checkSupportForAttribute,checkSupportForStyleDeclarationreact-emailcaniemail:fetch)react-emailAPI when traversing JSX elements, attributes, and inline styles.Refactors
preview-server; now imports fromreact-email.src/cliand built it todist/cli;bin.emailnow points todist/cli/index.js.react-emailexports map and build to emit ESM/CJS for the library and a separate ESM bundle for the CLI.preview-server.react-emailas a dependency inpreview-serverand cleaned unused scripts/deps.Written for commit ebd4b1c. Summary will update on new commits.