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

Feature request: serde-wasm-bindgen compatibility. #313

Open
lucasvanmol opened this issue Apr 23, 2024 · 3 comments
Open

Feature request: serde-wasm-bindgen compatibility. #313

lucasvanmol opened this issue Apr 23, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@lucasvanmol
Copy link

Is your feature request related to a problem? Please describe.
Currently, using serde-wasm-bindgen will generate : any types. It would be nice if ts-rs could integrate with this library to be able to generate proper types.

Describe the solution you'd like
serde-wasm-bindgen generates proper TS types based on #[derive(TS)], for example when a certain feature of ts-rs is enabled.

Describe alternatives you've considered
The serde-wasm-bindgen docs mention tsify, but it seems unmaintained.

@lucasvanmol lucasvanmol added the enhancement New feature or request label Apr 23, 2024
@lucasvanmol
Copy link
Author

@escritorio-gustavo
Copy link
Collaborator

Hm, I have no experience with wasm-bindgen at all. Is there a minimal project you can point us to so we can see what ts-rs currently generates, as well as the desired output?

@escritorio-gustavo
Copy link
Collaborator

escritorio-gustavo commented Apr 23, 2024

image
From what I see, it seems like this crate works by using #[serde(with = "...")]? If that is the case, currently you'd need to use #[ts(as = "...")] and point it to a type that exports the desired TS code

See #275 and #280 for the reasoning behind this

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

No branches or pull requests

2 participants