LKB
LKB2y ago

is it totally fine if the number of api is over 80 ?

hi. I am tRPC user. I am very much interested in this project. so I have a question. I read some article from korea's anonymous community that tsc compiler throws error when the number of tRPC API Endpoint is over 80 because of zod's inefficient validator logic. I don't know what exactly it is. but like this post https://www.reddit.com/r/typescript/comments/13sldut/how_do_people_use_zod_on_a_large_project/ , It seems like there are some issues about zod when project is too large. So my question is that : is it totally fine if convex's api endpoint is over 80 or much higher? did someone already tried to make very large number of api endpoint ? The reason I'm asking this question is because I felt that the type checker of convex is quite similar to zod. I am sorry if my English was awkward. English is not my first language. thank you.
Reddit
From the typescript community on Reddit
Explore this post and more from the typescript community
3 Replies
ballingt
ballingt2y ago
Hi @LKB! We have projects with over 100 endpoints so I know that that works. Zod has had regressions before from recursive types but generally the Zod maintainer Colin fixes them, so I'm not sure exactly the folks on Reddit are experiencing. Convex's schema is significantly simple than Zod, so it may be that it isn't at as much risk of slowdowns like this. In particular, Convex argument and schema validators doesn't allow arbitrary validation functions.
LKB
LKBOP2y ago
thank you for answer. I searched after reading your answer, and found this https://github.com/trpc/trpc/discussions/2448 . in conclusion, this problem has been solved in v10, and also convex maintainers also seem recognizing this issue. so I think that I don't need concern about this anymore. thank you 🙂
GitHub
Resources for improving typescript performance? · trpc trpc · Discu...
Our project is at about 40 end points using tRPC V9 with react and we're experiencing a pretty substantial slowdown of typescript. Mutations in particular are excruciatingly slow at this point....
ian
ian15mo ago
Using Zod with TypeScript for Server-side Validation and End-to-End...
Use Zod with TypeScript for argument validation on your server functions allows you to both protect against invalid data, and define TypeScript types ...

Did you find this page helpful?