Skip to content

Commit

Permalink
Update frontend dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmerlin committed Apr 20, 2023
1 parent 34f6eed commit 9a622ea
Show file tree
Hide file tree
Showing 47 changed files with 611 additions and 177 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
418 changes: 312 additions & 106 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
},
"homepage": "https://github.com/lucasmerlin/hurlurl#readme",
"devDependencies": {
"@tailwindcss/typography": "^0.5.7",
"autoprefixer": "^10.4.13",
"daisyui": "^2.38.0",
"tailwindcss": "^3.2.1"
"@tailwindcss/typography": "^0.5.9",
"autoprefixer": "^10.4.14",
"daisyui": "^2.51.5",
"tailwindcss": "^3.3.1"
},
"dependencies": {
"postcss": "^8.4.19"
"postcss": "^8.4.23"
},
"packageManager": "[email protected]"
}
2 changes: 1 addition & 1 deletion shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ default = []
[dependencies]
serde = { version = "1", features = ["serde_derive"] }
diesel = { version = "2.0.0-rc.1", optional = true }
validator = { version = "0.15", features = ["derive"] }
validator = { version = "0.16", features = ["derive"] }
10 changes: 5 additions & 5 deletions web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
yew = { version = "0.19" }
yew-router = "0.16"
yew-hooks = { version = "0.1" }
yew = { version = "0.20", features = ["csr"] }
yew-router = "0.17"
yew-hooks = { version = "0.2" }
web-sys = { version = "0.3", features = ["Clipboard", "Navigator", "Location"] }
serde-wasm-bindgen = "0.4"
serde-wasm-bindgen = "0.5"
wasm-logger = "0.2"
log = "0.4"

Expand All @@ -21,7 +21,7 @@ futures-util = "0.3"
wasm-bindgen-futures = "0.4"
wasm-bindgen = "0.2"

validator = "0.15"
validator = "0.16"
regex = "1"

shared = { path = "../shared" }
11 changes: 5 additions & 6 deletions web/src/form.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ use wasm_bindgen::prelude::wasm_bindgen;
use wasm_bindgen::{JsCast, JsValue};
use web_sys::{Event, HtmlInputElement};
use yew::{function_component, html, use_state, Callback, Html};
use yew_router::history::History;
use yew_router::hooks::use_history;
use yew_router::hooks::use_navigator;

#[derive(Serialize, Deserialize)]
struct PlausibleProps {
Expand Down Expand Up @@ -48,7 +47,7 @@ pub fn form() -> Html {

let has_error = errors.iter().find(|v| v.is_some()).is_some();

let history = use_history().unwrap();
let navigator = use_navigator().unwrap();

let add_target = {
let targets = targets.clone();
Expand Down Expand Up @@ -83,11 +82,11 @@ pub fn form() -> Html {

let create_link = {
let targets = targets.clone();
let history = history.clone();
let navigator = navigator.clone();
let permanent_redirect = permanent_redirect.clone();
Callback::from(move |_| {
let targets = targets.clone();
let history = history.clone();
let navigator = navigator.clone();
let permanent_redirect = permanent_redirect.clone();
wasm_bindgen_futures::spawn_local(async move {
let response = Request::post("/api/links")
Expand All @@ -105,7 +104,7 @@ pub fn form() -> Html {
.await
.unwrap();

history.push(Route::Link {
navigator.push(&Route::Link {
link: response.link.url,
});

Expand Down
2 changes: 1 addition & 1 deletion web/src/header.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use yew::{function_component, html, Properties};
use yew::{function_component, html, Html, Properties};

use yew_router::prelude::*;

Expand Down
2 changes: 1 addition & 1 deletion web/src/imprint.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use web_sys::window;
use yew::{function_component, html};
use yew::{function_component, html, Html};

#[function_component(Imprint)]
pub fn imprint() -> Html {
Expand Down
6 changes: 3 additions & 3 deletions web/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub enum Route {
Imprint,
}

fn switch(route: &Route) -> Html {
fn switch(route: Route) -> Html {
match route {
Route::Home => html! { <Home/> },
Route::Link { link } => html! {<Info link={link.clone()}/>},
Expand All @@ -38,13 +38,13 @@ fn switch(route: &Route) -> Html {
fn app() -> Html {
html! {
<BrowserRouter>
<Switch<Route> render={Switch::render(switch)} />
<Switch<Route> render={switch} />
</BrowserRouter>
}
}

fn main() {
wasm_logger::init(wasm_logger::Config::default());

yew::start_app::<App>();
yew::Renderer::<App>::new().render();
}
2 changes: 1 addition & 1 deletion web/src/total_stats.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::use_fetch::use_fetch;
use shared::TotalStats as Stats;
use yew::{function_component, html};
use yew::{function_component, html, Html};

#[function_component(TotalStats)]
pub fn total_stats() -> Html {
Expand Down
3 changes: 2 additions & 1 deletion web/src/use_fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ use futures_util::TryFutureExt;
use gloo_net::http::Request;
use serde::de::DeserializeOwned;
use wasm_bindgen_futures::spawn_local;
use yew::{use_effect_with_deps, use_state};
use yew::{hook, use_effect_with_deps, use_state};

#[hook]
pub fn use_fetch<T: DeserializeOwned + Clone + 'static>(url: &str) -> Option<T> {
let data = use_state::<Option<T>, _>(|| None);

Expand Down
Loading

0 comments on commit 9a622ea

Please sign in to comment.