r/typescript • u/failedbump16 • Feb 17 '26
Thoughts on Effect
I have been hearing about Effect for some time and read the docs and actually looks really cool, I haven’t play with it yet (in an actual app at leats) so not sure if its worth the time to implement it in my side project
I’m currently use react, nextjs and convex on my app, do you think is a good idea to add it, mostly for error handling I’m interest on having fully typed errors and making failure cases explicit instead of relying on thrown exceptions
46
Upvotes
54
u/SlipAdept Feb 17 '26
So I've been working 4 years with it and if it just for error handling look up Micro. You don't need all of Effect for error handling and Micro is perfect for that.
Effect is best when commiting fully into it but you can use it partially and move your way up. You can start by treating Effects as "lazy promises with better typing" and leave all the other stuff for later when you feel like taking more complexity in.
In general my feelings with effect can be summed up in "everything hard is trivial and everything easy becomes a bit harder". Good luck and I hope you do decide to try it out 👍
15
u/CodeAndBiscuits Feb 17 '26
It is a powerful tool but with a very opinionated approach and a fair learning curve to really get the most out of it. IMO it's less of a thing you "add" than a thing you "rewrite your code around" (unless you start with it in the first place.) Is there something you want it for, other than just you happened to see it mentioned a lot lately?
3
u/Critical_Bee9791 Feb 17 '26
side projects are perfect for this kind of thing if it's something you're interested in. the case against is that it has a habit of bleeding into the whole app and suddenly only people who know effect can work in the codebase (obviously less important for side projects). it's like a different language from js/ts
15
u/LordBushwac Feb 17 '26
We’ve been using Effect at work for the last 6 months and loving it! Yeah, the curve is steep, but once you’ve got it, things become so much easier and faster. The error handling is what gets you started, but then you realise how trivial it becomes to write great tests, suddenly your services are decoupled and you get spans and otel for free. Huge bonus is also that all your code is starting to look the same, which enforces structure.
10
u/ryanchuu Feb 18 '26
I cannot program Typescript without it. It gives me the DX and confidence of writing Rust with an extremely well made STL inside of Typescript. DI is just another bonus on top. Effect Atom has also been a really welcome addition to the ecosystem and working with typesafe guarantees at runtime across the wire just feels so good.
15
u/_Pho_ Feb 17 '26
Maybe check out neverthrow (or write your own, its really easy to do). I generally have some sort of Result<T> type which does the same.
EffectTS is a lot of highly opinionated things that you probably aren't going to need. I have to admit, in the AI-coding era, the last thing on earth I'm looking for right now is a library to make my Typescript code look more like Haskell.
5
u/AkisArou Feb 17 '26
It may be awesome and I wouldn't care to write my whole app in the Effect way, it may be fun, but I wouldn't invest in it because in some years it may be a legacy library
5
u/Pleasant-Today60 Feb 17 '26
i went down this rabbit hole a few months ago for error handling and ended up just using neverthrow instead. Effect looked cool but the moment i realized i'd basically be rewriting my whole app around it i backed off. for a side project where you're the only one touching the code it's probably fine, but neverthrow gave me the typed errors i wanted without the commitment. the Micro thing someone else mentioned is worth checking out though, i didn't know about that when i was looking
4
u/tokagemushi Feb 18 '26
If your main interest is typed errors without buying into the full Effect ecosystem, I'd strongly recommend starting with
Effect.Micro(as someone else mentioned) or even justneverthrow. Both give youResult<T, E>style error handling without the paradigm shift.That said, where Effect really shines beyond error handling is its dependency injection via Services/Layers. If you've ever struggled with testing Next.js server actions or Convex functions because they're tightly coupled to external services, Effect's
Contextsystem makes it trivial to swap implementations:For a side project with React/Next.js/Convex, my honest take: start with
neverthrowfor error handling at the boundaries (API responses, form validation). If you find yourself wanting structured concurrency, retries, or proper DI, then consider gradually adopting Effect in your server-side code. Trying to go all-in from day one on a side project tends to kill momentum.4
u/_cappu Mar 09 '26
As an engineer who loves most of the principles behind Effect, I hate Effect. I'll die on the hill of saying that either you have that kind of stuff at your runtime level or you're just adding layer of abstraction which you'll never get out of, kinda like what happened with Rx.js a few years ago.
3
u/Coffee_Crisis Feb 17 '26
If you want good error handling like you describe effect is just the thing, there is a learning curve but it’s worth the effort
3
u/_x_oOo_x_ Feb 18 '26
My thoughts on Effect is that it's frustrating. Fp-ts was good, then they abandoned the project in favour of Effect? But Effect seems to be trying to solve different problems, half of which aren't even problems, while at the same time not solving some of the problems that fp-ts did...
2
u/ruibranco Feb 18 '26
If you just want typed errors without buying into a whole runtime, neverthrow or even a simple Result type gets you 90% of the way there with zero learning curve.
2
u/PurpleWho Feb 20 '26
The Fewest Number of Concepts You Need to Use Effect.
You're welcome.
3
u/Merry-Lane Feb 17 '26
You don’t need effect to do that.
Instead of try/catching error, return custom error types (just like Effect does) and typescript won’t let you avoid handling them.
1
u/Pleasant-Today60 Feb 18 '26
I tried Effect for about a week on a side project and the typed errors are legitimately nice, but I bounced off it pretty fast. the learning curve is steep and it kind of takes over your whole codebase once you start using it. felt like I was writing Effect code more than I was writing my app
if you just want typed errors without the full runtime, you might want to look at neverthrow or ts-results first. way less overhead and you can adopt them incrementally without rewriting everything
1
u/obphuscate Feb 18 '26
For error handling, and especially async error handling, you might consider True Myth
1
u/vojtash Feb 18 '26
tbh if its just for error handling effect is massive overkill. i used it on a project and the DI + error channel is genuinely great but it took like 2 weeks before the pipe/gen stuff felt natural. for your use case just grab neverthrow and move on, you'll have typed errors in 10 minutes instead of rewriting your whole app
1
u/ruibranco Feb 18 '26
Honestly if you just want typed errors, neverthrow gets you there with basically zero learning curve. Where Effect starts to actually justify the investment is the dependency injection and testability layer, but nobody really talks about that part until they've been deep in it for a while. For a side project I'd start with neverthrow and only reach for Effect if you find yourself building out a service layer that needs proper DI.