How to align the client/server DX?
Currently, we use rsc.* to fetch data on the server and trpc.* on the client.
I wish this was the same object used so you didn't have to care if you're on the server or the client.
fwiw, this is the best dx in my eyes. with this, we have the clear separation of where the data actually comes from. so there is no issue in whether we are fetching client-side or server-side.
imo...
This isn't possible because with the react-server export condition because you have to pass appRouter for rsc. We can't/don't want to import that on the client. So I think we'd have to go for transpiling if we wanted to do this.
Would something like this help if there was some logic that didn't resolve the router unless it was needed?
createTrpcThingy({
router: () => import('~/path/to/router'),
...otherOptions,
})
or would it affect client bundles?
ohh yes I think that would help @mmkal! Great idea, I'll try it.