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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Router Inheritance/Merging (Nested Router) #437

Open
ardatan opened this issue Aug 6, 2023 · 5 comments
Open

Implement Router Inheritance/Merging (Nested Router) #437

ardatan opened this issue Aug 6, 2023 · 5 comments

Comments

@ardatan
Copy link
Owner

ardatan commented Aug 6, 2023

No description provided.

@m-abdelwahab
Copy link
Contributor

Based on the issue title, I'm guessing the goal is to be able to combine multiple routers, where you can have a router for each object. tRPC has this concept, and it's very useful when it comes to structuring code https://trpc.io/docs/server/merging-routers

@m-abdelwahab
Copy link
Contributor

Related discussions:

@dodas
Copy link

dodas commented Nov 11, 2023

Thumbs up!
feTS is great, but lack of a way to split routes is a real bummer.

One way I was able to partially workaround this is by extracting router's route method into standalone createRoute function, which is basically just a type helper that returns the route definition as it was passed in.
This allows me to split routes into separate files and then just compose them with createRouter.route(routeA).route(routeB).
Such little feature already goes a long way towards manageable code organization.

@beerose
Copy link
Collaborator

beerose commented Nov 15, 2023

I think we should consider having a similar API as trpc: https://trpc.io/docs/server/merging-routers (as proposed in the related discussion)

@m4rvr
Copy link

m4rvr commented Dec 8, 2023

@dodas Hey! I would love to see an example for this, could you please share one? I'm not 100% getting it 馃槄

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

5 participants