mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
Update Dependencies with Breaking Changes (#3204)
* Update axum. * Update base64. * Update NPM Dependencies. * Update Translations. * Make sure all docusaurus dependencies are with the same version.
This commit is contained in:
parent
9d7fafa3ff
commit
36aaecc430
28
Cargo.lock
generated
28
Cargo.lock
generated
@ -83,9 +83,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "axum"
|
name = "axum"
|
||||||
version = "0.5.17"
|
version = "0.6.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "acee9fd5073ab6b045a275b3e709c163dd36c90685219cb21804a147b58dba43"
|
checksum = "349f8ccfd9221ee7d1f3d4b33e1f8319b3a81ed8f61f2ea40b37b859794b4491"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"axum-core",
|
"axum-core",
|
||||||
@ -101,22 +101,23 @@ dependencies = [
|
|||||||
"mime",
|
"mime",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
|
"rustversion",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
"serde_path_to_error",
|
||||||
"serde_urlencoded",
|
"serde_urlencoded",
|
||||||
"sync_wrapper",
|
"sync_wrapper",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tower",
|
"tower",
|
||||||
"tower-http",
|
|
||||||
"tower-layer",
|
"tower-layer",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "axum-core"
|
name = "axum-core"
|
||||||
version = "0.2.9"
|
version = "0.3.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "37e5939e02c56fecd5c017c37df4238c0a839fa76b7f97acdd7efb804fd181cc"
|
checksum = "b2f958c80c248b34b9a877a643811be8dbca03ca5ba827f2b63baf3a81e5fc4e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"bytes",
|
"bytes",
|
||||||
@ -124,6 +125,7 @@ dependencies = [
|
|||||||
"http",
|
"http",
|
||||||
"http-body",
|
"http-body",
|
||||||
"mime",
|
"mime",
|
||||||
|
"rustversion",
|
||||||
"tower-layer",
|
"tower-layer",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
]
|
]
|
||||||
@ -717,7 +719,7 @@ dependencies = [
|
|||||||
name = "file_upload"
|
name = "file_upload"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.13.1",
|
"base64 0.21.0",
|
||||||
"gloo",
|
"gloo",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"web-sys",
|
"web-sys",
|
||||||
@ -1653,9 +1655,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "matchit"
|
name = "matchit"
|
||||||
version = "0.5.0"
|
version = "0.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb"
|
checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memchr"
|
name = "memchr"
|
||||||
@ -2345,6 +2347,15 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde_path_to_error"
|
||||||
|
version = "0.1.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f7f05c1d5476066defcdfacce1f52fc3cae3af1d3089727100c02ae92e5abbe0"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_urlencoded"
|
name = "serde_urlencoded"
|
||||||
version = "0.7.1"
|
version = "0.7.1"
|
||||||
@ -2769,7 +2780,6 @@ dependencies = [
|
|||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
"tower",
|
|
||||||
"tower-layer",
|
"tower-layer",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
]
|
]
|
||||||
|
|||||||
@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
js-sys = "0.3"
|
js-sys = "0.3"
|
||||||
yew = { path = "../../packages/yew", features = ["csr"] }
|
yew = { path = "../../packages/yew", features = ["csr"] }
|
||||||
base64 = "0.13.0"
|
base64 = "0.21.0"
|
||||||
gloo = "0.8"
|
gloo = "0.8"
|
||||||
|
|
||||||
[dependencies.web-sys]
|
[dependencies.web-sys]
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
extern crate base64;
|
extern crate base64;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use base64::encode;
|
use base64::engine::general_purpose::STANDARD;
|
||||||
|
use base64::Engine;
|
||||||
use gloo::file::callbacks::FileReader;
|
use gloo::file::callbacks::FileReader;
|
||||||
use gloo::file::File;
|
use gloo::file::File;
|
||||||
use web_sys::{DragEvent, Event, FileList, HtmlInputElement};
|
use web_sys::{DragEvent, Event, FileList, HtmlInputElement};
|
||||||
@ -118,10 +119,10 @@ impl App {
|
|||||||
<p class="preview-name">{ format!("{}", file.name) }</p>
|
<p class="preview-name">{ format!("{}", file.name) }</p>
|
||||||
<div class="preview-media">
|
<div class="preview-media">
|
||||||
if file.file_type.contains("image") {
|
if file.file_type.contains("image") {
|
||||||
<img src={format!("data:{};base64,{}", file.file_type, encode(&file.data))} />
|
<img src={format!("data:{};base64,{}", file.file_type, STANDARD.encode(&file.data))} />
|
||||||
} else if file.file_type.contains("video") {
|
} else if file.file_type.contains("video") {
|
||||||
<video controls={true}>
|
<video controls={true}>
|
||||||
<source src={format!("data:{};base64,{}", file.file_type, encode(&file.data))} type={file.file_type.clone()}/>
|
<source src={format!("data:{};base64,{}", file.file_type, STANDARD.encode(&file.data))} type={file.file_type.clone()}/>
|
||||||
</video>
|
</video>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -25,7 +25,7 @@ wasm-logger = "0.2"
|
|||||||
|
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
tokio = { version = "1.26.0", features = ["full"] }
|
tokio = { version = "1.26.0", features = ["full"] }
|
||||||
axum = "0.5"
|
axum = "0.6"
|
||||||
tower = { version = "0.4", features = ["make"] }
|
tower = { version = "0.4", features = ["make"] }
|
||||||
tower-http = { version = "0.3", features = ["fs"] }
|
tower-http = { version = "0.3", features = ["fs"] }
|
||||||
env_logger = "0.10"
|
env_logger = "0.10"
|
||||||
|
|||||||
@ -3,14 +3,14 @@ use std::convert::Infallible;
|
|||||||
use std::future::Future;
|
use std::future::Future;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use axum::body::{Body, StreamBody};
|
use axum::body::StreamBody;
|
||||||
use axum::error_handling::HandleError;
|
use axum::error_handling::HandleError;
|
||||||
use axum::extract::Query;
|
use axum::extract::{Query, State};
|
||||||
use axum::handler::Handler;
|
use axum::handler::HandlerWithoutStateExt;
|
||||||
use axum::http::{Request, StatusCode};
|
use axum::http::{StatusCode, Uri};
|
||||||
use axum::response::IntoResponse;
|
use axum::response::IntoResponse;
|
||||||
use axum::routing::get;
|
use axum::routing::get;
|
||||||
use axum::{Extension, Router};
|
use axum::Router;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use function_router::{ServerApp, ServerAppProps};
|
use function_router::{ServerApp, ServerAppProps};
|
||||||
use futures::stream::{self, StreamExt};
|
use futures::stream::{self, StreamExt};
|
||||||
@ -32,11 +32,11 @@ struct Opt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn render(
|
async fn render(
|
||||||
Extension((index_html_before, index_html_after)): Extension<(String, String)>,
|
url: Uri,
|
||||||
url: Request<Body>,
|
|
||||||
Query(queries): Query<HashMap<String, String>>,
|
Query(queries): Query<HashMap<String, String>>,
|
||||||
|
State((index_html_before, index_html_after)): State<(String, String)>,
|
||||||
) -> impl IntoResponse {
|
) -> impl IntoResponse {
|
||||||
let url = url.uri().to_string();
|
let url = url.to_string();
|
||||||
|
|
||||||
let renderer = yew::ServerRenderer::<ServerApp>::with_props(move || ServerAppProps {
|
let renderer = yew::ServerRenderer::<ServerApp>::with_props(move || ServerAppProps {
|
||||||
url: url.into(),
|
url: url.into(),
|
||||||
@ -98,22 +98,17 @@ async fn main() {
|
|||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
let app = Router::new()
|
let app = Router::new().fallback_service(HandleError::new(
|
||||||
.route("/api/test", get(|| async move { "Hello World" }))
|
ServeDir::new(opts.dir)
|
||||||
.fallback(HandleError::new(
|
.append_index_html_on_directories(false)
|
||||||
ServeDir::new(opts.dir)
|
.fallback(
|
||||||
.append_index_html_on_directories(false)
|
get(render)
|
||||||
.fallback(
|
.with_state((index_html_before.clone(), index_html_after.clone()))
|
||||||
render
|
.into_service()
|
||||||
.layer(Extension((
|
.map_err(|err| -> std::io::Error { match err {} }),
|
||||||
index_html_before.clone(),
|
),
|
||||||
index_html_after.clone(),
|
handle_error,
|
||||||
)))
|
));
|
||||||
.into_service()
|
|
||||||
.map_err(|err| -> std::io::Error { match err {} }),
|
|
||||||
),
|
|
||||||
handle_error,
|
|
||||||
));
|
|
||||||
|
|
||||||
println!("You can view the website at: http://localhost:8080/");
|
println!("You can view the website at: http://localhost:8080/");
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
},
|
},
|
||||||
"theme.ErrorPageContent.tryAgain": {
|
"theme.ErrorPageContent.tryAgain": {
|
||||||
"message": "Try again",
|
"message": "Try again",
|
||||||
"description": "The label of the button to try again when the page crashed"
|
"description": "The label of the button to try again rendering when the React error boundary captures an error"
|
||||||
},
|
},
|
||||||
"theme.NotFound.title": {
|
"theme.NotFound.title": {
|
||||||
"message": "ページが見つかりません",
|
"message": "ページが見つかりません",
|
||||||
|
|||||||
@ -30,5 +30,9 @@
|
|||||||
"item.label.Playground": {
|
"item.label.Playground": {
|
||||||
"message": "Playground",
|
"message": "Playground",
|
||||||
"description": "Navbar item with label Playground"
|
"description": "Navbar item with label Playground"
|
||||||
|
},
|
||||||
|
"logo.alt": {
|
||||||
|
"message": "Yew Logo",
|
||||||
|
"description": "The alt text of navbar logo"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
},
|
},
|
||||||
"theme.ErrorPageContent.tryAgain": {
|
"theme.ErrorPageContent.tryAgain": {
|
||||||
"message": "Try again",
|
"message": "Try again",
|
||||||
"description": "The label of the button to try again when the page crashed"
|
"description": "The label of the button to try again rendering when the React error boundary captures an error"
|
||||||
},
|
},
|
||||||
"theme.NotFound.title": {
|
"theme.NotFound.title": {
|
||||||
"message": "页面找不到啦",
|
"message": "页面找不到啦",
|
||||||
|
|||||||
@ -30,5 +30,9 @@
|
|||||||
"item.label.Playground": {
|
"item.label.Playground": {
|
||||||
"message": "Playground",
|
"message": "Playground",
|
||||||
"description": "Navbar item with label Playground"
|
"description": "Navbar item with label Playground"
|
||||||
|
},
|
||||||
|
"logo.alt": {
|
||||||
|
"message": "Yew Logo",
|
||||||
|
"description": "The alt text of navbar logo"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
},
|
},
|
||||||
"theme.ErrorPageContent.tryAgain": {
|
"theme.ErrorPageContent.tryAgain": {
|
||||||
"message": "Try again",
|
"message": "Try again",
|
||||||
"description": "The label of the button to try again when the page crashed"
|
"description": "The label of the button to try again rendering when the React error boundary captures an error"
|
||||||
},
|
},
|
||||||
"theme.NotFound.title": {
|
"theme.NotFound.title": {
|
||||||
"message": "Page Not Found",
|
"message": "Page Not Found",
|
||||||
|
|||||||
@ -30,5 +30,9 @@
|
|||||||
"item.label.Playground": {
|
"item.label.Playground": {
|
||||||
"message": "Playground",
|
"message": "Playground",
|
||||||
"description": "Navbar item with label Playground"
|
"description": "Navbar item with label Playground"
|
||||||
|
},
|
||||||
|
"logo.alt": {
|
||||||
|
"message": "Yew Logo",
|
||||||
|
"description": "The alt text of navbar logo"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
13246
website/package-lock.json
generated
13246
website/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -17,12 +17,12 @@
|
|||||||
"fmt:write": "prettier --write ."
|
"fmt:write": "prettier --write ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@docusaurus/core": "~2.3.0",
|
"@docusaurus/core": "~2.4.0",
|
||||||
"@docusaurus/plugin-client-redirects": "~2.4.0",
|
"@docusaurus/plugin-client-redirects": "~2.4.0",
|
||||||
"@docusaurus/plugin-content-docs": "~2.4.0",
|
"@docusaurus/plugin-content-docs": "~2.4.0",
|
||||||
"@docusaurus/plugin-content-pages": "~2.4.0",
|
"@docusaurus/plugin-content-pages": "~2.4.0",
|
||||||
"@docusaurus/plugin-google-analytics": "~2.3.0",
|
"@docusaurus/plugin-google-analytics": "~2.4.0",
|
||||||
"@docusaurus/theme-classic": "^2.3.1",
|
"@docusaurus/theme-classic": "~2.4.0",
|
||||||
"@easyops-cn/docusaurus-search-local": "^0.32.0",
|
"@easyops-cn/docusaurus-search-local": "^0.32.0",
|
||||||
"@mdx-js/react": "^1.6.22",
|
"@mdx-js/react": "^1.6.22",
|
||||||
"@svgr/webpack": "^6.5.1",
|
"@svgr/webpack": "^6.5.1",
|
||||||
@ -47,7 +47,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@docusaurus/module-type-aliases": "^2.3.0",
|
"@docusaurus/module-type-aliases": "~2.4.0",
|
||||||
"@tsconfig/docusaurus": "^1.0.7",
|
"@tsconfig/docusaurus": "^1.0.7",
|
||||||
"@types/react": "^17.0.43",
|
"@types/react": "^17.0.43",
|
||||||
"@types/react-helmet": "^6.1.6",
|
"@types/react-helmet": "^6.1.6",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user