Skip to content

chore(app): poc for rust to ts type generation #3293

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

MagnusHJensen
Copy link
Contributor

@MagnusHJensen MagnusHJensen commented Feb 21, 2025

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.

@MagnusHJensen MagnusHJensen changed the title chore(app-frontend): start typing profile helper and library pages chore(app-frontend): type profile helper and library pages Feb 21, 2025
@Prospector
Copy link
Member

ooh yay, this is very helpful!

@MagnusHJensen MagnusHJensen changed the title chore(app-frontend): type profile helper and library pages chore(app): poc for rust to ts type generation Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants