Compare commits

...

2 Commits

Author SHA1 Message Date
Greg Johnston
0375df5431 remove WrappedView add_any_attr impls 2024-09-23 11:26:04 -04:00
Greg Johnston
6206073c5e does this fix the linker error? 2024-09-23 10:29:30 -04:00
3 changed files with 14 additions and 20 deletions

View File

@@ -506,7 +506,7 @@ mod stable {
ssr::StreamBuilder,
view::{
add_attr::AddAnyAttr, Mountable, Position, PositionState, Render,
RenderHtml, WrappedView,
RenderHtml,
},
};
use reactive_graph::{
@@ -551,8 +551,7 @@ mod stable {
V::State: 'static,
R: Renderer + 'static,
{
// WrappedView is necessary here for compiler reasons I don't completely understand
type Output<SomeNewAttr: Attribute<R>> = WrappedView<$sig<V>>;
type Output<SomeNewAttr: Attribute<R>> = $sig<V>;
fn add_any_attr<NewAttr: Attribute<R>>(
self,
@@ -561,7 +560,7 @@ mod stable {
where
Self::Output<NewAttr>: RenderHtml<R>,
{
WrappedView::new(self)
todo!()
}
}
@@ -727,8 +726,7 @@ mod stable {
V::State: 'static,
R: Renderer + 'static,
{
type Output<SomeNewAttr: Attribute<R>> =
WrappedView<$sig<V, S>>;
type Output<SomeNewAttr: Attribute<R>> = $sig<V, S>;
fn add_any_attr<NewAttr: Attribute<R>>(
self,
@@ -737,7 +735,7 @@ mod stable {
where
Self::Output<NewAttr>: RenderHtml<R>,
{
WrappedView::new(self)
todo!()
}
}

View File

@@ -2,13 +2,10 @@
use super::MarkBranch;
use super::{
add_attr::AddAnyAttr, Mountable, Position, PositionState, Render,
RenderHtml, WrappedView,
RenderHtml,
};
use crate::{
html::attribute::{
any_attribute::{AnyAttribute, IntoAnyAttribute},
Attribute,
},
html::attribute::{any_attribute::AnyAttribute, Attribute},
hydration::Cursor,
renderer::Renderer,
ssr::StreamBuilder,
@@ -54,6 +51,7 @@ where
fn(Box<dyn Any>, &mut StreamBuilder, &mut Position, bool, bool),
build: fn(Box<dyn Any>) -> AnyViewState<R>,
rebuild: fn(TypeId, Box<dyn Any>, &mut AnyViewState<R>),
#[allow(unused)]
add_any_attr: fn(Box<dyn Any>, AnyAttribute<R>) -> AnyView<R>,
#[cfg(feature = "ssr")]
#[allow(clippy::type_complexity)]
@@ -347,18 +345,16 @@ impl<R> AddAnyAttr<R> for AnyView<R>
where
R: Renderer + 'static,
{
type Output<SomeNewAttr: Attribute<R>> = WrappedView<AnyView<R>>;
type Output<SomeNewAttr: Attribute<R>> = AnyView<R>;
fn add_any_attr<NewAttr: Attribute<R>>(
self,
attr: NewAttr,
_attr: NewAttr,
) -> Self::Output<NewAttr>
where
Self::Output<NewAttr>: RenderHtml<R>,
{
let attr = attr.into_cloneable_owned().into_any_attr();
let new = (self.add_any_attr)(self.value, attr).into_any();
WrappedView::new(new)
todo!()
}
}

View File

@@ -1,6 +1,6 @@
use super::{
add_attr::AddAnyAttr, Mountable, Position, PositionState, Render,
RenderHtml, ToTemplate, WrappedView,
RenderHtml, ToTemplate,
};
use crate::{
html::attribute::{Attribute, AttributeKey, AttributeValue, NextAttribute},
@@ -216,7 +216,7 @@ impl<R, const V: &'static str> AddAnyAttr<R> for Static<V>
where
R: Renderer,
{
type Output<SomeNewAttr: Attribute<R>> = WrappedView<Static<V>>;
type Output<SomeNewAttr: Attribute<R>> = Static<V>;
fn add_any_attr<NewAttr: Attribute<R>>(
self,
@@ -225,7 +225,7 @@ where
where
Self::Output<NewAttr>: RenderHtml<R>,
{
WrappedView::new(self)
todo!()
}
}