chore(app): poc for rust to ts type generation #3293
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is the beginning of starting to add full type supports in the app frontend by auto-generating them from Rust Types.
My conclusion on auto-generating types:
I think it works pretty nicely, the only odd thing, depending on how we want the generated types to be structured, is that we can't do the same file, since Rust types is split across multiple packages, so they generate one after the other overwriting any existing types in the same file.
It means the turbo config has changed to make the app-lib testing depend on app, so it generates those types first, because it includes it's dependencies, but they should already be covered by the app-lib type generation.
Lastly it's a bit odd with the
export_to
name, inside the macro, I did find this but I could simply not get it to work, and for proving a point to verify this is the way I think it's fine for now (if it's the way you want to go, then I can spend some more time hopefully setting a shared base path, so only the file name changes, but that is still a problem. I also tried providing a constant to the macro, but that is not a possibility in rust.