Data preloading in components
Unanswered
Masai Lion posted this in #help-forum
Masai LionOP
Hey, I want to use your brain for a bit. Currently I have a tRPC backend and it grew significantly, until I discover preloading and resolved to add background tasks into my project.
tRPC has this tutorial where they test their new tRPC with app router, and in the file below, when they create a client to run in the server-side, it imports the whole appRouter:
https://github.com/trpc/examples-next-app-dir/blob/2e7f3d04a29a3bca4ab516607425124c429c7663/src/trpc/rq-server.ts#L26
this for me it's a big issue because in my tRPC app router I have redis and bullmq to do background tasks and this messes with my frontend because it imports them during the runtime, causing issues... are there better alternatives for data fetching that are not too verbose like manually implementing react-query or fetch API?
I am having nightmares because my backend is fully integrated with tRPC and I want to bail out asap.
tRPC has this tutorial where they test their new tRPC with app router, and in the file below, when they create a client to run in the server-side, it imports the whole appRouter:
https://github.com/trpc/examples-next-app-dir/blob/2e7f3d04a29a3bca4ab516607425124c429c7663/src/trpc/rq-server.ts#L26
this for me it's a big issue because in my tRPC app router I have redis and bullmq to do background tasks and this messes with my frontend because it imports them during the runtime, causing issues... are there better alternatives for data fetching that are not too verbose like manually implementing react-query or fetch API?
I am having nightmares because my backend is fully integrated with tRPC and I want to bail out asap.