What are the best practices for keeping TRPC and ts-server fast?
I decided to migrate my entire app to TRPC over a couple days as I identified it was a great solution for my use case. However, now my typescript auto-complete and typing checking appear to be much slower.
I think TRPC is still the best solution, I'm just curious if there are good practices to follow to ensure that my ts-server stays fast as I scale even further. ts-go may help with this in the future, but for now I'm stuck waiting a few seconds for intellisense. Anyone have any resources I can review?
2 Replies
Keep Zod types to very simple types (not omit/exclude/extend shenanigans)
Also don’t overuse output validators as they’re rarely needed
https://discord.com/channels/867764511159091230/1343948018377953360
this might be interesting
My zod types are pretty simple as is. Potentially it’s something else causing it but seams about too coincidental. Might have to deep dive into profiling the two server to see the root cause. Will take a more detailed look into the work already conducted on this front to see what I can learn.
Also saw that passing type generics directly into my queries from the router outputs might help, so I’ll give a crack at that.