wasp
wasp copied to clipboard
Smart URL/route params
Have them be pre-parsed / typed, so that the developer can be sure that received parameter is indeed what it expected. Maybe worth waiting for TypeScript support for Wasp?
This feature requires some research on how to do it exactly.
It will require expanding Wasp language.
Redwood is doing something similar so that might be worth looking at, I think RoR might be doing something similar also.
So there are two things here:
- Provide a special React Component, e.g. Link, that ensures via TypeScript that only existing routes can be addressed via it.
- Allow typing of route parameters. Something like
/tasks/:id::int/subtasks. So basically you can provide this::intpart. Could be done via Wasp's DSL, or maybe some other way. Redwood has something here already, their own small DSL for it, so worth checking out. RoR also does something similar I think. Also, tanstack router already has some support for this -> maybe worth switching to them and using what they have here.
The first part is done, right @infomiho? The second one is probably covered by another issue that talks about routers. Perhaps you know it right of the bat.