JonasKruckenberg / tauri-sys

Bindings to the Tauri API for projects using wasm-bindgen
Apache License 2.0
84 stars 21 forks source link

Update to latest tauri and latest sycamore (0.8.0 - 0.9.0-beta.2) #32

Closed zakpatterson closed 7 months ago

zakpatterson commented 7 months ago

I applied the recommended migrations from Sycamore, but there is a strange error in the first-second commits, where a build error claims that a trait is not in scope even though it is imported a few lines previous. The error is present at commit b6ed12e:

       Compiling sycamore v0.9.0-beta.2 (http://github.com/sycamore-rs/sycamore#16acf8eb)
    error[E0599]: no method named `unchecked_ref` found for reference `&JsValue` in the current scope
      --> ~/.cargo/git/checkouts/sycamore-c13e2e94d3a8109f/16acf8e/packages/sycamore/src/motion.rs:43:69

       |
    43 |                         f.borrow().as_ref().unwrap_throw().as_ref().unchecked_ref(),
       |                                                                     ^^^^^^^^^^^^^
       |
       = help: items from traits can only be used if the trait is in scope
    help: the following trait is implemented but not in scope; perhaps add a `use` for it:
       |
    3  + use wasm_bindgen::JsCast;

In sycamore, JsCast is imported in wasm_bindgen::prelude::*.

Modifying the relevant file in sycamore as suggested does fix the problem here, even though building sycamore causes an error due to duplicate imports.

The third commit references a fork of sycamore with the extra import.

I've asked on the sycamore discord about it

zakpatterson commented 7 months ago

I'm not good enough at wasm yet to figure this out. I'll close but anyone is welcome to pick this up, I'd love to see the result.