Add package @7nohe/adonis-typed-links#114
Conversation
|
Hey, thanks for the PR Why not using Tuyau and specifically @tuyau/inertia? I see that your What do you think? |
|
I agree with your thoughts and would like to contribute to Tuyau when I get the chance. |
If you're unfamiliar with the codebase: I would be happy to help! Feel free to reach out to me on Discord or open an issue on the repo, and I will try my best to help. https://github.com/Julien-R44/tuyau/blob/main/packages/inertia/src/react/index.tsx I think adding a Since Tuyau also generates the Input/Output types for each controller/endpoint, it would be entirely possible to have a // Pass the route name ( or maybe an url ) to the `useForm`
const form = useForm('posts.comment', {
// And thanks to Tuyau codegen, we are able to detect WHAT data should be sent to this endpoint.
// Here, username is not a property accepted by our endpoint. So Typescript should yell at us
username: '',
})See what I mean? |
|
I see, the input and output type generation is excellent! |
|
I want to proceed with adding this package’s features to Tuyau, so I’ll close this PR for now. |
Provides strongly-typed wrappers for Inertia.js's Links, Manual Visits, and Form Helper from AdonisJS routing