Skip to content

Commit

Permalink
fix(cli/fragments/yew): replace deprecated code (#182)
Browse files Browse the repository at this point in the history
* replace deprecated code

Signed-off-by: xTeKc <bcd3v@pm.me>

* changefile

Signed-off-by: xTeKc <bcd3v@pm.me>
  • Loading branch information
xTekC committed Sep 19, 2022
1 parent 96ab680 commit 16b0210
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/yew-deprecated.md
@@ -0,0 +1,5 @@
---
"create-tauri-app": patch
---

Replace deprecated functions in `yew` template.
1 change: 1 addition & 0 deletions packages/cli/fragments/fragment-yew/_Cargo.toml
Expand Up @@ -5,6 +5,7 @@ edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serde-wasm-bindgen = "0.4.3"
js-sys = "0.3.59"
serde = { version = "1.0.140", features = ["derive"] }
wasm-bindgen = { version = "0.2.82", features = ["serde-serialize"] }
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/fragments/fragment-yew/src/app.rs
@@ -1,4 +1,5 @@
use serde::{Deserialize, Serialize};
use serde_wasm_bindgen::to_value;
use wasm_bindgen::prelude::*;
use wasm_bindgen_futures::spawn_local;
use yew::prelude::*;
Expand Down Expand Up @@ -38,7 +39,7 @@ pub fn app() -> Html {
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
let new_msg = invoke(
"greet",
JsValue::from_serde(&GreetArgs { name: &*name }).unwrap(),
to_value(&GreetArgs { name: &*name }).unwrap(),
)
.await;
log(&new_msg.as_string().unwrap());
Expand Down

0 comments on commit 16b0210

Please sign in to comment.