From f3557970a7dca4e089e1660c47947a8d22ae1aa5 Mon Sep 17 00:00:00 2001 From: Greg Johnston Date: Sun, 29 Jun 2025 17:10:05 -0400 Subject: [PATCH] fix: uses `EXISTS` to mark things that don't exist in the DOM --- leptos/src/into_view.rs | 1 + meta/src/lib.rs | 1 + meta/src/title.rs | 1 + tachys/src/view/tuples.rs | 4 ++-- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/leptos/src/into_view.rs b/leptos/src/into_view.rs index 7ae54aeae..7206140d5 100644 --- a/leptos/src/into_view.rs +++ b/leptos/src/into_view.rs @@ -90,6 +90,7 @@ impl RenderHtml for View { type Owned = View; const MIN_LENGTH: usize = ::MIN_LENGTH; + const EXISTS: bool = ::EXISTS; async fn resolve(self) -> Self::AsyncOutput { self.inner.resolve().await diff --git a/meta/src/lib.rs b/meta/src/lib.rs index b4962ee3d..2b0e5fa03 100644 --- a/meta/src/lib.rs +++ b/meta/src/lib.rs @@ -413,6 +413,7 @@ where type Owned = RegisteredMetaTag; const MIN_LENGTH: usize = 0; + const EXISTS: bool = false; fn dry_resolve(&mut self) { self.el.dry_resolve() diff --git a/meta/src/title.rs b/meta/src/title.rs index 305e58b9c..a81589a85 100644 --- a/meta/src/title.rs +++ b/meta/src/title.rs @@ -322,6 +322,7 @@ impl RenderHtml for TitleView { type Owned = Self; const MIN_LENGTH: usize = 0; + const EXISTS: bool = false; fn dry_resolve(&mut self) {} diff --git a/tachys/src/view/tuples.rs b/tachys/src/view/tuples.rs index 2513d086a..3b8535f67 100644 --- a/tachys/src/view/tuples.rs +++ b/tachys/src/view/tuples.rs @@ -134,6 +134,7 @@ where type Owned = (A::Owned,); const MIN_LENGTH: usize = A::MIN_LENGTH; + const EXISTS: bool = A::EXISTS; fn html_len(&self) -> usize { self.0.html_len() @@ -239,7 +240,6 @@ macro_rules! impl_view_for_tuples { { type State = ($first::State, $($ty::State,)*); - fn build(self) -> Self::State { #[allow(non_snake_case)] let ($first, $($ty,)*) = self; @@ -267,7 +267,7 @@ macro_rules! impl_view_for_tuples { { type AsyncOutput = ($first::AsyncOutput, $($ty::AsyncOutput,)*); type Owned = ($first::Owned, $($ty::Owned,)*); - + const EXISTS: bool = $first::EXISTS || $($ty::EXISTS || )* false; const MIN_LENGTH: usize = $first::MIN_LENGTH $(+ $ty::MIN_LENGTH)*; #[inline(always)]