diff --git a/examples/errors_axum/src/landing.rs b/examples/errors_axum/src/landing.rs index 4fe0d0f768..0ed62ed03c 100644 --- a/examples/errors_axum/src/landing.rs +++ b/examples/errors_axum/src/landing.rs @@ -48,6 +48,7 @@ pub fn App() -> impl IntoView { } diff --git a/examples/timer/src/lib.rs b/examples/timer/src/lib.rs index c04241940c..48ac44b9e8 100644 --- a/examples/timer/src/lib.rs +++ b/examples/timer/src/lib.rs @@ -38,7 +38,7 @@ pub fn TimerDemo() -> impl IntoView { pub fn use_interval(interval_millis: T, f: F) where F: Fn() + Clone + 'static, - T: Into> + 'static, + T: Into> + 'static, { let interval_millis = interval_millis.into(); Effect::new(move |prev_handle: Option| { diff --git a/leptos/tests/generic_component.rs b/leptos/tests/generic_component.rs new file mode 100644 index 0000000000..966e45ce79 --- /dev/null +++ b/leptos/tests/generic_component.rs @@ -0,0 +1,25 @@ +#[test] +fn generic_component_signal_inference() { + use leptos::prelude::*; + + #[component] + pub fn SimpleCounter(#[prop(into)] step: Signal) -> impl IntoView + where + T: Send + Sync + 'static, + { + _ = step; + view! { +
+
+ } + } + + let a = RwSignal::new(1); + let (b, _) = signal(1); + + view! { + + + + }; +} diff --git a/reactive_graph/src/wrappers.rs b/reactive_graph/src/wrappers.rs index 37ac879401..c8fa4c2867 100644 --- a/reactive_graph/src/wrappers.rs +++ b/reactive_graph/src/wrappers.rs @@ -606,33 +606,6 @@ pub mod read { } } - impl From for ArcSignal { - #[track_caller] - fn from(value: T) -> Self { - ArcSignal::stored(value) - } - } - - impl From for Signal - where - T: Send + Sync + 'static, - { - #[track_caller] - fn from(value: T) -> Self { - Self::stored(value) - } - } - - impl From for Signal - where - T: 'static, - { - #[track_caller] - fn from(value: T) -> Self { - Self::stored_local(value) - } - } - impl From> for Signal where T: Send + Sync + 'static, @@ -856,36 +829,6 @@ pub mod read { } } - impl From for Signal> - where - T: Send + Sync + 'static, - { - #[track_caller] - fn from(value: T) -> Self { - Signal::stored(Some(value)) - } - } - - impl From for Signal, LocalStorage> - where - T: 'static, - { - #[track_caller] - fn from(value: T) -> Self { - Signal::stored_local(Some(value)) - } - } - - impl From> for Signal> - where - T: Clone + Send + Sync + 'static, - { - #[track_caller] - fn from(value: Signal) -> Self { - Signal::derive(move || Some(value.get())) - } - } - impl From> for Signal, LocalStorage> where T: Clone + 'static, @@ -968,7 +911,6 @@ pub mod read { } } - #[allow(deprecated)] impl From> for Signal where T: Send + Sync + 'static, @@ -982,7 +924,6 @@ pub mod read { } } - #[allow(deprecated)] impl From> for Signal where T: Send + Sync + 'static, @@ -996,7 +937,6 @@ pub mod read { } } - #[allow(deprecated)] impl From> for Signal> where T: Clone + Send + Sync + 'static, @@ -1012,7 +952,6 @@ pub mod read { } } - #[allow(deprecated)] impl From> for Signal, LocalStorage> where T: Clone + Send + Sync + 'static, @@ -1077,12 +1016,6 @@ pub mod read { /// assert_eq!(above_3(&memoized_double_count.into()), true); /// ``` #[derive(Debug, PartialEq, Eq)] - #[deprecated( - since = "0.7.0-rc1", - note = "`MaybeSignal` is deprecated in favour of `Signal` which \ - is `Copy`, now has a more efficient From implementation \ - and other benefits in 0.7." - )] pub enum MaybeSignal where T: 'static, @@ -1094,7 +1027,6 @@ pub mod read { Dynamic(Signal), } - #[allow(deprecated)] impl Clone for MaybeSignal where S: Storage, @@ -1107,10 +1039,8 @@ pub mod read { } } - #[allow(deprecated)] impl Copy for MaybeSignal where S: Storage {} - #[allow(deprecated)] impl Default for MaybeSignal where S: Storage, @@ -1120,7 +1050,6 @@ pub mod read { } } - #[allow(deprecated)] impl DefinedAt for MaybeSignal where S: Storage, @@ -1132,7 +1061,6 @@ pub mod read { } } - #[allow(deprecated)] impl Track for MaybeSignal where S: Storage + Storage>, @@ -1145,7 +1073,6 @@ pub mod read { } } - #[allow(deprecated)] impl ReadUntracked for MaybeSignal where T: Clone, @@ -1170,7 +1097,6 @@ pub mod read { } } - #[allow(deprecated)] impl MaybeSignal where T: Send + Sync, @@ -1184,7 +1110,6 @@ pub mod read { } } - #[allow(deprecated)] impl MaybeSignal { /// Wraps a derived signal, i.e., any computation that accesses one or more /// reactive signals. @@ -1193,7 +1118,6 @@ pub mod read { } } - #[allow(deprecated)] impl From for MaybeSignal where SyncStorage: Storage, @@ -1203,7 +1127,6 @@ pub mod read { } } - #[allow(deprecated)] impl FromLocal for MaybeSignal where LocalStorage: Storage, @@ -1213,7 +1136,6 @@ pub mod read { } } - #[allow(deprecated)] impl From> for MaybeSignal where T: Send + Sync, @@ -1223,14 +1145,12 @@ pub mod read { } } - #[allow(deprecated)] impl From> for MaybeSignal { fn from(value: ReadSignal) -> Self { Self::Dynamic(value.into()) } } - #[allow(deprecated)] impl From> for MaybeSignal where T: Send + Sync, @@ -1240,14 +1160,12 @@ pub mod read { } } - #[allow(deprecated)] impl From> for MaybeSignal { fn from(value: RwSignal) -> Self { Self::Dynamic(value.into()) } } - #[allow(deprecated)] impl From> for MaybeSignal where T: Send + Sync, @@ -1257,14 +1175,12 @@ pub mod read { } } - #[allow(deprecated)] impl From> for MaybeSignal { fn from(value: Memo) -> Self { Self::Dynamic(value.into()) } } - #[allow(deprecated)] impl From> for MaybeSignal where T: Send + Sync, @@ -1274,14 +1190,12 @@ pub mod read { } } - #[allow(deprecated)] impl FromLocal> for MaybeSignal { fn from_local(value: ArcReadSignal) -> Self { ReadSignal::from_local(value).into() } } - #[allow(deprecated)] impl From> for MaybeSignal where T: Send + Sync + 'static, @@ -1291,7 +1205,6 @@ pub mod read { } } - #[allow(deprecated)] impl FromLocal> for MaybeSignal where T: 'static, @@ -1301,7 +1214,6 @@ pub mod read { } } - #[allow(deprecated)] impl From> for MaybeSignal where T: Send + Sync, @@ -1311,14 +1223,12 @@ pub mod read { } } - #[allow(deprecated)] impl FromLocal> for MaybeSignal { fn from_local(value: ArcMemo) -> Self { Memo::from_local(value).into() } } - #[allow(deprecated)] impl From> for MaybeSignal where S: Storage, @@ -1328,7 +1238,6 @@ pub mod read { } } - #[allow(deprecated)] impl From<&str> for MaybeSignal where S: Storage + Storage>>, @@ -1477,7 +1386,6 @@ pub mod read { } } - #[allow(deprecated)] impl From>> for MaybeProp where T: Send + Sync, @@ -1488,7 +1396,6 @@ pub mod read { } } - #[allow(deprecated)] impl From>>> for MaybeProp where T: Send + Sync, @@ -1574,7 +1481,7 @@ pub mod read { impl From<&str> for MaybeProp { fn from(value: &str) -> Self { - Self(Some(Signal::from(Some(value.to_string())))) + Self(Some(Signal::stored(Some(value.to_string())))) } } @@ -1600,7 +1507,6 @@ pub mod read { } } - #[allow(deprecated)] impl From, LocalStorage>> for MaybeProp where @@ -1611,7 +1517,6 @@ pub mod read { } } - #[allow(deprecated)] impl From, LocalStorage>>> for MaybeProp where