Skip to content

feat(react-email): Unify all components into react-email #1800

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

Open
wants to merge 79 commits into
base: 4.0
Choose a base branch
from

Conversation

gabrielmfern
Copy link
Collaborator

@gabrielmfern gabrielmfern commented Dec 3, 2024

This PR moves all components into packages/react-email/src/package on each individual folder and builds them all together so that users can import from react-email instead of from @react-email/components.

To actually get this to work in a simple way, I changed Tailwind to be built with tsup instead of with vite, this makes things a bit simpler and also makes it safer for edge cases. The only way I got this to work properly was through patching the dependencies that had some problem, this also came with the trade-off caused by the fact that pnpm doesn't let you patch a version of the package while using another unpatched version of it. To properly deal with this, the only way I found was to keep a patched version of the packages in the workspace and use them on the Tailwind component, this is the reason for the 400 Files changed.

I also added in a simple optimization to the getEmailComponent function so that it uses the rebuild API for faster builds.

Another change I made was to upgrade the tests under tailwind/integrations/* so that they are a bit simpler and safer.

This PR also does small changes to turbo and the Github Action to avoid duplicated work being done.

The reason for the amount of additions being so large in comparison to the deletions is both because of the new patched/* directory and also because I have not removed all the component packages from packages/* as it's probably better to remove it on another subsequent PR.

Copy link

vercel bot commented Dec 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-email ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 24, 2025 6:42pm
react-email-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 24, 2025 6:42pm

Copy link

changeset-bot bot commented Dec 3, 2024

🦋 Changeset detected

Latest commit: 5a7e753

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-email Major

Not sure what this means? Click here to learn what changesets are.

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

@gabrielmfern gabrielmfern self-assigned this Dec 3, 2024
@gabrielmfern gabrielmfern added Package: react-email This is the CLI we generally use as just `email` on the temrinal. App: Preview and removed App: Preview labels Dec 3, 2024
@gabrielmfern gabrielmfern force-pushed the canary branch 2 times, most recently from 4ee4d1d to 0187b0a Compare December 23, 2024 13:28
@gabrielmfern gabrielmfern force-pushed the feat/unify-packages branch 3 times, most recently from 46eb766 to 946127b Compare January 7, 2025 15:59
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@oxc
Copy link

oxc commented Apr 16, 2025

I hope this does not mean that there will be no way to import components separately? The react-email package pulls in a lot of dependencies that I cannot have on my package, first of all Next.js (I'm using react-router framework, so I really don't want to import Next.js into my project).

@gabrielmfern
Copy link
Collaborator Author

I hope this does not mean that there will be no way to import components separately

@oxc They won't be available separately anymore, but we don't plan to keep the preview server as part of react-email, and rather have it as a separate package or some other similar solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: react-email This is the CLI we generally use as just `email` on the temrinal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants