chore: clippy and unused dependencies in integrations

This commit is contained in:
Greg Johnston 2024-06-05 21:26:49 -04:00
parent 0fc47e3a35
commit 56977411f2
5 changed files with 10 additions and 27 deletions

View file

@ -19,11 +19,9 @@ leptos_integration_utils = { workspace = true }
leptos_macro = { workspace = true, features = ["actix"] }
leptos_meta = { workspace = true }
leptos_router = { workspace = true, features = ["ssr"] }
reactive_graph = { workspace = true, features = ["sandboxed-arenas"] }
server_fn = { workspace = true, features = ["actix"] }
serde_json = "1"
parking_lot = "0.12.1"
regex = "1.7.0"
tracing = "0.1.37"
tokio = { version = "1", features = ["rt", "fs"] }
send_wrapper = "0.6.0"

View file

@ -16,9 +16,7 @@ use actix_web::{
};
use futures::{stream::once, Stream, StreamExt};
use http::StatusCode;
use hydration_context::SsrSharedContext;
use leptos::{
config::LeptosOptions,
context::{provide_context, use_context},
reactive_graph::{computed::ScopedFuture, owner::Owner},
IntoView, *,
@ -26,28 +24,22 @@ use leptos::{
use leptos_integration_utils::{
BoxedFnOnce, ExtendResponse, PinnedFuture, PinnedStream,
};
use leptos_meta::{ServerMetaContext, *};
use leptos_meta::ServerMetaContext;
use leptos_router::{
location::RequestUrl, PathSegment, RouteList, RouteListing, SsrMode,
StaticDataMap, StaticMode, *,
};
use parking_lot::RwLock;
use reactive_graph::owner::Sandboxed;
use regex::Regex;
use send_wrapper::SendWrapper;
use server_fn::{
redirect::REDIRECT_HEADER, request::actix::ActixRequest, ServerFnError,
};
use std::{
fmt::{Debug, Display},
future::Future,
io,
ops::{Deref, DerefMut},
pin::Pin,
sync::Arc,
};
#[cfg(debug_assertions)]
use tracing::instrument;
/// This struct lets you define headers and override the status of the Response from an Element or a Server Function
/// Typically contained inside of a ResponseOptions. Setting this is useful for cookies and custom responses.
#[derive(Debug, Clone, Default)]
@ -163,7 +155,7 @@ impl ExtendResponse for ActixResponse {
fn extend_response(&mut self, res_options: &Self::ResponseOptions) {
let mut res_options = res_options.0.write();
let mut headers = self.0.headers_mut();
let headers = self.0.headers_mut();
for (key, value) in std::mem::take(&mut res_options.headers) {
headers.append(key, value);
}
@ -175,7 +167,7 @@ impl ExtendResponse for ActixResponse {
}
fn set_default_content_type(&mut self, content_type: &str) {
let mut headers = self.0.headers_mut();
let headers = self.0.headers_mut();
if !headers.contains_key(header::CONTENT_TYPE) {
// Set the Content Type headers on all responses. This makes Firefox show the page source
// without complaining
@ -712,7 +704,7 @@ fn provide_contexts(
meta_context: &ServerMetaContext,
res_options: &ResponseOptions,
) {
let path = leptos_corrected_path(&*req);
let path = leptos_corrected_path(&req);
provide_context(RequestUrl::new(&path));
provide_context(meta_context.clone());
@ -1248,6 +1240,7 @@ where
additional_context();
};
router = if let Some(static_mode) = listing.static_mode() {
_ = static_mode;
todo!() /*
router.route(
path,

View file

@ -21,14 +21,12 @@ leptos = { workspace = true, features = ["nonce", "hydration"] }
server_fn = { workspace = true, features = ["axum-no-default"] }
leptos_macro = { workspace = true, features = ["axum"] }
leptos_meta = { workspace = true, features = ["ssr"] }
reactive_graph = { workspace = true, features = ["sandboxed-arenas"] }
leptos_router = { workspace = true, features = ["ssr"] }
leptos_integration_utils = { workspace = true }
parking_lot = "0.12"
serde_json = "1"
tokio = { version = "1", default-features = false }
tracing = "0.1"
once_cell = "1.18"
[dev-dependencies]
axum = "0.7"

View file

@ -40,20 +40,18 @@ use axum::{
request::Parts,
HeaderMap, Method, Request, Response, StatusCode,
},
response::{Html, IntoResponse},
response::IntoResponse,
routing::{delete, get, patch, post, put},
};
use futures::{stream::once, Future, Stream, StreamExt};
use hydration_context::SsrSharedContext;
use leptos::{
config::LeptosOptions,
context::{provide_context, use_context},
nonce::use_nonce,
reactive_graph::{computed::ScopedFuture, owner::Owner},
IntoView,
};
use leptos_integration_utils::{
build_response, BoxedFnOnce, ExtendResponse, PinnedFuture, PinnedStream,
BoxedFnOnce, ExtendResponse, PinnedFuture, PinnedStream,
};
use leptos_meta::ServerMetaContext;
use leptos_router::{
@ -61,7 +59,6 @@ use leptos_router::{
StaticDataMap, StaticMode,
};
use parking_lot::RwLock;
use reactive_graph::owner::Sandboxed;
use server_fn::{redirect::REDIRECT_HEADER, ServerFnError};
use std::{fmt::Debug, io, pin::Pin, sync::Arc};
// use tracing::Instrument; // TODO check tracing span -- was this used in 0.6 for a missing link?
@ -156,7 +153,7 @@ impl ExtendResponse for AxumResponse {
}
fn set_default_content_type(&mut self, content_type: &str) {
let mut headers = self.0.headers_mut();
let headers = self.0.headers_mut();
if !headers.contains_key(header::CONTENT_TYPE) {
// Set the Content Type headers on all responses. This makes Firefox show the page source
// without complaining

View file

@ -2,10 +2,7 @@ use futures::{stream::once, Stream, StreamExt};
use hydration_context::SsrSharedContext;
use leptos::{
nonce::use_nonce,
reactive_graph::{
computed::ScopedFuture,
owner::{Owner, Sandboxed},
},
reactive_graph::owner::{Owner, Sandboxed},
IntoView,
};
use leptos_meta::ServerMetaContext;