tRPCttRPC
Powered by
BeBoREB
tRPC•3y 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
unstable_httpBatchStreamLink
in their
TRPCProxyClient
TRPCProxyClient
when using RSC. I find this strange, since you already have access to the actual
appRouter
appRouter
, doing an HTTP request to your own server adds a lot of overhead. Why use
TRPCProxyClient
TRPCProxyClient
with
unstable_httpBatchStreamLink
unstable_httpBatchStreamLink
and why not just use
createCaller
createCaller
?

I understand why it's done when rendering
'use client'
'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.
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

unstable_httpBatchStreamLink and formData -> not compatible
CattpotCCattpot / ❓-help
13mo ago
Error handling abort on unstable_httpBatchStreamLink
Cybermuse.ioCCybermuse.io / ❓-help
16mo ago
trpc 11 superjson transformer not working with unstable_httpBatchStreamLink
NeatZNNeatZ / ❓-help
13mo ago
Debug httpBatchStreamLink in DevTools
functiondjFfunctiondj / ❓-help
5mo ago