From 0de020ac39182ea8cfda7a8b6c20d30bb6f150de Mon Sep 17 00:00:00 2001 From: Adam <24621027+adoyle0@users.noreply.github.com> Date: Sat, 7 Sep 2024 01:17:51 -0400 Subject: [PATCH] migrate to leptos 0.7 --- Cargo.lock | 731 ++++++++++++++------ client/Cargo.toml | 9 +- client/index.html | 12 +- client/public/styles.css | 2 +- client/src/components/auth.rs | 11 +- client/src/components/browser.rs | 18 +- client/src/components/chat.rs | 26 +- client/src/components/create_game.rs | 21 +- client/src/components/debug.rs | 8 +- client/src/components/game.rs | 6 +- client/src/components/game/cards.rs | 2 +- client/src/components/game/header.rs | 2 +- client/src/components/game/views/judging.rs | 51 +- client/src/components/game/views/playing.rs | 50 +- client/src/components/websocket.rs | 61 +- client/src/lib.rs | 26 +- client/src/main.rs | 8 +- client/src/pages/home.rs | 45 +- client/src/pages/not_found.rs | 2 +- 19 files changed, 695 insertions(+), 396 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b707470..24aca68 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -48,10 +48,45 @@ dependencies = [ ] [[package]] -name = "anyhow" -version = "1.0.86" +name = "android-tzdata" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "any_spawner" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9747eb01aed7603aba23f7c869d5d7e5d37aab9c3501aced42d8fdb786f1f6e3" +dependencies = [ + "futures", + "thiserror", + "wasm-bindgen-futures", +] + +[[package]] +name = "anyhow" +version = "1.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] [[package]] name = "async-compression" @@ -70,14 +105,14 @@ dependencies = [ ] [[package]] -name = "async-recursion" -version = "1.1.1" +name = "async-lock" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "proc-macro2", - "quote", - "syn", + "event-listener", + "event-listener-strategy", + "pin-project-lite", ] [[package]] @@ -254,6 +289,12 @@ version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +[[package]] +name = "by_address" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" + [[package]] name = "byteorder" version = "1.5.0" @@ -274,9 +315,9 @@ checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" [[package]] name = "cc" -version = "1.1.16" +version = "1.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9d013ecb737093c0e86b151a7b837993cf9ec6c502946cfb44bedc392421e0b" +checksum = "a93fe60e2fc87b6ba2c117f67ae14f66e3fc7d6a1e612a25adb238cc980eadb3" dependencies = [ "jobserver", "libc", @@ -290,30 +331,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "ciborium" -version = "0.2.2" +name = "chrono" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets", ] [[package]] @@ -330,6 +358,7 @@ dependencies = [ "lib", "log", "serde_json", + "thaw", "wasm-bindgen", "wasm-bindgen-test", "web-sys", @@ -341,6 +370,8 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d3ad3122b0001c7f140cf4d605ef9a9e2c24d96ab0b4fb4347b76de2425f445" dependencies = [ + "serde", + "serde_json", "thiserror", ] @@ -350,6 +381,15 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "186dce98367766de751c42c4f03970fc60fc012296e706ccbb9d5df9b6c1e271" +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "config" version = "0.14.0" @@ -386,24 +426,30 @@ dependencies = [ [[package]] name = "const_format" -version = "0.2.32" +version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" +checksum = "50c655d81ff1114fb0dcdea9225ea9f0cc712a6f8d189378e82bdf62a473a64b" dependencies = [ "const_format_proc_macros", ] [[package]] name = "const_format_proc_macros" -version = "0.2.32" +version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" +checksum = "eff1a44b93f47b1bac19a27932f5c591e43d1ba357ee4f61526c8a25603f0eb1" dependencies = [ "proc-macro2", "quote", "unicode-xid", ] +[[package]] +name = "const_str_slice_concat" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f67855af358fcb20fac58f9d714c94e2b228fe5694c1c9b4ead4a366343eda1b" + [[package]] name = "convert_case" version = "0.6.0" @@ -425,10 +471,16 @@ dependencies = [ ] [[package]] -name = "cpufeatures" -version = "0.2.13" +name = "core-foundation-sys" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -443,10 +495,10 @@ dependencies = [ ] [[package]] -name = "crunchy" -version = "0.2.2" +name = "crossbeam-utils" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-common" @@ -495,11 +547,12 @@ dependencies = [ [[package]] name = "dashmap" -version = "5.5.3" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" dependencies = [ "cfg-if", + "crossbeam-utils", "hashbrown", "lock_api", "once_cell", @@ -577,12 +630,48 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "either_of" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6e22feb4d5cacf9f2c64902a1c35ef0f2d766e42db316a98b93992bbce669cb" +dependencies = [ + "pin-project-lite", +] + [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "event-listener" +version = "5.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener", + "pin-project-lite", +] + +[[package]] +name = "fast-srgb8" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd2e7510819d6fbf51a5545c8f922716ecfb14df168a3242f7d33e0239efe6a1" + [[package]] name = "flate2" version = "1.0.33" @@ -773,14 +862,10 @@ dependencies = [ ] [[package]] -name = "half" -version = "2.4.1" +name = "guardian" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] +checksum = "493913a18c0d7bebb75127a26a432162c59edbe06f6cf712001e3e769345e8b5" [[package]] name = "hashbrown" @@ -855,6 +940,20 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "hydration_context" +version = "0.2.0-beta4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fd272e5549af207e00abfcbb622a7991f0a15ee12b86a7c3cfef41758a83f43" +dependencies = [ + "futures", + "once_cell", + "or_poisoned", + "pin-project-lite", + "serde", + "throw_error", +] + [[package]] name = "hyper" version = "1.4.1" @@ -889,6 +988,44 @@ dependencies = [ "tokio", ] +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icondata_ai" +version = "0.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bf3a9c196a6a169f790639ecc8fdd4396660b1d53b905230bf0b364776a56fc" +dependencies = [ + "icondata_core", +] + +[[package]] +name = "icondata_core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c97be924215abd5e630d84e95a47c710138a6559b4c55039f4f33aa897fa859" + [[package]] name = "ident_case" version = "1.0.1" @@ -921,17 +1058,11 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71dd52191aae121e8611f1e8dc3e324dd0dd1dee1e6dd91d10ee07a3cfb4d9d8" -[[package]] -name = "inventory" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f958d3d68f4167080a18141e10381e7634563984a537f2a49a30fd8e53ac5767" - [[package]] name = "itertools" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -968,18 +1099,33 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "leptos" -version = "0.6.14" +version = "0.7.0-beta4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15911b4e53bb6e1b033d717eadb39924418a4a288279128122e5a65c70ba3e6" +checksum = "d4eb1451927cce0a17cc3af6fdad18911eae7c827bb90a5117fa463b5b109ce4" dependencies = [ + "any_spawner", "cfg-if", + "either_of", + "futures", + "hydration_context", "leptos_config", "leptos_dom", + "leptos_hot_reload", "leptos_macro", - "leptos_reactive", "leptos_server", + "oco_ref", + "or_poisoned", + "paste", + "reactive_graph", + "rustc-hash", + "send_wrapper", + "serde", + "serde_qs", "server_fn", - "tracing", + "slotmap", + "tachys", + "thiserror", + "throw_error", "typed-builder", "typed-builder-macro", "wasm-bindgen", @@ -988,9 +1134,9 @@ dependencies = [ [[package]] name = "leptos-use" -version = "0.13.4" +version = "0.14.0-beta1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "293a4efcd9c2dfc003e6a9ae39763f0d07928a995d531354dbc80276a7e9d53c" +checksum = "cf3e115ec6c90ccd031c1f94918372af602f105e0b3b252363f0ef887d15a1aa" dependencies = [ "cfg-if", "codee", @@ -1002,6 +1148,7 @@ dependencies = [ "lazy_static", "leptos", "paste", + "send_wrapper", "thiserror", "unic-langid", "wasm-bindgen", @@ -1011,9 +1158,9 @@ dependencies = [ [[package]] name = "leptos_config" -version = "0.6.14" +version = "0.7.0-beta4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc4d78fba18c1ccab48ffc9f3d35b39821f896b0a28bdd616a846b6241036c9" +checksum = "db9b3c211cc072b742a728a71e86969034e7ab75ae68205d604df047b9ffb87e" dependencies = [ "config", "regex", @@ -1024,39 +1171,24 @@ dependencies = [ [[package]] name = "leptos_dom" -version = "0.6.14" +version = "0.7.0-beta4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ccb04d4763603bb665fa35cb9642d0bd75313117d10efda9b79243c023e69df" +checksum = "5d356526ed1c9be0804b297b0bf5d768490840d4669bd52e63f6b68d5693f7e7" dependencies = [ - "async-recursion", - "cfg-if", - "drain_filter_polyfill", - "futures", - "getrandom", - "html-escape", - "indexmap", - "itertools", "js-sys", - "leptos_reactive", - "once_cell", - "pad-adapter", - "paste", - "rustc-hash", - "serde", - "serde_json", - "server_fn", - "smallvec", - "tracing", + "or_poisoned", + "reactive_graph", + "send_wrapper", + "tachys", "wasm-bindgen", - "wasm-bindgen-futures", "web-sys", ] [[package]] name = "leptos_hot_reload" -version = "0.6.14" +version = "0.7.0-beta4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc61e5cce26761562cd3332630b3fbaddb1c4f77744e41474c7212ad279c5d9" +checksum = "121e56d24140488617d3554674708f0c00deaa287ff7ab01609fd590f32fafc8" dependencies = [ "anyhow", "camino", @@ -1072,9 +1204,9 @@ dependencies = [ [[package]] name = "leptos_macro" -version = "0.6.14" +version = "0.7.0-beta4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90eaea005cabb879c091c84cfec604687ececfd540469e5a30a60c93489a2f23" +checksum = "e5dca48e1894486f762bef0e0de24e39f1bf3a1ae84ab49915a9864856b57961" dependencies = [ "attribute-derive", "cfg-if", @@ -1089,91 +1221,77 @@ dependencies = [ "rstml", "server_fn_macro", "syn", - "tracing", "uuid", ] [[package]] name = "leptos_meta" -version = "0.6.14" +version = "0.7.0-beta4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "779bc68f8c05b15dde6557f9eb7baef4fa606a5bc450c1d6ff8787b092d0ae93" +checksum = "68327b651ff5ea1341faadbaefad9a5fa22160fe70651618aa2883422eee8f36" dependencies = [ - "cfg-if", - "indexmap", - "leptos", - "tracing", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "leptos_reactive" -version = "0.6.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef2f99f377472459b0d320b46e9a9516b0e68dee5ed8c9eeb7e8eb9fefec5d2" -dependencies = [ - "base64 0.22.1", - "cfg-if", "futures", "indexmap", - "js-sys", - "oco_ref", - "paste", - "pin-project", - "rustc-hash", - "self_cell", - "serde", - "serde-wasm-bindgen", - "serde_json", - "slotmap", - "thiserror", - "tracing", + "leptos", + "once_cell", + "or_poisoned", + "send_wrapper", "wasm-bindgen", - "wasm-bindgen-futures", "web-sys", ] [[package]] name = "leptos_router" -version = "0.6.14" +version = "0.7.0-beta4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5006e35b7c768905286dbea0d3525396cd39d961cb7b9fb664aa00b0c984ae6" +checksum = "810ba3c70df80581c534792fa8294a1ddef2896fedc0bd60b73bce141f7068bf" dependencies = [ - "cfg-if", + "any_spawner", + "either_of", + "futures", "gloo-net", - "itertools", "js-sys", - "lazy_static", "leptos", - "linear-map", + "leptos_router_macro", "once_cell", - "percent-encoding", + "or_poisoned", + "paste", + "reactive_graph", "send_wrapper", - "serde", - "serde_json", - "serde_qs 0.13.0", + "tachys", "thiserror", - "tracing", + "url", "wasm-bindgen", - "wasm-bindgen-futures", "web-sys", ] [[package]] -name = "leptos_server" -version = "0.6.14" +name = "leptos_router_macro" +version = "0.7.0-beta4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f07be202a433baa8c50050de4f9c116efccffc57208bcda7bd1bb9b8e87dca9" +checksum = "644f00cd2ab91b7086a5b8b339cffab247ed1a34e027758405c6881b63ed26f2" dependencies = [ - "inventory", - "lazy_static", - "leptos_macro", - "leptos_reactive", + "proc-macro-error", + "proc-macro2", + "quote", +] + +[[package]] +name = "leptos_server" +version = "0.7.0-beta4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bae878288fea9931571a1a9cc471161d3c595e990aa41f4f1a9aaa0cf8d0ccdd" +dependencies = [ + "any_spawner", + "base64 0.22.1", + "codee", + "futures", + "hydration_context", + "reactive_graph", "serde", + "serde_json", "server_fn", - "thiserror", - "tracing", + "tachys", ] [[package]] @@ -1197,10 +1315,6 @@ name = "linear-map" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfae20f6b19ad527b550c223fddc3077a547fc70cda94b9b566575423fd303ee" -dependencies = [ - "serde", - "serde_test", -] [[package]] name = "lock_api" @@ -1324,6 +1438,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "next_tuple" +version = "0.1.0-beta4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66dadf287063ab08b1247d1be56e9656b272b10423896fb60d49881f69b2b266" + [[package]] name = "nom" version = "7.1.3" @@ -1350,6 +1470,15 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + [[package]] name = "object" version = "0.36.4" @@ -1361,9 +1490,9 @@ dependencies = [ [[package]] name = "oco_ref" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51ebcefb2f0b9a5e0bea115532c8ae4215d1b01eff176d0f4ba4192895c2708" +checksum = "64b94982fe39a861561cf67ff17a7849f2cedadbbad960a797634032b7abb998" dependencies = [ "serde", "thiserror", @@ -1375,6 +1504,12 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "or_poisoned" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c04f5d74368e4d0dfe06c45c8627c81bd7c317d52762d118fb9b3076f6420fd" + [[package]] name = "overload" version = "0.1.1" @@ -1382,10 +1517,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] -name = "pad-adapter" -version = "0.1.1" +name = "palette" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56d80efc4b6721e8be2a10a5df21a30fa0b470f1539e53d8b4e6e75faf938b63" +checksum = "4cbf71184cc5ecc2e4e1baccdb21026c20e5fc3dcf63028a086131b3ab00b6e6" +dependencies = [ + "approx", + "fast-srgb8", + "palette_derive", + "phf", +] + +[[package]] +name = "palette_derive" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5030daf005bface118c096f510ffb781fc28f9ab6a32ab224d8631be6851d30" +dependencies = [ + "by_address", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" @@ -1428,6 +1587,48 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project" version = "1.1.5" @@ -1619,6 +1820,27 @@ dependencies = [ "getrandom", ] +[[package]] +name = "reactive_graph" +version = "0.1.0-beta4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "277ddf442e2675c536ff4088bae41c937ae4a3a821b53ecaa386c5f911252e2f" +dependencies = [ + "any_spawner", + "async-lock", + "futures", + "guardian", + "hydration_context", + "or_poisoned", + "pin-project-lite", + "rustc-hash", + "send_wrapper", + "serde", + "slotmap", + "thiserror", + "web-sys", +] + [[package]] name = "redox_syscall" version = "0.5.3" @@ -1674,10 +1896,11 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rstml" -version = "0.11.2" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe542870b8f59dd45ad11d382e5339c9a1047cde059be136a7016095bbdefa77" +checksum = "51187e564f12336ef40cd04f6f4d805d6919188001dcf1e0a021898ea0fe28ce" dependencies = [ + "derive-where", "proc-macro2", "proc-macro2-diagnostics", "quote", @@ -1694,9 +1917,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "1.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustversion" @@ -1731,12 +1954,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "self_cell" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" - [[package]] name = "send_wrapper" version = "0.6.0" @@ -1748,29 +1965,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" 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.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", @@ -1799,17 +2005,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_qs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0431a35568651e363364210c91983c1da5eb29404d9f0928b67d4ebcfa7d330c" -dependencies = [ - "percent-encoding", - "serde", - "thiserror", -] - [[package]] name = "serde_qs" version = "0.13.0" @@ -1830,15 +2025,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_test" -version = "1.0.177" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f901ee573cab6b3060453d2d5f0bae4e6d628c23c0a962ff9b5f1d7c8d4f1ed" -dependencies = [ - "serde", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -1872,12 +2058,11 @@ dependencies = [ [[package]] name = "server_fn" -version = "0.6.14" +version = "0.7.0-beta4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "024b400db1aca5bd4188714f7bbbf7a2e1962b9a12a80b2a21e937e509086963" +checksum = "6b802f1cfb1965eb17046f23401597766fc149ffd5a904ab43b55cad41899a6f" dependencies = [ "bytes", - "ciborium", "const_format", "dashmap", "futures", @@ -1885,12 +2070,14 @@ dependencies = [ "http", "js-sys", "once_cell", + "pin-project-lite", "send_wrapper", "serde", "serde_json", - "serde_qs 0.12.0", + "serde_qs", "server_fn_macro_default", "thiserror", + "throw_error", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -1901,9 +2088,9 @@ dependencies = [ [[package]] name = "server_fn_macro" -version = "0.6.14" +version = "0.7.0-beta4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf0e6f71fc924df36e87f27dfbd447f0bedd092d365db3a5396878256d9f00c" +checksum = "3c3b2d6ea0d021a2a21ce64142d589f84e4f0b08c44318f7088d9c6e5ad24b08" dependencies = [ "const_format", "convert_case", @@ -1915,9 +2102,9 @@ dependencies = [ [[package]] name = "server_fn_macro_default" -version = "0.6.14" +version = "0.7.0-beta4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556e4fd51eb9ee3e7d9fb0febec6cef486dcbc8f7f427591dfcfebee1abe1ad4" +checksum = "5c3cdf66b25e36aab3a9aca2c675c60645ebbb2ab78294f88957d2870cf72020" dependencies = [ "server_fn_macro", "syn", @@ -1958,6 +2145,12 @@ dependencies = [ "libc", ] +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "slab" version = "0.4.9" @@ -1973,7 +2166,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" dependencies = [ - "serde", "version_check", ] @@ -2034,6 +2226,100 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +[[package]] +name = "tachys" +version = "0.1.0-beta4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae9c2a49cafbeacdf5991b2ab48236d7711159ede8510c2efb6be8a28665ee7" +dependencies = [ + "any_spawner", + "const_str_slice_concat", + "drain_filter_polyfill", + "either_of", + "futures", + "html-escape", + "indexmap", + "itertools", + "js-sys", + "linear-map", + "next_tuple", + "oco_ref", + "once_cell", + "or_poisoned", + "parking_lot", + "paste", + "pin-project-lite", + "reactive_graph", + "rustc-hash", + "send_wrapper", + "slotmap", + "throw_error", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "thaw" +version = "0.4.0-beta2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a10abe67825fbd871289ec6fd5fea9cf92691d1da32707c00e7af70577306d62" +dependencies = [ + "cfg-if", + "chrono", + "icondata_ai", + "icondata_core", + "leptos", + "num-traits", + "palette", + "send_wrapper", + "slotmap", + "thaw_components", + "thaw_macro", + "thaw_utils", + "uuid", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "thaw_components" +version = "0.2.0-beta2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee0d5671ca0280910de0f69288aa20a98249c5a2a9fddccb2525d750a124f94" +dependencies = [ + "cfg-if", + "leptos", + "send_wrapper", + "thaw_utils", + "uuid", + "web-sys", +] + +[[package]] +name = "thaw_macro" +version = "0.1.0-beta2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4adff1cd2cd4da053f7d912e34e2e696b28d34561ff5929c2077c0ed7ee2834c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thaw_utils" +version = "0.1.0-beta2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a9554f2a9d236925dd1cae57d1c3e1f6390f20ff31aa9999d1b41bcc1f8d551" +dependencies = [ + "cfg-if", + "chrono", + "leptos", + "send_wrapper", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "thiserror" version = "1.0.63" @@ -2064,6 +2350,15 @@ dependencies = [ "once_cell", ] +[[package]] +name = "throw_error" +version = "0.2.0-beta4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3c1e41506da98dbdac683e12a2c87813d218f0540dab31c94343ef29a4c062" +dependencies = [ + "pin-project-lite", +] + [[package]] name = "time" version = "0.3.36" @@ -2359,18 +2654,18 @@ dependencies = [ [[package]] name = "typed-builder" -version = "0.18.2" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77739c880e00693faef3d65ea3aad725f196da38b22fdc7ea6ded6e1ce4d3add" +checksum = "a06fbd5b8de54c5f7c91f6fe4cebb949be2125d7758e630bb58b1d831dbce600" dependencies = [ "typed-builder-macro", ] [[package]] name = "typed-builder-macro" -version = "0.18.2" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f718dfaf347dcb5b983bfc87608144b0bad87970aebcbea5ce44d2a30c08e63" +checksum = "f9534daa9fd3ed0bd911d462a37f172228077e7abf18c18a5f67199d959205f8" dependencies = [ "proc-macro2", "quote", @@ -2475,6 +2770,7 @@ dependencies = [ "getrandom", "rand", "serde", + "wasm-bindgen", ] [[package]] @@ -2652,6 +2948,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-sys" version = "0.52.0" diff --git a/client/Cargo.toml b/client/Cargo.toml index d278a4a..998113e 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -7,18 +7,19 @@ authors = ["Adam Doyle "] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -leptos = { version = "0.6", features = ["csr", "nightly"] } -leptos_meta = { version = "0.6", features = ["csr", "nightly"] } -leptos_router = { version = "0.6", features = ["csr", "nightly"] } +leptos = { version = "0.7.0-beta", features = ["csr", "nightly"] } +leptos_meta = { version = "0.7.0-beta" } +leptos_router = { version = "0.7.0-beta", features = ["nightly"] } console_error_panic_hook = "0.1" console_log = "1" log = "0.4" -leptos-use = "0.13" +leptos-use = "0.14.0-beta" codee = "0.2" lib = { workspace = true } serde_json = "1.0" +thaw = { version = "0.4.0-beta2", features = ["csr", "nightly"] } [dev-dependencies] wasm-bindgen = "0.2" diff --git a/client/index.html b/client/index.html index d60299b..861a7c0 100644 --- a/client/index.html +++ b/client/index.html @@ -1,15 +1,11 @@ - - - - - - - - + + + + Cards for Humanity diff --git a/client/public/styles.css b/client/public/styles.css index 496593c..f575f39 100644 --- a/client/public/styles.css +++ b/client/public/styles.css @@ -13,7 +13,7 @@ html, body { - @apply text-neutral-200; + @apply text-neutral-200 bg-neutral-900; font-family: "Inter", sans-serif; font-optical-sizing: auto; font-weight: 400; diff --git a/client/src/components/auth.rs b/client/src/components/auth.rs index d91cf2d..3bb7f7f 100644 --- a/client/src/components/auth.rs +++ b/client/src/components/auth.rs @@ -1,6 +1,5 @@ use crate::components::websocket::WebSocketContext; -use html::Input; -use leptos::*; +use leptos::{html::Input, prelude::*}; use leptos_use::core::ConnectionReadyState; use lib::*; use serde_json::to_string; @@ -8,11 +7,11 @@ use serde_json::to_string; #[component] pub fn Auth() -> impl IntoView { let websocket = expect_context::(); - let (username, set_username) = create_signal("".to_string()); + let (username, set_username) = signal("".to_string()); let user_context = expect_context::>>(); let connected = move || websocket.ready_state.get() == ConnectionReadyState::Open; - create_effect(move |_| { + Effect::new(move |_| { user_context.with(|new_user| { if let Some(user) = new_user { set_username(user.username.to_string()); @@ -20,7 +19,7 @@ pub fn Auth() -> impl IntoView { }) }); - let username_input_ref = create_node_ref::(); + let username_input_ref = NodeRef::::new(); let send_login = move |_| { if let Some(input) = username_input_ref.get() { if input.value() != String::from("") { @@ -37,7 +36,7 @@ pub fn Auth() -> impl IntoView { }; // Clear user name on disconnect - create_effect(move |_| { + Effect::new(move |_| { if !connected() { set_username(String::from("")); } diff --git a/client/src/components/browser.rs b/client/src/components/browser.rs index f5caa3e..aca7487 100644 --- a/client/src/components/browser.rs +++ b/client/src/components/browser.rs @@ -1,5 +1,5 @@ use crate::components::websocket::WebSocketContext; -use leptos::*; +use leptos::prelude::*; use leptos_use::core::ConnectionReadyState; use lib::*; use serde_json::to_string; @@ -11,9 +11,9 @@ pub fn Browser() -> impl IntoView { let connected = move || websocket.ready_state.get() == ConnectionReadyState::Open; let tx = websocket.clone(); - let (websocket_send, set_websocket_send) = create_signal("".to_string()); + let (websocket_send, set_websocket_send) = signal("".to_string()); - create_effect(move |_| { + Effect::new(move |_| { if websocket_send() != "".to_string() { tx.send(&websocket_send()); } @@ -21,14 +21,14 @@ pub fn Browser() -> impl IntoView { // Browser stuff let game_browser_context = expect_context::>>(); - let (join_id, set_join_id) = create_signal("".to_string()); - let (delete_id, set_delete_id) = create_signal("".to_string()); + let (join_id, set_join_id) = signal("".to_string()); + let (delete_id, set_delete_id) = signal("".to_string()); - create_effect(move |_| { + Effect::new(move |_| { set_websocket_send(to_string(&GameJoinRequest { id: join_id() }).unwrap()); }); - create_effect(move |_| { + Effect::new(move |_| { set_websocket_send( to_string(&GameDeleteRequest { delete_game_id: delete_id(), @@ -74,7 +74,7 @@ pub fn Browser() -> impl IntoView {