From 57e36c148c00c339d7b1b3426b7ca651edfc8a1b Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sun, 30 Oct 2022 15:47:47 +0100 Subject: Frontend: Setup skeleton route support We now have the / and /search/ route boilerplate. This will allow us to switch to the /search/ route when searching. --- Cargo.lock | 41 +++++++++++++++++++++++++++++++++++++++++ frontend/Cargo.toml | 1 + frontend/index.html | 4 ++-- frontend/src/main.rs | 35 ++++++++++++++++++++++++++++++++++- 4 files changed, 78 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d2c505..86291f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -624,6 +624,7 @@ dependencies = [ "wasm-bindgen-futures", "web-sys", "yew", + "yew-router", ] [[package]] @@ -824,6 +825,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d5564e570a38b43d78bdc063374a0c3098c4f0d64005b12f9bbe87e869b6d7" dependencies = [ + "futures-channel", "gloo-events", "js-sys", "wasm-bindgen", @@ -897,6 +899,8 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" dependencies = [ + "futures-channel", + "futures-core", "js-sys", "wasm-bindgen", ] @@ -1909,6 +1913,12 @@ dependencies = [ "winreg", ] +[[package]] +name = "route-recognizer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" + [[package]] name = "rustc_version" version = "0.4.0" @@ -2767,6 +2777,37 @@ dependencies = [ "syn", ] +[[package]] +name = "yew-router" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "155804f6f3aa309f596d5c3fa14486a94e7756f1edd7634569949e401d5099f2" +dependencies = [ + "gloo 0.4.2", + "gloo-utils", + "js-sys", + "route-recognizer", + "serde", + "serde-wasm-bindgen", + "serde_urlencoded", + "thiserror", + "wasm-bindgen", + "web-sys", + "yew", + "yew-router-macro", +] + +[[package]] +name = "yew-router-macro" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39049d193b52eaad4ffc80916bf08806d142c90b5edcebd527644de438a7e19a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "zstd" version = "0.11.2+zstd.1.5.2" diff --git a/frontend/Cargo.toml b/frontend/Cargo.toml index e348451..7cc9e0b 100644 --- a/frontend/Cargo.toml +++ b/frontend/Cargo.toml @@ -7,6 +7,7 @@ edition = "2021" [dependencies] yew = "0.19" +yew-router = "0.16" gloo = "0.8.0" web-sys = "0.3.60" wasm-bindgen = "0.2.83" diff --git a/frontend/index.html b/frontend/index.html index 35e10c8..abf3b18 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -7,7 +7,7 @@ OSSE - +