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
{{ message }}
This repository was archived by the owner on Dec 19, 2022. It is now read-only.
TypeScript performance. Each procedure added creates a new Router that TypeScript chokes on as the underlying complexity grows non-linearly with each added procedure - each procedure basically has its "own instance" within the compiler even if it's flattened and unaffected at runtime.
I find that those queries are hard/unintuitive to write, I find myself counting parentheses and curly brackets all too often. Arguably, your suggestions with the resolver API could also address this.
No CMD+click
Suggested implementation
Flat router
No automatic prefixing (breaks jump to definition / CMD+click)
import{z}from'zod';import{initTRPC}from'./trpc/server';consttrpc=initTRPC<Context>();constpostRouter=trpc.router({queries: {postById: nullasany/* resolver implementation is a separate discussion */postAll: nullasany/* resolver implementation is a separate discussion */},mutations: {postAdd: nullasany/* resolver implementation is a separate discussion */});constuserRouter=trpc.router({queries: {userAll: nullasany/* resolver implementation is a separate discussion */},);constappRouter=trpc.mergeRouters(postRouter,userRouter,// ...)
The text was updated successfully, but these errors were encountered:
The router API
Challenges with the current implementation
Suggested implementation
The text was updated successfully, but these errors were encountered: