-
Notifications
You must be signed in to change notification settings - Fork 111
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
Wasm bindings #241
Comments
I've been looking into this, and it looks like wasm support might not be too difficult:
|
Awesome! I'd be happy to review that. |
I found napi-rs used by resvg-js and it's pretty good binding with node too. |
napi-rs does indeed look like a good option for node bindings (which yoga also has), however I don't think that would give us wasm support. So I would consider that a separate feature request. |
For what its worth, I have ported the C bindings from stretch to taffy. Pretty minor API changes overall, which makes me think porting the old WASM bindings would be very straightforward. |
@xavierzwirtz Yeah, when I looked into this recently, it looked like C and WASM would be both be quite straightforward. But stretch's Swift and especially it's Kotlin bindings looked quite a bit more involved. Perhaps we ought to create a new meta issue for language bindings. It would be good to determine which languages have the most interest, and perhaps come up with a strategy that can allow us to re-add the bindings while keeping the maintenance burden manageable. I suspect focussing on C and WASM first might be a good strategy. WASM effectively gives us Node support too (albeit with a performance penalty), and I suspect a good C API would make it easier for other people to write their own bindings for other languages, which generally support C FFI. |
Some WASM bindings for Taffy based on the Stretch bindings are now available here https://github.com/load1n9/gelatin |
What problem does this solve or what need does it fill?
It seems that the wasm bindings don't exist anymore, so it's difficult to use this library from JS-land. I made a JS terminal library many years ago using Yoga and I'd like to rebuild it, evaluating new tech options.
What solution would you like?
Ideally a basic wasm API would be great. If not possible, it'd be useful to at least annotate FlexboxLayout & its enums with the wasm-bindgen attributes (cf second part of this answer here: https://stackoverflow.com/a/65336309), as there's a lot of them and duplicating them would be very painful.
What alternative(s) have you considered?
Keep using Yoga, but I'm interested to follow a bit the development here.
The text was updated successfully, but these errors were encountered: