From d86c8ab6febdd1f7afc8eeb33008ace1effd4651 Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Mon, 5 May 2025 12:15:26 +0200 Subject: [PATCH] Cleaning frontend/Cargo.toml --- Cargo.lock | 150 +-------------------------------------- frontend/Cargo.toml | 27 +++---- frontend/src/calendar.rs | 2 - 3 files changed, 16 insertions(+), 163 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dbc9592..9044875 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -166,7 +166,7 @@ dependencies = [ "memchr", "serde", "serde_derive", - "winnow 0.7.9", + "winnow", ] [[package]] @@ -1178,10 +1178,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "wasm-bindgen", ] [[package]] @@ -1209,16 +1207,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d15282ece24eaf4bd338d73ef580c6714c8615155c4190c781290ee3fa0fd372" dependencies = [ "gloo-console", - "gloo-dialogs", "gloo-events", - "gloo-file", - "gloo-history", "gloo-net", - "gloo-render", "gloo-storage", "gloo-timers", "gloo-utils", - "gloo-worker", ] [[package]] @@ -1234,16 +1227,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "gloo-dialogs" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4748e10122b01435750ff530095b1217cf6546173459448b83913ebe7815df" -dependencies = [ - "wasm-bindgen", - "web-sys", -] - [[package]] name = "gloo-events" version = "0.2.0" @@ -1254,36 +1237,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "gloo-file" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97563d71863fb2824b2e974e754a81d19c4a7ec47b09ced8a0e6656b6d54bd1f" -dependencies = [ - "futures-channel", - "gloo-events", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "gloo-history" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "903f432be5ba34427eac5e16048ef65604a82061fe93789f2212afc73d8617d6" -dependencies = [ - "getrandom 0.2.16", - "gloo-events", - "gloo-utils", - "serde", - "serde-wasm-bindgen", - "serde_urlencoded", - "thiserror 1.0.69", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "gloo-net" version = "0.5.0" @@ -1305,16 +1258,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "gloo-render" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56008b6744713a8e8d98ac3dcb7d06543d5662358c9c805b4ce2167ad4649833" -dependencies = [ - "wasm-bindgen", - "web-sys", -] - [[package]] name = "gloo-storage" version = "0.3.0" @@ -1336,8 +1279,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" dependencies = [ - "futures-channel", - "futures-core", "js-sys", "wasm-bindgen", ] @@ -1355,37 +1296,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "gloo-worker" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "085f262d7604911c8150162529cefab3782e91adb20202e8658f7275d2aefe5d" -dependencies = [ - "bincode", - "futures", - "gloo-utils", - "gloo-worker-macros", - "js-sys", - "pinned", - "serde", - "thiserror 1.0.69", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "gloo-worker-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956caa58d4857bc9941749d55e4bd3000032d8212762586fa5705632967140e7" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "hashbrown" version = "0.14.5" @@ -2270,17 +2180,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pinned" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a829027bd95e54cfe13e3e258a1ae7b645960553fb82b75ff852c29688ee595b" -dependencies = [ - "futures", - "rustversion", - "thiserror 1.0.69", -] - [[package]] name = "pkcs1" version = "0.7.5" @@ -2388,16 +2287,6 @@ dependencies = [ "syn", ] -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit", -] - [[package]] name = "proc-macro2" version = "1.0.95" @@ -2806,17 +2695,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-wasm-bindgen" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b" -dependencies = [ - "js-sys", - "serde", - "wasm-bindgen", -] - [[package]] name = "serde_derive" version = "1.0.219" @@ -3550,23 +3428,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "toml_datetime" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3da5db5a963e24bc68be8b17b6fa82814bb22ee8660f192bb182771d498f09a3" - -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "tower" version = "0.5.2" @@ -4214,15 +4075,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - [[package]] name = "winnow" version = "0.7.9" diff --git a/frontend/Cargo.toml b/frontend/Cargo.toml index 7c39b7f..5f5a179 100644 --- a/frontend/Cargo.toml +++ b/frontend/Cargo.toml @@ -7,12 +7,16 @@ edition = "2024" [lib] crate-type = ["cdylib"] -[features] -default = ["console_error_panic_hook"] - [dependencies] common = { path = "../common" } +wasm-bindgen = "0.2" +wasm-bindgen-futures = "0.4" + +# The `console_error_panic_hook` crate provides better debugging of panics by +# logging them with `console.error`. +console_error_panic_hook = { version = "0.1" } + chrono = { version = "0.4", features = ["serde", "unstable-locales"] } ron = "0.10" @@ -52,14 +56,13 @@ web-sys = { version = "0.3", features = [ "CssStyleDeclaration", ] } -gloo = { version = "0.11", features = ["futures"] } +gloo = { version = "0.11", default-features = false, features = [ + "console", + "events", + "net", + "storage", + "timers", + "utils", +] } wasm-cookies = "0.2" - -# The `console_error_panic_hook` crate provides better debugging of panics by -# logging them with `console.error`. This is great for development, but requires -# all the `std::fmt` and `std::panicking` infrastructure, so isn't great for -# code size when deploying. -console_error_panic_hook = { version = "0.1", optional = true } -wasm-bindgen = "0.2" -wasm-bindgen-futures = "0.4" diff --git a/frontend/src/calendar.rs b/frontend/src/calendar.rs index aa18e4e..37ff1e3 100644 --- a/frontend/src/calendar.rs +++ b/frontend/src/calendar.rs @@ -116,8 +116,6 @@ pub fn setup( EventListener::new(&days, "click", move |event| { let target: Element = event.target().unwrap().dyn_into().unwrap(); - // gloo::console::log!(event); // TODO: Remove. - if target.class_name() == "number" && options.can_select_date { let first_day = first_grid_day( state_clone.get_displayed_date(),