RFC: decouple resend-node from @react-email/render and react #588
emiliosheinz
started this conversation in
Ideas
Replies: 1 comment
-
|
definitely worth discussing, will share it with the team |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Background
Several users have reported unexpected issues with
@react-email/renderandreactappearing in their builds when usingresend-node. After digging into this, we found that the root cause was that@react-email/renderwas listed as a direct dependency ofresend-node.As a fix,
@react-email/renderwas made an optional peer dependency. This prevents it from being automatically installed alongsideresend-node.However, even with this change, users are still running into build-time errors due to missing packages. To fix those, they need to explicitly mark the packages as external in their bundler config, which is far from ideal as it adds friction to the developer experience on the most basic usage of the package and introduces extra steps that shouldn’t be necessary just to send emails.
References:
react/@react-email/renderas a dependency #309 (comment)Proposed Change
I believe
resend-nodeshould be fully decoupled from@react-email/renderandreact.Right now,
resend-nodeis tied to a specific rendering implementation, when its responsibility should be solely to send emails. By decoupling rendering concerns, we can avoid these build-time pitfalls and make the package easier to integrate across different environments and toolchains. Instead of handling rendering internally, the package should only accepthtmlortextvalues.In the long term, this separation keeps
resend-nodelean and sustainable. It ensures the library remains focused on a single responsibility, making it easier to evolve and less prone to breaking changes caused by upstream dependencies. It also reduces the surface area for maintenance, since issues related to rendering would be handled where they belong, in the rendering libraries themselves.This would be done by removing the react option from resend.emails.send and similar functions, along with any functionality that relies on it.
Example:
Open Questions
User Delight vs. Separation of Concerns: Should
resend-nodecontinue to offer React rendering as a “convenience feature” for new users, or should it be removed entirely in favor of a clear separation? As @vcapretz pointed out, React support might feel like a small but delightful feature for those who need it.Breaking Change: I assume removing the
react/@react-email/renderintegration would require a major version bump. How should we handle migration for existing users?Default Experience: What do you think is the right balance between a frictionless “getting started” experience and long-term maintainability/flexibility?
I’d love to hear what the community and maintainers think about this direction. Whether fully decoupling rendering is the right long-term path, if keeping React support as a convenience is worth the trade-offs, and how we could make any transition smoother for existing users. Thanks!
Other related issues
react/@react-email/renderas a dependency #309Beta Was this translation helpful? Give feedback.
All reactions