You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In a project with drizzle, trpc and zod, as the number of routes grows it makes each type inference take seconds (even with only some dozens of routes).
Maybe not the reality of most to have that many routes, but also considering the TS tooling growing and generating more complex and nested types, this makes for a DX that continually drops to a crawl as the project grows.
is to split things into a monorepo, so each can be built at save and speedup TS inference, since it would depend on prebuilt types.
So, the "server" folder could be a "package" in a monorepo and be built at a different time so the frontend can use the routes at maximum speed.
As far as I have problems, the TRPC router aggregates everything and causes the problems.
If there are problems with the DB part I haven't felt, but it could also be an option to split it further to separate db, trpc routes, utils... each in its own "package" that can be handled and cached independently.
Describe alternate solutions
The most reliable solution other than just suffering from slow inference is to split into a monorepo.
Additional information
I have searched for alternatives, but found the most reliable to be the monorepo one.
A monorepo approach might introduce some extra complexity beforehand, but it makes DX more constant over project time, including that it makes it easier to add more independent packages or even split the project as needed.
With that said, more tooling relying on complex typescript shenanigans might make this a bigger necessity to keep up the speed with a clean project.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
In a project with drizzle, trpc and zod, as the number of routes grows it makes each type inference take seconds (even with only some dozens of routes).
Maybe not the reality of most to have that many routes, but also considering the TS tooling growing and generating more complex and nested types, this makes for a DX that continually drops to a crawl as the project grows.
Describe the solution you'd like to see
One of the solutions for that: trpc/trpc#2448 (comment)
is to split things into a monorepo, so each can be built at save and speedup TS inference, since it would depend on prebuilt types.
So, the "server" folder could be a "package" in a monorepo and be built at a different time so the frontend can use the routes at maximum speed.
As far as I have problems, the TRPC router aggregates everything and causes the problems.
If there are problems with the DB part I haven't felt, but it could also be an option to split it further to separate db, trpc routes, utils... each in its own "package" that can be handled and cached independently.
Describe alternate solutions
The most reliable solution other than just suffering from slow inference is to split into a monorepo.
Additional information
I have searched for alternatives, but found the most reliable to be the monorepo one.
I did check #327
A monorepo approach might introduce some extra complexity beforehand, but it makes DX more constant over project time, including that it makes it easier to add more independent packages or even split the project as needed.
With that said, more tooling relying on complex typescript shenanigans might make this a bigger necessity to keep up the speed with a clean project.
The text was updated successfully, but these errors were encountered: