resend / resend-node

Resend's Official Node.js SDK
MIT License
569 stars 42 forks source link

Remove dependency on react package to make it more lightweight #243

Open awdr74100 opened 1 year ago

awdr74100 commented 1 year ago

Hi, first of all thanks for such a great email service, I really like it!

I found that this package is much larger than the packages provided by other email services. Is there any plan to remove the dependency of the react package? To make it more lightweight and less stressful for the integration of other frameworks. Or is this package specific to integrating react?

I know it's possible to simply use the rest api, but then won't get the benefits of types.

azizsafudin commented 10 months ago

I believe react is included due to react-email/render, which is unnecessary for such an SDK. I believe they should be able to make this a standalone client SDK, without react-email/render.

Commenting because I am facing issues due to react-email/render being included in the package.

vcapretz commented 3 months ago

hey there, react itself is now marked as a peerDependency for the react-email/render package, so it should already alleviate a bit the size of the SDK package itself, but I do agree that not depending on react-email/render would be even better.

unfortunately that would put a burden on our users so they have to remember to add extra dependencies separately when they want to use the react prop in the SDK.

do you think the size as is it's in a bad state? we can try looking into minimizing the dependencies for react-email/render a little bit, but I wouldn't say that's a major concern

azizsafudin commented 3 months ago

Hi, it’s been awhile since I left my comment, I’ve forgotten some of the context but for us the size wasn’t the issue. I was just not able to use it in certain serverless environments. I think this coupling is unnecessary for a resend package. If the concern is that users have to add extra deps, then that’s the proper way to do it, along with docs explaining how to get it working. FYI, this was critical enough that we ended up using Postmark instead.

kedarv commented 2 months ago

++ echoing/bumping this thread, having to bundle in react and react-dom for nodeJS applications is a massive drawback of this library. I may end up swapping my implementation out for an off the shelf node SMTP library instead, which is unfortunate because it removes most/all of the DX facing gains from using Resend in the first place!

h4ckedneko commented 3 weeks ago

Hello, I've been using Resend for my applications because its DX is very good. Recently I've been using Cloudflare Workers too where your Worker code size matters. Because this library depends on React, even though I don't use React at all in my email templates. The Worker runtime parses those unused code and degrading the start-up time of my Worker. I believe removing React as a required dependency and making it an optional pluggable dependency is better.

image image

gabrielmfern commented 2 weeks ago

I was just not able to use it in certain serverless environments.

@azizsafudin Sorry for the ping, but what kind of issues did you have here? If you don't mind me asking as well, were you using React Email alongside Resend? If you did have issues due to React Email, it might help us out a lot on React Email if you shared a bit on what you remember.

azizsafudin commented 2 weeks ago

I was just not able to use it in certain serverless environments.

@azizsafudin Sorry for the ping, but what kind of issues did you have here? If you don't mind me asking as well, were you using React Email alongside Resend? If you did have issues due to React Email, it might help us out a lot on React Email if you shared a bit on what you remember.

Sorry I don't remember what the issue was. We were only trying to use Resend, but the react email dependency was blocking us.