-
-
Notifications
You must be signed in to change notification settings - Fork 352
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
Typesafe Links #698
Comments
Could a global type declaration for anchor tags |
I stand to be corrected, but I believe that isn't possible. The idea is to have VPS code-gen
|
That makes sense. Users are required to provide their own component. |
From Discord:
Yea I thought about this but, so far, I'm against this. Because it would require the user to give each and every route a name, which is pesky. And the ability to change the route of a page without having to update every |
Yes TS template strings are clearly less cluttered. This is better, didn't even think about that feature. |
Currenlty, i18n is being implemented programmatically, which provides a lot of flexibility, see https://vite-plugin-ssr.com/i18n. And, yes, for typesafe links a declarative i18n interface will be needed. (Not only for providing typesafe i18n links, but also for a simpler interface that works for the vast majority of users.) |
Makes senses, thank you for your reply. Programmatic i18n leaves most flexibility for routes (e.g. subdomain vs pathname prefix) and people can still share functions, components or e.g. React hooks to work with the API. |
Would this also apply to navigate? remix-routes does this as $path so you'd just by default kill two birds with one stone, as you just call it with that function. |
Yes. |
Very much looking forward to using this! It’d be awesome if in addition to type-safe pathnames, there was support (or at least a recommendation) for how to set and consume type-safe query parameters / hashes in the URL, similar to TanStack Router. |
I agree. |
Description
I've a design in mind to make this work:
Help make it happen
The text was updated successfully, but these errors were encountered: