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

Type-safe href #12697

Closed
ryanflorence opened this issue Jan 6, 2025 · 8 comments · Fixed by #12994
Closed

Type-safe href #12697

ryanflorence opened this issue Jan 6, 2025 · 8 comments · Fixed by #12994
Assignees
Milestone

Comments

@ryanflorence
Copy link
Member

ryanflorence commented Jan 6, 2025

Planning Notes
  • Should have something to play with in the next couple of days (JAN 13)
@ryanflorence ryanflorence converted this from a draft issue Jan 6, 2025
@ryanflorence ryanflorence added this to the v7.1.0 milestone Jan 6, 2025
@ryanflorence ryanflorence moved this from Planned to In Progress in Roadmap Jan 13, 2025
@ryanflorence ryanflorence changed the title typesafe href builder More Type Safety (href builder, accessing route data across the app) Jan 13, 2025
@pcattori
Copy link
Contributor

pcattori commented Jan 15, 2025

PR: #12752
Initial experimental release with href: 0.0.0-experimental-345f1da12

PR: #12994

@pcattori
Copy link
Contributor

New experimental release with href and union of possible child routes for matches: 0.0.0-experimental-759a11a62

@fredericoo
Copy link

So similar to my solution for react-router v6 over a year ago: https://github.com/fredericoo/react-router-typesafe?tab=readme-ov-file#typesafebrowserrouter-%EF%B8%8F-new

@pcattori
Copy link
Contributor

Experimental (just types for href, no runtime): 0.0.0-experimental-004e483a8

@pcattori pcattori linked a pull request Feb 12, 2025 that will close this issue
3 tasks
@pcattori pcattori moved this from In Progress to Merged/Done in Roadmap Feb 12, 2025
@pcattori pcattori changed the title More Type Safety (href builder, accessing route data across the app) Type-safe href Feb 12, 2025
@ramrami
Copy link

ramrami commented Feb 12, 2025

Awesome!
Any plans for supporting typed query strings too? Like what safe-routes does?

@pcattori
Copy link
Contributor

Awesome! Any plans for supporting typed query strings too? Like what safe-routes does?

It's on our radar, but you can use nuqs if you want type-safe query params today in Remix/React Router

@franky47
Copy link

franky47 commented Feb 12, 2025

Thanks for mentioning it @pcattori !

I think the question is relevant though. TanStack Router/Start has set the bar very high for type-safe routing, and we should look for ways to bring the same (or at least very close) levels of DX in other frameworks.

nuqs has the serializer feature that generate URLs with type-safe search params, but integrating it with type-safe base pathnames would make it even more powerful.

I'll try this proposal for react router and see what I can do on my end.

Copy link
Contributor

🤖 Hello there,

We just published version 7.2.0-pre.2 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

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

Successfully merging a pull request may close this issue.

5 participants