Skip to content

fix: to support @react-email/render exports across versions in templates#863

Merged
felipefreitag merged 6 commits into
resend:canaryfrom
Shubhdeep12:fix/templates-renderasync
May 19, 2026
Merged

fix: to support @react-email/render exports across versions in templates#863
felipefreitag merged 6 commits into
resend:canaryfrom
Shubhdeep12:fix/templates-renderasync

Conversation

@Shubhdeep12
Copy link
Copy Markdown
Contributor

@Shubhdeep12 Shubhdeep12 commented Mar 2, 2026

  • @react-email/render dropped renderAsync in v2.0.0.

Summary by cubic

Use a shared render helper to render React components in Templates, aligning with @react-email/render’s render API and removing dynamic imports. This simplifies Templates (and Emails) and preserves a clear error when @react-email/render is missing.

  • Bug Fixes
    • Templates now call the shared render directly; dynamic import and cached renderer removed.
    • Clear error when @react-email/render isn’t installed.
    • Tests updated to mock render (removed renderAsync usage).
    • Minor cleanup in Emails: removed unnecessary React type cast.

Written for commit a194555. Summary will update on new commits. Review in cubic

@Shubhdeep12 Shubhdeep12 requested a review from a team as a code owner March 2, 2026 15:54
@Shubhdeep12 Shubhdeep12 changed the title fix: toupport @react-email/render exports across versions in templates fix: to support @react-email/render exports across versions in templates Mar 2, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 2, 2026

Open in StackBlitz

npm i https://pkg.pr.new/resend@863

commit: a194555

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Comment thread src/templates/templates.ts Outdated
@Shubhdeep12 Shubhdeep12 requested a review from gabrielmfern March 6, 2026 01:38
Comment thread src/templates/templates.ts Outdated
@Shubhdeep12 Shubhdeep12 requested a review from gabrielmfern March 6, 2026 14:40
Comment thread src/render.ts Outdated
@gabrielmfern gabrielmfern self-requested a review March 18, 2026 20:55
@github-actions github-actions Bot added the linear-synced PR has been synced to Linear label May 16, 2026
…rasync

# Conflicts:
#	src/emails/emails.ts
#	src/templates/templates.ts
The bug fix only needs templates.ts to use the shared render() helper.
The fallback to renderAsync and the extra error path only matter for a
hypothetical @react-email/render version that exports renderAsync but
not render, which has never shipped.
@felipefreitag felipefreitag merged commit 45dc73d into resend:canary May 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linear-synced PR has been synced to Linear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants