-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add use_js
macro
#4309
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
base: main
Are you sure you want to change the base?
Add use_js
macro
#4309
Conversation
Thanks for the PR! We definitely need a better FFI solution in dioxus, but I want to wait until 0.7 is shipped before we start exploring the design space. So, sadly this PR might sit for a while. We want a similar solution for:
It would be ideal to wrap all this under a single interface and build system (ie maybe through buck2/bazel ?) and then integrated with dx. We probably aren't going to accept any adhoc system until then. |
Thanks for the feedback. Do you think this might be a better fit in the sdk in the meantime or as a standalone repo/crate I own? I definitely will be using it until something comparable is implemented |
This macro does compile time validation and creates rust bindings to javascript functions. Works like a regular use import statement. See example: https://github.com/DioxusLabs/dioxus/blob/40e21cb221754665c68473890360512ac23821f5/examples/use_js_macro.rs
example statement:
example macro expansion:
closes #4302