T
tRPC

ā“-help

tRPC without SSR

Nnehalist11/6/2022
When using tRPC with ssr it uses getInitialProps, which has kinda of a cool effect in terms how a page is rendered, since it's rendered server-side on initial requests and client-side on route transitions. Unfortunately, enabling ssr means that you can no longer use getServerSideProps (which I know is only fixable by next.js and not tRPC). But how to replicate the getInitialProps behaviour then? Let's say I'm building a blog; due to SEO it's basically necessary to render my posts server-side. But when navigating through the site loading posts on the fly would be totally fine. How to do that without ssr?
UUUnknown User12/14/2022
Message Not Public
Sign In & Join Server To View
AKAlex / KATT šŸ±12/14/2022
https://trpc.io/docs/caching https://trpc.io/docs/ssr all info should be in those 2 pages
UUUnknown User12/14/2022
Message Not Public
Sign In & Join Server To View
AKAlex / KATT šŸ±12/14/2022
You can use gSSP if you prefer all route changes to be slowed down RSC will come soon and hopefully fix all this stuff.
UUUnknown User12/14/2022
2 Messages Not Public
Sign In & Join Server To View
AKAlex / KATT šŸ±12/15/2022
Fwiw, benefit to not using our ssr is to be able to use Suspense https://trpc.io/docs/suspense
UUUnknown User12/15/2022
2 Messages Not Public
Sign In & Join Server To View
AKAlex / KATT šŸ±12/15/2022
umm if you're okay with doing an SPA, yes
UUUnknown User12/15/2022
Message Not Public
Sign In & Join Server To View

Looking for more? Join the community!

T
tRPC

ā“-help

Join Server
Recommended Posts
trpc + expo react native issueDoes anyone know how to solve this? Im not familiar with webpack at all. Iā€™m a junior frontend.Can you chain middlewares in v10?Would I be able to make a rate limit and isAuthed middleware, then put queries behind both middlewarLoad data client-side via react-query while using tRPC with SSRIs there any way to load data client-side when using tRPC? I want my page to be rendered and load daServing clients in another repository?Would it be possible for tRPC to act as a server for clients in another repository and if so how wouWhen not to use tRPC?Is there any scenario when building a mobile and/or a web app with backend that you would not recommBi directional infinite query example with prismaI'm working on a project that is using this pattern, but my `hasPreviousPages` gets blown away when Websockets not sending dataHi, I have a websocket route that doesn't seem to be sending any data I added a setInterval to tesQuery keysHi! I'm super new to TRPC and based on my understanding, TRPC has a thin wrapper around react query.Possible to use tRPC proxy client inside Edge Runtime?Hi, im trying to fetch a route from trpc inside a Vercel Edge Runtime function. Therefore im tryinv10 migration using codemodSo I've been looking at the codemod that helps with transition towards v10 and I haven't been able tSSR and loading indicators - I don't get itGuess I'm missing something here, but unfortunately I'm having a hard time with the docs: in https:/Prefetch forEachHello, I'm trying to prefetch a list of procedures like this ```ts type QueryKeys = { // how to tNextJs middleware broken by tRPCHi, I have a NextJs middleware that is redirecting to the login page. Basically an Auth guard over mCannot read properties of undefined (reading 'query')Hey folks, Updating from v9 to v10. I thought I'm done, no type errors. Launching the app in dev modUpdating from v9 to v10 - how to access react hooks?Hey folks, I'm updating to v10. I replaced @trpc/react@9.27.4 with @trpc/react-query@10.0.0-proxy-beHow to infer the output of a mutation? The current methods appear to be depreciated.I am attempting to export the bellow utility function to use client side to infer an output type thaTrouble inferring the type of a very simple structure of nested routersA very simple router results in an inference error, causing the client to not be able to infer the rcalling trpc endpoints from vanilla nextJs api routesI'm struggling to find what's the best way to call a trpc endpoint directly from the server. BasicalMutation type issueI'm trying to mutate something like this with tRPC and Prisma ```const updateColumn = trpc.project.uCan I redirect the user from inside my router?I have a query protectedProcedure, which returns an object from my prisma planetscale db What's the