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

Offloading .d.ts generation to typeshare #2086

Open
martinjlowm opened this issue May 5, 2024 · 0 comments
Open

Offloading .d.ts generation to typeshare #2086

martinjlowm opened this issue May 5, 2024 · 0 comments

Comments

@martinjlowm
Copy link
Contributor

martinjlowm commented May 5, 2024

There seems to be a fair bit of functional overlap with Typeshare in terms of emitting type declarations from Rust types. Typeshare scopes a broader set of target languages and currently only support structs and enums.

One benefit typeshare has is that it doesn't seem to depend on macro expansion when emitting the declaration file (in typeshare's perspective it's really just a ts file, but the interpretation is mostly the same), which skips Rust compilation. That detail is what got me to write up this issue in the first place. We have a dedicated GitHub Action workflow for type checking and we'd like to generate the declaration file without checking it into source control - in fact, it's not a single project but rather tens of projects. We would spend a significant amount of (unnecessary I'd argue) time building with napi just to generate a declaration file.

Have any considerations been made to offload the .d.ts-file generation to the typeshare project by contributing the parts that it lacks which this project has, e.g. traits, assuming they (1Password) are interested in extending their featureset? It should be noted that both projects use syn to parse Rust, so the parsing implementations look familiar.

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

No branches or pull requests

1 participant