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

NAPI (node.js/deno/bun) Support #392

Open
RichiCoder1 opened this issue Mar 11, 2023 · 3 comments
Open

NAPI (node.js/deno/bun) Support #392

RichiCoder1 opened this issue Mar 11, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@RichiCoder1
Copy link

What problem does this solve or what need does it fill?

I proposed using Taffy for https://github.com/vadimdemedes/ink, which currently uses Yoga much like React Native today. However, when making the suggestion (vadimdemedes/ink#555) I realized that Taffy doesn't currently have NAPI bindings or prebuilt binaries that'd make it easy to pull in.

What solution would you like?

Utilize https://napi.rs/ to ship NodeJS/Deno/Bun bindings

What alternative(s) have you considered?

N/A

@RichiCoder1 RichiCoder1 added the enhancement New feature or request label Mar 11, 2023
@nicoburns nicoburns changed the title NAPI Support NAPI (node.js) Support Mar 11, 2023
@nicoburns nicoburns changed the title NAPI (node.js) Support NAPI (node.js/deno/bun) Support Mar 11, 2023
@nicoburns
Copy link
Collaborator

Hi! We definitely want to add this at some point. However, there is quite a long list of FFI bindings we want to support, and it is hard to justify development on any particular ones until we have a user actively wanting to use them (such as if for example the developers of Ink requested them themselves).

Most likely we'll do C and WASM bindings first, as they are the mostly widely applicable and can also be built on for bindings to other languages. I believe a WASM version would be usable from Node (and indeed that's what the latest versions a Yoga's binding use), albeit with the overhead from WASM.

Finally, you may wish to be aware of https://github.com/DioxusLabs/dioxus/tree/master/packages/tui, which is a port of Ink to Rust which uses Taffy for layout.

@RichiCoder1
Copy link
Author

RichiCoder1 commented Mar 11, 2023

That's entirely fair! I'm happy with this just being a placeholder issue for 👍🏼 and we'll see if Ink or other NPM ecosystem creators express interest in this.

Finally, you may wish to be aware of DioxusLabs/dioxus@master/packages/tui, which is a port of Ink to Rust which uses Taffy for layout.

Sadly while I do think Rink is awesome, the primary use case here is where JS is the primary or only toolchain 😅.

@nicoburns
Copy link
Collaborator

Oh, just remembered that there's also https://github.com/load1n9/gelatin. They're not first-party bindings, but I think they work.

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