Open Sheap opened 2 years ago
This point has always been somewhat misleading because Yew makes (almost) no effort in this regard. Interoperability depends on the build system and the bindings library. Nowadays Yew only supports wasm-bindgen bindings, which makes it fairly easy to write Rust bindings for JavaScript libraries. Trunk, to name the most relevant build system, then provides a convenient mechanism to load the library's js code along with the wasm file. So there is something there to back this claim up, but the documentation could be refined and an example provided.
Couple of minutes after stumbling over this ticket I stumbled over
https://github.com/hobofan/yew-react-example
which is part of the curated link list on:
https://project-awesome.org/jetli/awesome-yew
Maybe that's a starting point, but the example at the moment is still based on yew 0.16.
HtH, Martin
material-yew
is good starting point. It won't compile with master Yew but the interoperability code should be the same.
I'm working on a library that can help this, see discussion #2213
I just release yew-interop
, I'll keep the master branch up to date with yew's master branch too, everybody is welcome to try it out!
The example crate in yew-interop can also be a good learning material on how to create rust bindings for javascript API.
This is about:
Problem The 3rd point on the yew homepage states:
How to achieve this does not seem to be documented anywhere, nor any current examples which do it.
In a previous version, there was the "npm_and_rest" example, which appeared to do this with the "ccxt" library. I've tried to replicate that idea for a different library (keycloak-js), but I get errors.
So first of all - is this possible. If it is, can we document how to achieve it?
If it's not possible, we should remove this point.
Questionaire (Optional)