Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Ability to merge routers with different contexts #5113

Open
1 task
ethndotsh opened this issue Nov 28, 2023 · 2 comments
Open
1 task

feat: Ability to merge routers with different contexts #5113

ethndotsh opened this issue Nov 28, 2023 · 2 comments

Comments

@ethndotsh
Copy link

ethndotsh commented Nov 28, 2023

Describe the feature you'd like to request

The ability to merge routers that have different contexts into one client. For example a Fastify tRPC server + a Next.js tRPC server that have different purposes, but both need to be consumed by the Next.js app which is not possible at the moment.

Describe the solution you'd like to see

KATT mentioned that really only error formatting needs to be the same, so some new merge routers method that merges any two routers as long as their error formatting is the same.

Describe alternate solutions

The only workaround I can think of off the top of my head is calling the secondary server (in my example, the Fastify server) with createServerSideHelpers and then proxying it with a new router inside the Next.js server, although this adds unneeded latency and complexity.

Additional information

#5111

👨‍👧‍👦 Contributing

  • 🙋‍♂️ Yes, I'd be down to file a PR implementing this feature!

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified
Fund with Polar
@ethndotsh
Copy link
Author

ethndotsh commented Dec 7, 2023

Just sponsored the issue, hope this can be implemented soon! It is unfortunately blocking the development of my app.

@rjay98
Copy link

rjay98 commented Apr 17, 2024

I'll also sponsor this issue. Primary use-case right now is migrating a Next.js monolith into a separate API server (for other clients to consume). In order to do a piecewise migration, we are experiencing friction when using two separate server endpoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants