andy
andy
TtRPC
Created by andy on 5/25/2025 in #❓-help
SSR with Client Components
i tried a while ago, and i couldn't get it to work, plus manually setting up prefetching for every route is a bit of a pain
14 replies
TtRPC
Created by andy on 5/25/2025 in #❓-help
SSR with Client Components
okay, for the sake of not installing another dependency, i'm just gonna store a global WeakMap, and instead of the SSR context storing the headers directly, they store an object which can be accessed in the server only WeakMap
14 replies
TtRPC
Created by andy on 5/25/2025 in #❓-help
SSR with Client Components
i don't believe i'm using httponly cookies, and to be honest, the idea of having a cookie that can't be accessed by javascript still feels so fragile and insecure that I just don't rely on it
14 replies
TtRPC
Created by andy on 5/25/2025 in #❓-help
SSR with Client Components
i wouldn't consider headers sensitive data, especially given the fact that the client is the one sending headers
14 replies
TtRPC
Created by andy on 5/25/2025 in #❓-help
SSR with Client Components
I finally managed to find an (incredibly janky) solution: - A server component runs await headers() and then passes it into a client component that then passes it into a context - The TRPC client reads said headers I feel like this should be listed somewhere on the docs.
14 replies