diff --git a/leptos/src/lib.rs b/leptos/src/lib.rs index f3efb46f2..1f7612ad0 100644 --- a/leptos/src/lib.rs +++ b/leptos/src/lib.rs @@ -166,12 +166,10 @@ pub mod prelude { // In the future, maybe we should remove this blanket export // However, it is definitely useful relative to looking up every struct etc. mod export_types { - #[cfg(feature = "nonce")] - pub use crate::nonce::*; pub use crate::{ callback::*, children::*, component::*, control_flow::*, error::*, - form::*, hydration::*, into_view::*, mount::*, suspense::*, - text_prop::*, + form::*, hydration::*, into_view::*, mount::*, nonce::*, + suspense::*, text_prop::*, }; pub use leptos_config::*; pub use leptos_dom::helpers::*; @@ -241,7 +239,6 @@ pub mod portal; pub mod hydration; /// Utilities for exporting nonces to be used for a Content Security Policy. -#[cfg(feature = "nonce")] pub mod nonce; /// Components to load asynchronous data. diff --git a/leptos/src/nonce.rs b/leptos/src/nonce.rs index 253321cbb..ac761d6a5 100644 --- a/leptos/src/nonce.rs +++ b/leptos/src/nonce.rs @@ -1,10 +1,4 @@ -use crate::context::{provide_context, use_context}; -use base64::{ - alphabet, - engine::{self, general_purpose}, - Engine, -}; -use rand::{rng, RngCore}; +use crate::context::use_context; use std::{fmt::Display, ops::Deref, sync::Arc}; use tachys::html::attribute::AttributeValue; @@ -127,6 +121,9 @@ impl AttributeValue for Nonce { /// server response. This can be added to inline `