ixahmedxi / orbitkit

🚀 Orbitkit is a monorepo starterkit aiming to be the foundation you build your next startup or big idea upon.
https://orbitkit.dev
MIT License
799 stars 46 forks source link

Feature Request: type-safe routes #65

Closed tconroy closed 3 months ago

tconroy commented 4 months ago

Is your feature request related to a problem? Please describe. Many complex webapps have a need for type-safety at the route level. It'd be great if Orbitkit offered a solution for type-safe routing.

Describe the solution you'd like There's a few off-the-shelf packages that could be incorporated to Orbitkit to solve this: nextjs-routes is one I am aware of: https://github.com/tatethurston/nextjs-routes

Describe alternatives you've considered Alternative could be to roll your own typesafe routing solution, but that's probably out of scope for this project.

Additional context Would likely want something compatible with both app and pages based routes.

There is the nextjs.config.ts experimental typed routes that we could explore.

ixahmedxi commented 3 months ago

typed routes don't work with --turbo for dev, which makes it out of the choices.

There are many custom built solutions out there, as well as 3rd party packages that enable this feature. However, most of them rely on some sort of a build step to achieve this type-safety, it needs a bit of digging but should be something that we can add to orbitkit.

ixahmedxi commented 3 months ago

This has been added already now, I have chosen to go with typed routes instead of turbo for dev.