Skip to content

Commit

Permalink
Bump the cargo-deps group across 1 directory with 52 updates (#3705)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored Aug 3, 2024
1 parent 4faa150 commit d5088ee
Show file tree
Hide file tree
Showing 36 changed files with 755 additions and 474 deletions.
995 changes: 621 additions & 374 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/async_clock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ license = "MIT OR Apache-2.0"
yew = { path = "../../packages/yew", features = ["csr"] }
chrono = "0.4"
futures = "0.3"
gloo-net = "0.4"
gloo-net = "0.5"
2 changes: 1 addition & 1 deletion examples/boids/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ getrandom = { version = "0.2", features = ["js"] }
rand = "0.8"
serde = { version = "1.0", features = ["derive"] }
yew = { path = "../../packages/yew", features = ["csr"] }
gloo = "0.10"
gloo = "0.11"

[dependencies.web-sys]
version = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion examples/counter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
license = "MIT OR Apache-2.0"

[dependencies]
gloo = "0.10"
gloo = "0.11"
js-sys = "0.3"
yew = { path = "../../packages/yew", features = ["csr"] }
wasm-bindgen = "0.2"
4 changes: 2 additions & 2 deletions examples/dyn_create_destroy_apps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ license = "MIT OR Apache-2.0"
js-sys = "0.3"
yew = { path = "../../packages/yew", features = ["csr"] }
slab = "0.4.9"
gloo = "0.10"
gloo = "0.11"
wasm-bindgen = "0.2"

[dependencies.web-sys]
version = "0.3.64"
version = "0.3.69"
features = [
"Document",
"Element",
Expand Down
4 changes: 2 additions & 2 deletions examples/file_upload/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ license = "MIT OR Apache-2.0"
[dependencies]
js-sys = "0.3"
yew = { path = "../../packages/yew", features = ["csr"] }
base64 = "0.21.5"
gloo = "0.10"
base64 = "0.22.1"
gloo = "0.11"

[dependencies.web-sys]
version = "0.3"
Expand Down
6 changes: 3 additions & 3 deletions examples/function_memory_game/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ license = "MIT OR Apache-2.0"

[dependencies]
serde = { version = "1.0", features = ["derive"] }
strum = "0.25"
strum_macros = "0.25"
gloo = "0.10"
strum = "0.26"
strum_macros = "0.26"
gloo = "0.11"
nanoid = "0.4"
rand = "0.8"
getrandom = { version = "0.2", features = ["js"] }
Expand Down
4 changes: 2 additions & 2 deletions examples/function_router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ edition = "2021"
license = "MIT OR Apache-2.0"

[dependencies]
lipsum = "0.9.0"
lipsum = "0.9.1"
log = "0.4"
rand = { version = "0.8", features = ["small_rng"] }
yew = { path = "../../packages/yew" }
yew-router = { path = "../../packages/yew-router" }
serde = { version = "1.0", features = ["derive"] }
gloo = "0.10"
gloo = "0.11"
wasm-logger = "0.2"
instant = { version = "0.1", features = ["wasm-bindgen"] }
once_cell = "1"
Expand Down
6 changes: 3 additions & 3 deletions examples/function_todomvc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ license = "MIT OR Apache-2.0"

[dependencies]
serde = { version = "1.0", features = ["derive"] }
strum = "0.25"
strum_macros = "0.25"
gloo = "0.10"
strum = "0.26"
strum_macros = "0.26"
gloo = "0.11"
yew = { path = "../../packages/yew", features = ["csr"] }

[dependencies.web-sys]
Expand Down
2 changes: 1 addition & 1 deletion examples/futures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pulldown-cmark = { version = "0.9", default-features = false }
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
yew = { path = "../../packages/yew", features = ["csr"] }
gloo = "0.10"
gloo = "0.11"

[dependencies.web-sys]
version = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion examples/game_of_life/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ log = "0.4"
rand = "0.8"
wasm-logger = "0.2"
yew = { path = "../../packages/yew", features = ["csr"] }
gloo = "0.10"
gloo = "0.11"
2 changes: 1 addition & 1 deletion examples/inner_html/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"

[dependencies]
yew = { path = "../../packages/yew", features = ["csr"] }
gloo = "0.10"
gloo = "0.11"

[dependencies.web-sys]
version = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion examples/keyed_list/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
license = "MIT OR Apache-2.0"

[dependencies]
fake = "2.9.1"
fake = "2.9.2"
getrandom = { version = "0.2", features = ["js"] }
instant = { version = "0.1", features = ["wasm-bindgen"] }
log = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion examples/mount_point/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
[dependencies]
wasm-bindgen = "0.2"
yew = { path = "../../packages/yew", features = ["csr"] }
gloo = "0.10"
gloo = "0.11"

[dependencies.web-sys]
version = "0.3"
Expand Down
4 changes: 2 additions & 2 deletions examples/password_strength/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
yew = { path = "../../packages/yew", features = ["csr"] }
zxcvbn = "2.2.2"
time = "0.3.30"
zxcvbn = "3.1.0"
time = "0.3.36"
js-sys = "0.3.64"
web-sys = { version = "0.3", features = ["Event","EventTarget","InputEvent"] }
wasm-bindgen = "0.2"
Expand Down
9 changes: 4 additions & 5 deletions examples/password_strength/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@ pub struct App {
}

impl App {
fn get_estimate(&self) -> Option<u8> {
zxcvbn(&self.password, &[])
.ok()
.map(|estimate| estimate.score())
fn get_estimate(&self) -> u8 {
let score = zxcvbn(&self.password, &[]).score();
score.into()
}

fn redout_top_row_text(&self) -> String {
if self.password.is_empty() {
return "Provide a password".to_string();
}
let estimate_text = match self.get_estimate().unwrap_or(0) {
let estimate_text = match self.get_estimate() {
0 => "That's a password?",
1 => "You can do a lot better.",
2 => "Meh",
Expand Down
2 changes: 1 addition & 1 deletion examples/portals/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"

[dependencies]
yew = { path = "../../packages/yew", features = ["csr"] }
gloo = "0.10"
gloo = "0.11"
wasm-bindgen = "0.2"

[dependencies.web-sys]
Expand Down
4 changes: 2 additions & 2 deletions examples/router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"

[dependencies]
instant = { version = "0.1", features = ["wasm-bindgen"] }
lipsum = "0.9.0"
lipsum = "0.9.1"
log = "0.4"
getrandom = { version = "0.2", features = ["js"] }
rand = { version = "0.8", features = ["small_rng"] }
Expand All @@ -15,4 +15,4 @@ yew = { path = "../../packages/yew", features = ["csr"] }
yew-router = { path = "../../packages/yew-router" }
serde = { version = "1.0", features = ["derive"] }
once_cell = "1"
gloo = "0.10"
gloo = "0.11"
10 changes: 5 additions & 5 deletions examples/simple_ssr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ required-features = ["ssr"]

[dependencies]
yew = { path = "../../packages/yew" }
reqwest = { version = "0.11.22", features = ["json"] }
serde = { version = "1.0.190", features = ["derive"] }
uuid = { version = "1.5.0", features = ["serde"] }
reqwest = { version = "0.12.5", features = ["json"] }
serde = { version = "1.0.193", features = ["derive"] }
uuid = { version = "1.10.0", features = ["serde"] }
futures = "0.3"
bytes = "1.5"
bytes = "1.7"

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen-futures = "0.4"
wasm-logger = "0.2"
log = "0.4"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1.33.0", features = ["full"] }
tokio = { version = "1.38.1", features = ["full"] }
warp = "0.3"
clap = { version = "4", features = ["derive"] }

Expand Down
9 changes: 5 additions & 4 deletions examples/ssr_router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,20 @@ yew = { path = "../../packages/yew" }
function_router = { path = "../function_router" }
log = "0.4"
futures = { version = "0.3", features = ["std"], default-features = false }
hyper-util = "0.1.6"

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen-futures = "0.4"
wasm-logger = "0.2"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1.33.0", features = ["full"] }
axum = "0.6"
tokio = { version = "1.38.1", features = ["full"] }
axum = "0.7"
tower = { version = "0.4", features = ["make"] }
tower-http = { version = "0.3", features = ["fs"] }
tower-http = { version = "0.5", features = ["fs"] }
env_logger = "0.10"
clap = { version = "4", features = ["derive"] }
hyper = { version = "0.14", features = ["server", "http1"] }
hyper = { version = "1.4", features = ["server", "http1"] }

[target.'cfg(unix)'.dependencies]
jemallocator = "0.5"
Expand Down
84 changes: 59 additions & 25 deletions examples/ssr_router/src/bin/ssr_router_server.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
use std::collections::HashMap;
use std::convert::Infallible;
use std::future::Future;
use std::net::SocketAddr;
use std::path::PathBuf;

use axum::body::StreamBody;
use axum::error_handling::HandleError;
use axum::extract::{Query, State};
use axum::body::Body;
use axum::extract::{Query, Request, State};
use axum::handler::HandlerWithoutStateExt;
use axum::http::{StatusCode, Uri};
use axum::http::Uri;
use axum::response::IntoResponse;
use axum::routing::get;
use axum::Router;
use clap::Parser;
use function_router::{ServerApp, ServerAppProps};
use futures::stream::{self, StreamExt};
use hyper::server::Server;
use tower::ServiceExt;
use hyper::body::Incoming;
use hyper_util::rt::TokioIo;
use hyper_util::server;
use tokio::net::TcpListener;
use tower::Service;
use tower_http::services::ServeDir;
use yew::platform::Runtime;

Expand Down Expand Up @@ -44,7 +47,7 @@ async fn render(
queries,
});

StreamBody::new(
Body::from_stream(
stream::once(async move { index_html_before })
.chain(renderer.render_stream())
.chain(stream::once(async move { index_html_after }))
Expand Down Expand Up @@ -75,7 +78,7 @@ where
}

#[tokio::main]
async fn main() {
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let exec = Executor::default();

env_logger::init();
Expand All @@ -92,30 +95,61 @@ async fn main() {

let index_html_after = index_html_after.to_owned();

let handle_error = |e| async move {
(
StatusCode::INTERNAL_SERVER_ERROR,
format!("error occurred: {e}"),
)
};

let app = Router::new().fallback_service(HandleError::new(
let app = Router::new().fallback_service(
ServeDir::new(opts.dir)
.append_index_html_on_directories(false)
.fallback(
get(render)
.with_state((index_html_before.clone(), index_html_after.clone()))
.into_service()
.map_err(|err| -> std::io::Error { match err {} }),
.into_service(),
),
handle_error,
));
);

let addr: SocketAddr = ([127, 0, 0, 1], 8080).into();

println!("You can view the website at: http://localhost:8080/");

Server::bind(&"127.0.0.1:8080".parse().unwrap())
.executor(exec)
.serve(app.into_make_service())
.await
.unwrap();
let listener = TcpListener::bind(addr).await?;

// Continuously accept new connections.
loop {
// In this example we discard the remote address. See `fn serve_with_connect_info` for how
// to expose that.
let (socket, _remote_addr) = listener.accept().await.unwrap();

// We don't need to call `poll_ready` because `Router` is always ready.
let tower_service = app.clone();

let exec = exec.clone();
// Spawn a task to handle the connection. That way we can handle multiple connections
// concurrently.
tokio::spawn(async move {
// Hyper has its own `AsyncRead` and `AsyncWrite` traits and doesn't use tokio.
// `TokioIo` converts between them.
let socket = TokioIo::new(socket);

// Hyper also has its own `Service` trait and doesn't use tower. We can use
// `hyper::service::service_fn` to create a hyper `Service` that calls our app through
// `tower::Service::call`.
let hyper_service = hyper::service::service_fn(move |request: Request<Incoming>| {
// We have to clone `tower_service` because hyper's `Service` uses `&self` whereas
// tower's `Service` requires `&mut self`.
//
// We don't need to call `poll_ready` since `Router` is always ready.
tower_service.clone().call(request)
});

// `server::conn::auto::Builder` supports both http1 and http2.
//
// `TokioExecutor` tells hyper to use `tokio::spawn` to spawn tasks.
if let Err(err) = server::conn::auto::Builder::new(exec)
// `serve_connection_with_upgrades` is required for websockets. If you don't need
// that you can use `serve_connection` instead.
.serve_connection_with_upgrades(socket, hyper_service)
.await
{
eprintln!("failed to serve connection: {err:#}");
}
});
}
}
2 changes: 1 addition & 1 deletion examples/suspense/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"

[dependencies]
yew = { path = "../../packages/yew", features = ["csr"] }
gloo = { version = "0.10", features = ["futures"] }
gloo = { version = "0.11", features = ["futures"] }
wasm-bindgen-futures = "0.4"
wasm-bindgen = "0.2"

Expand Down
2 changes: 1 addition & 1 deletion examples/timer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ license = "MIT OR Apache-2.0"
[dependencies]
yew = { path = "../../packages/yew", features = ["csr"] }
js-sys = "0.3"
gloo = "0.10"
gloo = "0.11"
wasm-bindgen = "0.2"
2 changes: 1 addition & 1 deletion examples/timer_functional/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ edition = "2021"
license = "MIT OR Apache-2.0"

[dependencies]
gloo = "0.10.0"
gloo = "0.11.0"
js-sys = "0.3.64"
yew = { path = "../../packages/yew", features = ["csr"] }
Loading

0 comments on commit d5088ee

Please sign in to comment.