From 79ac6ac9b069d5d617a1d30a7f55b0abf6e8f707 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Thu, 24 Aug 2023 13:29:16 -0700 Subject: [PATCH] dyesub-tool: leptos 0.4.8 -> 0.5.0-beta --- Cargo.lock | 40 +++++++++---------- dyesub-tool/Cargo.toml | 2 +- .../src/components/keyboardfromfile.rs | 9 ++--- dyesub-tool/src/components/keyboardfromweb.rs | 7 ++-- dyesub-tool/src/components/resultmessage.rs | 12 +++--- dyesub-tool/src/main.rs | 8 ++-- flake.nix | 2 +- 7 files changed, 39 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e95d879..f6b6650 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1008,9 +1008,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "leptos" -version = "0.4.8" +version = "0.5.0-beta" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d08fd7674758f996050217a8aff9e584d033c2e5c882cd3f52fb5090dc361dd" +checksum = "f6905045d7c9ed459f7761859e82960e52549bcd39f1d756640ccd4943e9a702" dependencies = [ "cfg-if", "leptos_config", @@ -1025,9 +1025,9 @@ dependencies = [ [[package]] name = "leptos_config" -version = "0.4.8" +version = "0.5.0-beta" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e5c13a1ae92b5a545cc013205288751fb2fef521de5a092067fd8429ad343e8" +checksum = "1db9792d1e5c3be1090ce96da436cffaf83febb7eb58087565283e87f2efafab" dependencies = [ "config", "regex", @@ -1038,9 +1038,9 @@ dependencies = [ [[package]] name = "leptos_dom" -version = "0.4.8" +version = "0.5.0-beta" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35994afab1dca68a46c7b40a29d40d84a2e06e1b1fa0d5c5915ade4f4f2611ee" +checksum = "bc51de6faa61807da1e3ede5f7b77fc523323fa027f0e6d50868c1a2bd82508e" dependencies = [ "async-recursion", "cfg-if", @@ -1068,9 +1068,9 @@ dependencies = [ [[package]] name = "leptos_hot_reload" -version = "0.4.8" +version = "0.5.0-beta" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a088a4dd5489941a9cc73719148f217c78f0d761a50e025739653c3b7f9d484" +checksum = "f0016ea39f34998122c125582832c88eb4e373461c75374b23f5e2f1bb5dc9e3" dependencies = [ "anyhow", "camino", @@ -1086,9 +1086,9 @@ dependencies = [ [[package]] name = "leptos_macro" -version = "0.4.8" +version = "0.5.0-beta" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bdd7a21d20ca21bb12d67d050d4b0ad9973b156bce98f499f8b1789f11959dd" +checksum = "34f5ed09f4eed18fe3641b89e94cb3c67e80b30b21231fba626059bf741e81d6" dependencies = [ "attribute-derive", "cfg-if", @@ -1109,9 +1109,9 @@ dependencies = [ [[package]] name = "leptos_reactive" -version = "0.4.8" +version = "0.5.0-beta" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5500318e457b4ab841722a5988e8db0def1ee7ac66b816ba9073c100c4984a" +checksum = "e0820be045a1fbfbef25d8254cbac41420acaca7598b4278335ed01d91d9612c" dependencies = [ "base64 0.21.2", "cfg-if", @@ -1133,9 +1133,9 @@ dependencies = [ [[package]] name = "leptos_server" -version = "0.4.8" +version = "0.5.0-beta" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28d958deee3c7ffda892a67ac4a47500aebbaf00b11d217cfe6fd494c297818" +checksum = "bb64816036984a6dc5f55336bed41a8a1376cb604e824c3b3588fd751f086df0" dependencies = [ "inventory", "lazy_static", @@ -1806,9 +1806,9 @@ dependencies = [ [[package]] name = "server_fn" -version = "0.4.8" +version = "0.5.0-beta" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644216cf54c944da2d7fc7a75337a35dc39de19130be3fd88fd58674719a1b5b" +checksum = "eb6bab18d064306dd6a2bfb37ab26f4ab343903a83c6f08b77fd8c72e6d8b853" dependencies = [ "ciborium", "const_format", @@ -1830,9 +1830,9 @@ dependencies = [ [[package]] name = "server_fn_macro" -version = "0.4.8" +version = "0.5.0-beta" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1db2cd1a054f5c6ec168982241f6cdad083591d6c68449e666c839ec421bfc54" +checksum = "3a708788598b6d7f8e764e88903ed24ae48d98dc2d7a8acaacac6f7770f46956" dependencies = [ "const_format", "proc-macro-error", @@ -1845,9 +1845,9 @@ dependencies = [ [[package]] name = "server_fn_macro_default" -version = "0.4.8" +version = "0.5.0-beta" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ee7b18c66e7a30b1855096cee24d540925825ce91193f42fae322033b109c1" +checksum = "8d419921b81515dc593fd2d2f48ca687e354ca92944379b89b221eb6be9dccd6" dependencies = [ "server_fn_macro", "syn 2.0.28", diff --git a/dyesub-tool/Cargo.toml b/dyesub-tool/Cargo.toml index a913e7d..a745529 100644 --- a/dyesub-tool/Cargo.toml +++ b/dyesub-tool/Cargo.toml @@ -8,7 +8,7 @@ svg-units = { path = "../svg-units" } class_list = "0.1.1" kle-serial = "0.2.2" lazy_static = "1.4.0" -leptos = { version = "0.4.8", features = ["csr", "nightly"] } +leptos = { version = "0.5.0-beta", features = ["csr", "nightly"] } serde_json = "1.0.105" strum = "0.25.0" strum_macros = "0.25.2" diff --git a/dyesub-tool/src/components/keyboardfromfile.rs b/dyesub-tool/src/components/keyboardfromfile.rs index 2795a40..3890c98 100644 --- a/dyesub-tool/src/components/keyboardfromfile.rs +++ b/dyesub-tool/src/components/keyboardfromfile.rs @@ -10,12 +10,11 @@ use crate::{ #[component] pub fn KeyboardFromFile( - cx: Scope, set_keyboard: WriteSignal>, ) -> impl IntoView { - let file_input = create_node_ref::(cx); - let (file, set_file) = create_signal(cx, Option::::None); - let (result_message, set_result_message) = create_signal(cx, Option::::None); + let file_input = create_node_ref::(); + let (file, set_file) = create_signal(Option::::None); + let (result_message, set_result_message) = create_signal(Option::::None); let on_submit = move || { spawn_local(async move { match read_kle_from_file(file).await { @@ -40,7 +39,7 @@ pub fn KeyboardFromFile( } }); }; - view! { cx, + view! {

"Load KLE JSON from file"

Result #[component] pub fn KeyboardFromWeb( - cx: Scope, set_keyboard: WriteSignal>, ) -> impl IntoView { - let (result_message, set_result_message) = create_signal(cx, Option::::None); - let input_element: NodeRef = create_node_ref(cx); + let (result_message, set_result_message) = create_signal(Option::::None); + let input_element: NodeRef = create_node_ref(); let on_submit = move |e: SubmitEvent| { e.prevent_default(); spawn_local(async move { @@ -44,7 +43,7 @@ pub fn KeyboardFromWeb( } }) }; - view! { cx, + view! {

"Load KLE JSON from web"

diff --git a/dyesub-tool/src/components/resultmessage.rs b/dyesub-tool/src/components/resultmessage.rs index 9f9c902..f9c2ca1 100644 --- a/dyesub-tool/src/components/resultmessage.rs +++ b/dyesub-tool/src/components/resultmessage.rs @@ -25,16 +25,16 @@ impl From> for ResultMessageData { } #[component] -pub fn ResultMessage(cx: Scope, message: ReadSignal>) -> impl IntoView { - let (open, set_open) = create_signal(cx, true); - create_effect(cx, move |_| { +pub fn ResultMessage(message: ReadSignal>) -> impl IntoView { + let (open, set_open) = create_signal(true); + create_effect(move |_| { message.track(); set_open(true); }); move || { - view! { cx, - - {move || message().map(|ResultMessageData { title, message, colorway }| view! { cx, + view! { + + {move || message().map(|ResultMessageData { title, message, colorway }| view! {
{title} diff --git a/dyesub-tool/src/main.rs b/dyesub-tool/src/main.rs index 174ee5b..ac3d5c7 100644 --- a/dyesub-tool/src/main.rs +++ b/dyesub-tool/src/main.rs @@ -11,10 +11,10 @@ use wasm_bindgen::JsCast; use components::*; #[component] -fn App(cx: Scope) -> impl IntoView { - let (_keyboard, set_keyboard) = create_signal(cx, None); +fn App() -> impl IntoView { + let (_keyboard, set_keyboard) = create_signal(None); - view! { cx, + view! { } @@ -22,5 +22,5 @@ fn App(cx: Scope) -> impl IntoView { fn main() { let root = document().query_selector("main").unwrap().unwrap(); - mount_to(root.unchecked_into(), |cx| view! { cx, }); + mount_to(root.unchecked_into(), || view! { }); } diff --git a/flake.nix b/flake.nix index 5aae05d..a8d039a 100644 --- a/flake.nix +++ b/flake.nix @@ -66,7 +66,7 @@ Updating `cargoHash`: pname = "dyesub-cli"; version = "0.1.0"; buildAndTestSubdir = "dyesub-cli"; - cargoHash = "sha256-3i+msqsUkNtVAx1eOZFftYRCDg+nVFZDhbdOIC8xvxM="; + cargoHash = "sha256-+3qFlfcIm7DtqxVeXbThxn0TELL3pBZ9etI6AivE8qA="; meta = meta // { description = "A tool for generating dye sublimation transfer sheet SVGs for Japanese thumb shift 拇指シフト keycaps."; };