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

Typescript support #1361

Closed
mkieblesz opened this issue Oct 5, 2022 · 4 comments
Closed

Typescript support #1361

mkieblesz opened this issue Oct 5, 2022 · 4 comments

Comments

@mkieblesz
Copy link

mkieblesz commented Oct 5, 2022

Do we have any plans supporting Typescript?

┆Issue is synchronized with this Jira Task
┆friendlyId: UNIFFI-204

@mhammond
Copy link
Member

mhammond commented Oct 5, 2022

No, we don't.

@stan-irl
Copy link
Contributor

stan-irl commented Dec 6, 2022

@mhammond what would be involved to add typescript/wasm-unknown-unknown support? I've been combing through your documentation and found this PR to add ruby support - are there additional difficulties/gotchas that are obvious, or is it a fairly similar task? Will the same generated scaffolding work for wasm?

I had a look through uniffi-bindgen-gecko-js and it makes enough sense - although I don't understand where the generated cpp code is compiled and how thats related? Maybe this is only a good reference for how to put the generator in an external crate as per #1241?

@mhammond
Copy link
Member

mhammond commented Dec 6, 2022

@mhammond what would be involved to add typescript/wasm-unknown-unknown support?

Sorry, I've no idea.

I've been combing through your documentation and found this PR to add ruby support - are there additional difficulties/gotchas that are obvious, or is it a fairly similar task?

That's difficult to answer - it's similar in the same way that the effort to add uniffi-bindgen-gecko-js was similar - ie, superficially similar, but significantly different once the difference in environments was taken into account.

Will the same generated scaffolding work for wasm?

Certainly not - new scaffolding will need to be generated.

I had a look through uniffi-bindgen-gecko-js and it makes enough sense - although I don't understand where the generated cpp code is compiled and how thats related?

The generated code is compiled as part of Firefox and it's related because that's how JS code ends up calling in to Rust.

Maybe this is only a good reference for how to put the generator in an external crate as per #1241?

It's a good reference for making things work in an existing complicated system, such as an existing JS engine.

wasm might be a reasonable option for typescript in some environments, although I don't quite understand how the type models would align. Unfortunately, I don't think you will find an easy answer here - you probably need a fairly clear understanding of what any such support would generate and how it would integrate into your target environment. Once you know the what we might be able to help with keeping the how as simple as possible.

@stan-irl
Copy link
Contributor

stan-irl commented Dec 6, 2022

ok thanks for the quick response. I dont think I have the requisite time/ability to take this on currently however I might in the future

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

3 participants