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

refactor: replace deprecated code #182

Merged
merged 2 commits into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/yew-deprecated.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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