Skip to content

Conversation

@gabrielmfern
Copy link
Member

@gabrielmfern gabrielmfern commented Oct 30, 2025

Updates the react.email website and the preview server to use Next.js 16. With this we're also moving to turbopack.

The only exception for not using turbopack is when building in the email build command. The main reason is that turbopack doesn't handle modules that it can't find the same exact way as webpack, which makes it just error building the preview server when it can't find the imports:

import { Body } from '@react-email/body';
import { Button } from '@react-email/button';
import { CodeBlock } from '@react-email/code-block';
import { CodeInline } from '@react-email/code-inline';
import { Container } from '@react-email/container';
import { Heading } from '@react-email/heading';
import { Hr } from '@react-email/hr';
import { Img } from '@react-email/img';
import { Link } from '@react-email/link';
import { Preview } from '@react-email/preview';
import { Text } from '@react-email/text';

To circumvent this, while we don't yet completely remove the npm install step from email build we'll have to stick to webpack there. We could also have @react-email/components as a dependency of the preview server to fix this, but I'm not sure what kind of impact on stability that could have - as in, conflicts with the ones installed by the user.


Summary by cubic

Upgrade workspace to Next.js 16 and enable Turbopack by default for faster dev/build, while keeping webpack for the email build command to avoid module resolution errors in preview builds. No breaking changes to the Tailwind API; minor helpers are now exported for better tree-shaking.

  • Dependencies

    • Bumped Next to 16.0.1 across apps, packages, and examples (requires Node >= 20.9.0).
    • Moved configs to Next 16 conventions: next.config.ts (ESM) with serverExternalPackages: ['esbuild'] and updated next-env.d.ts import form.
    • email build uses next build --webpack to match webpack’s missing-module behavior and keep preview builds stable.
  • Refactors

    • Tailwind: extracted sanitizeStyleSheet and inlineStyles as standalone exports to improve tree-shaking and reduce bundle size.

Written for commit ab5c789. Summary will update automatically on new commits.

@changeset-bot
Copy link

changeset-bot bot commented Oct 30, 2025

⚠️ No Changeset found

Latest commit: ab5c789

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

@gabrielmfern gabrielmfern self-assigned this Oct 30, 2025
@vercel
Copy link

vercel bot commented Oct 30, 2025

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

Project Deployment Preview Comments Updated (UTC)
react-email Ready Ready Preview Comment Oct 30, 2025 4:05pm
react-email-demo Ready Ready Preview Comment Oct 30, 2025 4:05pm

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 30, 2025

Open in StackBlitz

npm i https://pkg.pr.new/resend/react-email/@react-email/preview-server@2613
npm i https://pkg.pr.new/resend/react-email@2613
npm i https://pkg.pr.new/resend/react-email/@react-email/tailwind@2613

commit: ab5c789

Copy link
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.

1 issue found across 16 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="packages/react-email/package.json">

<violation number="1" location="packages/react-email/package.json:53">
Upgrading to Next 16.0.1 requires raising the package’s Node engine range to meet Next’s &gt;=20.9.0 requirement; leaving `engines.node` at &gt;=18.0.0 advertises support for versions where the preview tooling will now fail.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@gabrielmfern gabrielmfern requested review from a team, bukinoshita and pedro-stramantinoli and removed request for a team and bukinoshita October 30, 2025 16:02
@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addeddebounce@​2.0.01001008277100

View full report

@gabrielmfern gabrielmfern merged commit f11039a into canary Oct 30, 2025
16 checks passed
@gabrielmfern gabrielmfern deleted the feat/use-next-16 branch October 30, 2025 16:08
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.

3 participants