mirror of
https://github.com/adoyle0/thaw.git
synced 2025-02-02 08:34:15 -05:00
feat: update dependencies and update leptos to v0.6.0-rc1
This commit is contained in:
parent
24df111b4b
commit
9817acdcfa
8 changed files with 72 additions and 72 deletions
|
@ -7,9 +7,9 @@ edition = "2021"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
leptos = { version = "0.5.7" }
|
leptos = { version = "0.6.0-rc1" }
|
||||||
leptos_meta = { version = "0.5.7" }
|
leptos_meta = { version = "0.6.0-rc1" }
|
||||||
leptos_router = { version = "0.5.7" }
|
leptos_router = { version = "0.6.0-rc1" }
|
||||||
leptos_devtools = { version = "0.0.1", optional = true}
|
leptos_devtools = { version = "0.0.1", optional = true}
|
||||||
thaw = { path = "../thaw", default-features = false }
|
thaw = { path = "../thaw", default-features = false }
|
||||||
demo_markdown = { path = "../demo_markdown" }
|
demo_markdown = { path = "../demo_markdown" }
|
||||||
|
|
|
@ -10,8 +10,8 @@ edition = "2021"
|
||||||
proc-macro = true
|
proc-macro = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
quote = "1.0.33"
|
quote = "1.0.35"
|
||||||
comrak = "0.20.0"
|
comrak = "0.21.0"
|
||||||
proc-macro2 = "1.0.71"
|
proc-macro2 = "1.0.78"
|
||||||
syn = "2.0.43"
|
syn = "2.0.48"
|
||||||
syntect = "5.1.0"
|
syntect = "5.1.0"
|
|
@ -145,5 +145,6 @@ fn iter_nodes<'a>(node: &'a AstNode<'a>, demos: &mut Vec<String>) -> TokenStream
|
||||||
NodeValue::Link(_) => quote!("Link todo!!!"),
|
NodeValue::Link(_) => quote!("Link todo!!!"),
|
||||||
NodeValue::Image(_) => quote!("Image todo!!!"),
|
NodeValue::Image(_) => quote!("Image todo!!!"),
|
||||||
NodeValue::FootnoteReference(_) => quote!("FootnoteReference todo!!!"),
|
NodeValue::FootnoteReference(_) => quote!("FootnoteReference todo!!!"),
|
||||||
|
NodeValue::MultilineBlockQuote(_) => quote!("FootnoteReference todo!!!"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,22 +7,22 @@ edition = "2021"
|
||||||
crate-type = ["cdylib", "rlib"]
|
crate-type = ["cdylib", "rlib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
axum = { version = "0.6.4", optional = true }
|
axum = { version = "0.7.4", optional = true }
|
||||||
console_error_panic_hook = "0.1"
|
console_error_panic_hook = "0.1"
|
||||||
console_log = "1"
|
console_log = "1"
|
||||||
cfg-if = "1"
|
cfg-if = "1"
|
||||||
leptos = { version = "0.5" }
|
leptos = { version = "0.6.0-rc1" }
|
||||||
leptos_axum = { version = "0.5", optional = true }
|
leptos_axum = { version = "0.6.0-rc1", optional = true }
|
||||||
leptos_meta = { version = "0.5" }
|
leptos_meta = { version = "0.6.0-rc1" }
|
||||||
leptos_router = { version = "0.5" }
|
leptos_router = { version = "0.6.0-rc1" }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
simple_logger = "4"
|
simple_logger = "4"
|
||||||
tokio = { version = "1.25.0", optional = true }
|
tokio = { version = "1.35.1", features = ["rt-multi-thread"], optional = true }
|
||||||
tower = { version = "0.4.13", optional = true }
|
tower = { version = "0.4.13", optional = true }
|
||||||
tower-http = { version = "0.4", features = ["fs"], optional = true }
|
tower-http = { version = "0.5.1", features = ["fs"], optional = true }
|
||||||
wasm-bindgen = "=0.2.89"
|
wasm-bindgen = "=0.2.90"
|
||||||
thiserror = "1.0.38"
|
thiserror = "1.0.56"
|
||||||
tracing = { version = "0.1.37", optional = true }
|
tracing = { version = "0.1.40", optional = true }
|
||||||
http = "0.2.8"
|
http = "0.2.8"
|
||||||
demo = { path = "../../demo", default-features = false }
|
demo = { path = "../../demo", default-features = false }
|
||||||
|
|
||||||
|
|
|
@ -1,40 +1,42 @@
|
||||||
use cfg_if::cfg_if;
|
use axum::{
|
||||||
|
body::Body,
|
||||||
|
extract::State,
|
||||||
|
http::{Request, Response, StatusCode, Uri},
|
||||||
|
response::{IntoResponse, Response as AxumResponse},
|
||||||
|
};
|
||||||
|
use demo::App;
|
||||||
|
use leptos::{view, LeptosOptions};
|
||||||
|
use tower::ServiceExt;
|
||||||
|
use tower_http::services::ServeDir;
|
||||||
|
|
||||||
cfg_if! { if #[cfg(feature = "ssr")] {
|
pub async fn file_and_error_handler(
|
||||||
use axum::{
|
uri: Uri,
|
||||||
body::{boxed, Body, BoxBody},
|
State(options): State<LeptosOptions>,
|
||||||
extract::State,
|
req: Request<Body>,
|
||||||
response::IntoResponse,
|
) -> AxumResponse {
|
||||||
http::{Request, Response, StatusCode, Uri},
|
let root = options.site_root.clone();
|
||||||
};
|
let res = get_static_file(uri.clone(), &root).await.unwrap();
|
||||||
use axum::response::Response as AxumResponse;
|
|
||||||
use tower::ServiceExt;
|
|
||||||
use tower_http::services::ServeDir;
|
|
||||||
use leptos::*;
|
|
||||||
use demo::App;
|
|
||||||
|
|
||||||
pub async fn file_and_error_handler(uri: Uri, State(options): State<LeptosOptions>, req: Request<Body>) -> AxumResponse {
|
if res.status() == StatusCode::OK {
|
||||||
let root = options.site_root.clone();
|
res.into_response()
|
||||||
let res = get_static_file(uri.clone(), &root).await.unwrap();
|
} else {
|
||||||
|
let handler = leptos_axum::render_app_to_stream(options.to_owned(), move || view! {<App/>});
|
||||||
if res.status() == StatusCode::OK {
|
handler(req).await.into_response()
|
||||||
res.into_response()
|
|
||||||
} else {
|
|
||||||
let handler = leptos_axum::render_app_to_stream(options.to_owned(), move || view!{<App/>});
|
|
||||||
handler(req).await.into_response()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async fn get_static_file(uri: Uri, root: &str) -> Result<Response<BoxBody>, (StatusCode, String)> {
|
async fn get_static_file(uri: Uri, root: &str) -> Result<Response<Body>, (StatusCode, String)> {
|
||||||
let req = Request::builder().uri(uri.clone()).body(Body::empty()).unwrap();
|
let req = Request::builder()
|
||||||
// `ServeDir` implements `tower::Service` so we can call it with `tower::ServiceExt::oneshot`
|
.uri(uri.clone())
|
||||||
// This path is relative to the cargo root
|
.body(Body::empty())
|
||||||
match ServeDir::new(root).oneshot(req).await {
|
.unwrap();
|
||||||
Ok(res) => Ok(res.map(boxed)),
|
// `ServeDir` implements `tower::Service` so we can call it with `tower::ServiceExt::oneshot`
|
||||||
Err(err) => Err((
|
// This path is relative to the cargo root
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
match ServeDir::new(root).oneshot(req).await {
|
||||||
format!("Something went wrong: {err}"),
|
Ok(res) => Ok(res.into_response()),
|
||||||
)),
|
Err(err) => Err((
|
||||||
}
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
|
format!("Something went wrong: {err}"),
|
||||||
|
)),
|
||||||
}
|
}
|
||||||
}}
|
}
|
||||||
|
|
|
@ -1,17 +1,14 @@
|
||||||
use cfg_if::cfg_if;
|
#[cfg(feature = "ssr")]
|
||||||
pub mod fileserv;
|
pub mod fileserv;
|
||||||
|
|
||||||
cfg_if! { if #[cfg(feature = "hydrate")] {
|
#[cfg(feature = "hydrate")]
|
||||||
use leptos::*;
|
#[wasm_bindgen::prelude::wasm_bindgen]
|
||||||
use wasm_bindgen::prelude::wasm_bindgen;
|
pub fn hydrate() {
|
||||||
use demo::App;
|
use demo::App;
|
||||||
|
|
||||||
#[wasm_bindgen]
|
// initializes logging using the `log` crate
|
||||||
pub fn hydrate() {
|
_ = console_log::init_with_level(log::Level::Debug);
|
||||||
// initializes logging using the `log` crate
|
console_error_panic_hook::set_once();
|
||||||
_ = console_log::init_with_level(log::Level::Debug);
|
|
||||||
console_error_panic_hook::set_once();
|
|
||||||
|
|
||||||
leptos::mount_to_body(App);
|
leptos::mount_to_body(App);
|
||||||
}
|
}
|
||||||
}}
|
|
||||||
|
|
|
@ -29,8 +29,8 @@ async fn main() {
|
||||||
// run our app with hyper
|
// run our app with hyper
|
||||||
// `axum::Server` is a re-export of `hyper::Server`
|
// `axum::Server` is a re-export of `hyper::Server`
|
||||||
log::info!("listening on http://{}", &addr);
|
log::info!("listening on http://{}", &addr);
|
||||||
axum::Server::bind(&addr)
|
let listener = tokio::net::TcpListener::bind(&addr).await.unwrap();
|
||||||
.serve(app.into_make_service())
|
axum::serve(listener, app.into_make_service())
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,19 +13,19 @@ license = "MIT"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
leptos = { version = "0.5.7" }
|
leptos = { version = "0.6.0-rc1" }
|
||||||
leptos_meta = { version = "0.5.7", optional = true }
|
leptos_meta = { version = "0.6.0-rc1", optional = true }
|
||||||
web-sys = { version = "0.3.63", features = [
|
web-sys = { version = "0.3.67", features = [
|
||||||
"DomRect",
|
"DomRect",
|
||||||
"File",
|
"File",
|
||||||
"FileList",
|
"FileList",
|
||||||
"DataTransfer",
|
"DataTransfer",
|
||||||
] }
|
] }
|
||||||
wasm-bindgen = "0.2.89"
|
wasm-bindgen = "0.2.90"
|
||||||
icondata = "0.3.0"
|
icondata = "0.3.0"
|
||||||
uuid = { version = "1.5.0", features = ["v4"] }
|
uuid = { version = "1.7.0", features = ["v4"] }
|
||||||
cfg-if = "1.0.0"
|
cfg-if = "1.0.0"
|
||||||
chrono = "0.4.31"
|
chrono = "0.4.33"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["csr"]
|
default = ["csr"]
|
||||||
|
|
Loading…
Add table
Reference in a new issue