Upgrade to axum 0.7, drop 3rd party adapters
This commit is contained in:
53 files changed
+643
-3260
No files matched your search
@@ -21,7 +21,7 @@ log = "0.4.14"
|
||||
fern = { version = "0.6.0", features = ["colored"] }
|
||||
serde = { version = "1.0.136", features = ["derive"] }
|
||||
serde_json = "1.0.79"
|
||||
toml = "0.8.8"
|
||||
toml = {workspace = true}
|
||||
fs_extra = "1.2.0"
|
||||
cargo_toml = "0.18.0"
|
||||
futures-util = { workspace = true }
|
||||
@@ -32,17 +32,17 @@ tokio = { version = "1.16.1", features = ["fs", "sync", "rt", "macros"] }
|
||||
atty = "0.2.14"
|
||||
chrono = "0.4.19"
|
||||
anyhow = "1"
|
||||
hyper = "0.14.17"
|
||||
hyper-rustls = "0.23.2"
|
||||
hyper = {workspace = true}
|
||||
hyper-rustls = {workspace = true}
|
||||
indicatif = "0.17.5"
|
||||
subprocess = "0.2.9"
|
||||
rayon = "1.8.0"
|
||||
|
||||
axum = { version = "0.5.1", features = ["ws", "headers"] }
|
||||
axum = { workspace = true, features = ["ws"] }
|
||||
axum-server = { version = "0.5.1", features = ["tls-rustls"] }
|
||||
tower-http = { version = "0.2.2", features = ["full"] }
|
||||
headers = "0.3.7"
|
||||
tower-http = { workspace = true, features = ["full"] }
|
||||
|
||||
headers = "0.3.7"
|
||||
walkdir = "2"
|
||||
|
||||
# tools download
|
||||
@@ -56,7 +56,7 @@ reqwest = { version = "0.11", features = [
|
||||
flate2 = "1.0.22"
|
||||
tar = "0.4.38"
|
||||
zip = "0.6.2"
|
||||
tower = "0.4.12"
|
||||
tower = { workspace = true }
|
||||
lazy_static = "1.4.0"
|
||||
|
||||
# plugin packages
|
||||
|
||||
@@ -5,9 +5,6 @@ use anyhow::Context;
|
||||
use clap::Parser;
|
||||
use dioxus_cli::*;
|
||||
|
||||
#[cfg(feature = "plugin")]
|
||||
use dioxus_cli::plugin::PluginManager;
|
||||
|
||||
use Commands::*;
|
||||
|
||||
fn get_bin(bin: Option<String>) -> Result<PathBuf> {
|
||||
@@ -92,6 +89,9 @@ async fn main() -> anyhow::Result<()> {
|
||||
DioxusConfig::default()
|
||||
});
|
||||
|
||||
#[cfg(feature = "plugin")]
|
||||
use dioxus_cli::plugin::PluginManager;
|
||||
|
||||
#[cfg(feature = "plugin")]
|
||||
PluginManager::init(_dioxus_config.plugin)
|
||||
.context(error_wrapper("Plugin system initialization failed"))?;
|
||||
|
||||
@@ -8,8 +8,8 @@ use crate::{
|
||||
BuildResult, Result,
|
||||
};
|
||||
use axum::{
|
||||
body::{Full, HttpBody},
|
||||
extract::{ws::Message, Extension, TypedHeader, WebSocketUpgrade},
|
||||
body::{Body, HttpBody},
|
||||
extract::{ws::Message, Extension, WebSocketUpgrade},
|
||||
http::{
|
||||
self,
|
||||
header::{HeaderName, HeaderValue},
|
||||
@@ -287,20 +287,18 @@ async fn setup_router(
|
||||
let mut response = if file_service_config.dioxus_config.web.watcher.index_on_404
|
||||
&& response.status() == StatusCode::NOT_FOUND
|
||||
{
|
||||
let body = Full::from(
|
||||
let body = Body::from(
|
||||
// TODO: Cache/memoize this.
|
||||
std::fs::read_to_string(file_service_config.out_dir().join("index.html"))
|
||||
.ok()
|
||||
.unwrap(),
|
||||
)
|
||||
.map_err(|err| match err {})
|
||||
.boxed();
|
||||
);
|
||||
Response::builder()
|
||||
.status(StatusCode::OK)
|
||||
.body(body)
|
||||
.unwrap()
|
||||
} else {
|
||||
response.map(|body| body.boxed())
|
||||
response.map(|body| body.into())
|
||||
};
|
||||
let headers = response.headers_mut();
|
||||
headers.insert(
|
||||
|
||||
@@ -5,6 +5,8 @@ use anyhow::Context;
|
||||
use axum::{http::StatusCode, routing::any, Router};
|
||||
use hyper::{Request, Response, Uri};
|
||||
|
||||
use axum::body::Body as MyBody;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
struct ProxyClient {
|
||||
inner: hyper::Client<hyper_rustls::HttpsConnector<hyper::client::HttpConnector>>,
|
||||
@@ -24,10 +26,7 @@ impl ProxyClient {
|
||||
}
|
||||
}
|
||||
|
||||
async fn send(
|
||||
&self,
|
||||
mut req: Request<hyper::body::Body>,
|
||||
) -> Result<Response<hyper::body::Body>> {
|
||||
async fn send(&self, mut req: Request<MyBody>) -> Result<Response<MyBody>> {
|
||||
let mut uri_parts = req.uri().clone().into_parts();
|
||||
uri_parts.authority = self.url.authority().cloned();
|
||||
uri_parts.scheme = self.url.scheme().cloned();
|
||||
|
||||
Reference in new issue
Block a user