I’ve been working on an @EffectTS_ package to make it easier to use Effect in the @nextjs App Router world by providing "effectful" wrappers and middlewares. 🚀
Try it out and give early feedback at:
https://t.co/j1GrcdzuyY
@TimZolleis@EffectTS_ yes! it's flexible enough for many use cases. at the end of the day it’s just an effect runner that forwards the args and enriches the errors but it's nice because you can use Effect.fn in framework-exposed handlers and get error tracing + automatic spans for free
@MattiaManzati@EffectTS_ 🤯 this is insane, good job! I tried the vscode extension to see effect spans but I feel like vscode is really limiting ui, is there a web version exposed when starting the dev server? With other features like this one it can be really useful to have them in a web gui
@ditorodev@EffectTS_@nextjs@MichaelArnaldi@kitlangton for now it's a server only library. so for typed client/server communication you’d still need to encode/decode manually. but it would be really nice especially for server actions, maybe even integrated with something like effect-atom from @tim_smart
I’ve been working on an @EffectTS_ package to make it easier to use Effect in the @nextjs App Router world by providing "effectful" wrappers and middlewares. 🚀
Try it out and give early feedback at:
https://t.co/j1GrcdzuyY
@matodev@EffectTS_@nextjs yes but the stacktrace is enriched by the library to include effect's one. you can still improve it by giving names to generator functions
@AndersonAndrue Unfortunately Effect.fn cannot infer the type from the build handler, you'd need to specify the type every time like `Effect.fn(function* ({ searchParams }: EffectNextParams) {`, right now you can use middlewares to add spans
@elie2222 Yes, that’s true, but how do you know what errors you’ll get and where? You’d need to add something like neverthrow, but then with zod, p-retry, etc., it turns into library sprawl that you could instead standardize with a single package