Spark
calling tRPC procedure from custom link
currently using a helper vanilla client approach, but if I want to pass supabase auth I may have to wrap app in a second
TRPCProvider
and try to use the utils
of the parent in the custom link of the child provider?4 replies
TRPC with Turborepo Nextjs
I have been following https://github.com/t3-oss/create-t3-turbo/tree/main where tRPC is in a separate package like you are saying, and it is hosted on Vercel with the Next.js app.
I think the main advantage for a separate package is flexibility. If you wanted to decouple the tRPC API from the Next.js app later you could use the package in a separate tRPC app like https://ion.sst.dev/docs/start/aws/trpc/. This is more complex, but better with scale.
3 replies
Why is my tRPC + Next 14 (app router) data fetching pattern not refreshing the UI?
I would take a look at the
create-t3-turbo
repo and study the data fetching patterns. https://github.com/t3-oss/create-t3-turbo/blob/main/apps/nextjs/src/app/page.tsx
Thoughts:
1. not sure if always correct, but I like to keep my pages as server components and import client components if needed
2. to revalidate you can use this https://trpc.io/docs/client/react/useUtils#query-invalidation4 replies