BeBoREB
tRPC3y ago
3 replies
BeBoRE

Why use unstable_httpBatchStreamLink in React server components?

When using create-t3-app I noticed that they were using
unstable_httpBatchStreamLink
in their
TRPCProxyClient
when using RSC. I find this strange, since you already have access to the actual
appRouter
, doing an HTTP request to your own server adds a lot of overhead. Why use
TRPCProxyClient
with
unstable_httpBatchStreamLink
and why not just use
createCaller
?

I understand why it's done when rendering
'use client'
components on the server, because you don't want server code bundled into the client code. But I fail to understand why they opted to also use this method when rendering server components.
Was this page helpful?