feat: update leptos to v0.7.0-beta7 (#272)
Some checks failed
Deploy demo / deploy (push) Has been cancelled

This commit is contained in:
luoxiaozero 2024-09-29 14:09:30 +08:00 committed by GitHub
parent b831008e09
commit e18bbff216
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 36 additions and 40 deletions

View file

@ -16,6 +16,6 @@ thaw_components = { version = "0.2.0-beta3", path = "./thaw_components" }
thaw_macro = { version = "0.1.0-beta3", path = "./thaw_macro" }
thaw_utils = { version = "0.1.0-beta3", path = "./thaw_utils" }
leptos = { version = "0.7.0-beta5" }
leptos_meta = { version = "0.7.0-beta5" }
leptos_router = { version = "0.7.0-beta5" }
leptos = { version = "0.7.0-beta7" }
leptos_meta = { version = "0.7.0-beta7" }
leptos_router = { version = "0.7.0-beta7" }

View file

@ -95,11 +95,11 @@ pub(crate) struct NavItemOption {
}
trait VecIntoView {
fn into_view(self) -> Vec<AnyView<Dom>>;
fn into_view(self) -> Vec<AnyView>;
}
impl VecIntoView for Vec<NavItemOption> {
fn into_view(self) -> Vec<AnyView<Dom>> {
fn into_view(self) -> Vec<AnyView> {
let mut iter = self.into_iter().peekable();
let mut views = vec![];
while let Some(item) = iter.next() {

View file

@ -9,10 +9,10 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
axum = { version = "0.7", optional = true }
console_error_panic_hook = "0.1"
leptos = { version = "0.7.0-beta5", features = ["experimental-islands"] }
leptos_axum = { version = "0.7.0-beta5", optional = true }
leptos_meta = { version = "0.7.0-beta5" }
leptos_router = { version = "0.7.0-beta5" }
leptos = { version = "0.7.0-beta7", features = ["experimental-islands"] }
leptos_axum = { version = "0.7.0-beta7", optional = true }
leptos_meta = { version = "0.7.0-beta7" }
leptos_router = { version = "0.7.0-beta7" }
tokio = { version = "1", features = ["rt-multi-thread"], optional = true }
tower = { version = "0.4", optional = true }
tower-http = { version = "0.5", features = ["fs"], optional = true }

View file

@ -9,10 +9,10 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
axum = { version = "0.7.5", optional = true }
console_error_panic_hook = "0.1"
leptos = { version = "0.7.0-beta5" }
leptos_axum = { version = "0.7.0-beta5", optional = true }
leptos_meta = { version = "0.7.0-beta5" }
leptos_router = { version = "0.7.0-beta5" }
leptos = { version = "0.7.0-beta7" }
leptos_axum = { version = "0.7.0-beta7", optional = true }
leptos_meta = { version = "0.7.0-beta7" }
leptos_router = { version = "0.7.0-beta7" }
tokio = { version = "1", features = ["rt-multi-thread"], optional = true }
tower = { version = "0.5.0", optional = true }
tower-http = { version = "0.5", features = ["fs"], optional = true }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View file

@ -1,11 +1,10 @@
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 24 24"
>
<circle cx="12" cy="12" r="12" fill="#0078ff" />
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 325 325">
<path
d="M1116.79,462.73l-2-7.25-.65-2-1.43-4.14-2.12-5.4-2.88-6.28-2.27-4.34-4.3-7-1.82-2.63-1.36-1.84-5.72-6.83-6.77-6.62-1.27-1.09-1.54-1.28-7.45-5.46-5.41-3.34-4.53-2.45L1055,390.15l-.65-.25-.25-.1-.56-.21-11-3.58-4.11-1.08-6.65-1.5-2-.39-7-1.21-6.54-.89-2.91-.34-6.22-.59-5.24-.4-5.51-.31-4.92-.21-4.57-.15-6.67-.14-4.43-.05-4.35,0-7,0h-8.67l-7,0-4.35,0-4.44.05-6.67.14-4.57.15-4.92.21-5.51.31-5.24.4-6.21.59-2.91.34-6.55.89-7,1.21-2,.39-6.66,1.5-4.1,1.08-11,3.58-.55.21-.25.1-.66.25-10.23,4.57-4.53,2.45L845,400.51,837.51,406,836,407.25l-1.27,1.09L827.93,415l-5.72,6.83-1.35,1.84L819,426.26l-4.29,7-2.28,4.34-2.88,6.28-2.12,5.4L806,453.44l-.65,2-2,7.25L802.13,468l-.27,1.24-.38,1.9-1.71,10.3-.47,3.62-.51,4.62-.54,6-.36,5.17-.3,5.83-.16,4-.16,6-.11,6.26,0,3.27,0,6.29v15.82l0,6.29,0,3.28.11,6.25.16,6,.16,4,.3,5.83.36,5.16.54,6,.51,4.62.47,3.62,1.71,10.31.38,1.89.27,1.25,1.23,5.28,2,7.25.65,2,1.43,4.15,2.12,5.4,2.88,6.28,2.28,4.33,4.29,7,1.83,2.62,1.35,1.84,5.72,6.83,6.77,6.62,1.27,1.09,1.54,1.28,7.45,5.47,5.42,3.33,4.53,2.45,10.23,4.57.66.26.25.09.55.21,11,3.58,4.1,1.08,6.66,1.5,2,.39,7,1.21,6.55.9,2.91.33,6.21.6,5.24.39,5.51.32,4.92.21,4.57.14,6.67.14,4.44,0,4.35,0,7,0h8.67l7,0,4.35,0,4.43,0,6.67-.14,4.57-.14,4.92-.21,5.51-.32,5.24-.39,6.22-.6,2.91-.33,6.54-.9,7-1.21,2-.39,6.65-1.5,4.11-1.08,11-3.58.56-.21.25-.09.65-.26,10.24-4.57,4.53-2.45,5.41-3.33,7.45-5.47,1.54-1.28,1.27-1.09,6.77-6.62,5.72-6.83,1.36-1.84,1.82-2.62,4.3-7,2.27-4.33,2.88-6.28,2.12-5.4,1.43-4.15.65-2,2-7.25,1.24-5.28.26-1.25.38-1.89,1.71-10.31.47-3.62.51-4.62.55-6,.35-5.16.31-5.83.15-4,.17-6,.1-6.25,0-3.28,0-6.29V532.55l0-6.29,0-3.27-.1-6.26-.17-6-.15-4-.31-5.83-.35-5.17-.55-6-.51-4.62-.47-3.62-1.71-10.3-.38-1.9L1118,468Z"
transform="translate(-797.09 -378.7)"/>
<path
d="M21 11h-3.17l2.54-2.54a.996.996 0 0 0 0-1.41c-.39-.39-1.03-.39-1.42 0L15 11h-2V9l3.95-3.95c.39-.39.39-1.03 0-1.42a.996.996 0 0 0-1.41 0L13 6.17V3c0-.55-.45-1-1-1s-1 .45-1 1v3.17L8.46 3.63a.996.996 0 0 0-1.41 0c-.39.39-.39 1.03 0 1.42L11 9v2H9L5.05 7.05c-.39-.39-1.03-.39-1.42 0a.996.996 0 0 0 0 1.41L6.17 11H3c-.55 0-1 .45-1 1s.45 1 1 1h3.17l-2.54 2.54a.996.996 0 0 0 0 1.41c.39.39 1.03.39 1.42 0L9 13h2v2l-3.95 3.95c-.39.39-.39 1.03 0 1.42c.39.39 1.02.39 1.41 0L11 17.83V21c0 .55.45 1 1 1s1-.45 1-1v-3.17l2.54 2.54c.39.39 1.02.39 1.41 0c.39-.39.39-1.03 0-1.42L13 15v-2h2l3.95 3.95c.39.39 1.03.39 1.42 0a.996.996 0 0 0 0-1.41L17.83 13H21c.55 0 1-.45 1-1s-.45-1-1-1z"
fill="#fff">
fill="#fff" transform="translate(8 8) scale(13)">
</path>
</svg>

Before

Width:  |  Height:  |  Size: 897 B

After

Width:  |  Height:  |  Size: 2.6 KiB

View file

@ -226,10 +226,10 @@ pub(crate) fn now_date() -> NaiveDate {
}
#[derive(Clone)]
pub struct CalendarChildrenFn(Arc<dyn Fn(&NaiveDate) -> AnyView<Dom> + Send + Sync>);
pub struct CalendarChildrenFn(Arc<dyn Fn(&NaiveDate) -> AnyView + Send + Sync>);
impl Deref for CalendarChildrenFn {
type Target = Arc<dyn Fn(&NaiveDate) -> AnyView<Dom> + Send + Sync>;
type Target = Arc<dyn Fn(&NaiveDate) -> AnyView + Send + Sync>;
fn deref(&self) -> &Self::Target {
&self.0
@ -239,7 +239,7 @@ impl Deref for CalendarChildrenFn {
impl<F, C> From<F> for CalendarChildrenFn
where
F: Fn(&NaiveDate) -> C + Send + Sync + 'static,
C: RenderHtml<Dom> + Send + 'static,
C: RenderHtml + Send + 'static,
{
fn from(f: F) -> Self {
Self(Arc::new(move |date| f(date).into_any()))

View file

@ -1,12 +1,10 @@
mod loading_bar_provider;
use std::sync::Arc;
pub use loading_bar_provider::*;
use tachys::renderer::DomRenderer;
use crate::ConfigInjection;
use leptos::{html, prelude::*};
use std::sync::Arc;
use thaw_utils::{mount_style, ComponentRef};
#[derive(Clone)]

View file

@ -80,7 +80,9 @@ pub fn Toaster(
};
list.remove(index);
});
let is_show = toast_show_list.try_update_value(|map| { map.remove(&id) } ).flatten();
let is_show = toast_show_list
.try_update_value(|map| map.remove(&id))
.flatten();
if let Some(is_show) = is_show {
is_show.dispose();
}

View file

@ -6,7 +6,7 @@ use leptos::{
use leptos::{
prelude::{Oco, RenderEffect, RwSignal},
reactive_graph::traits::{Update, With, WithUntracked},
tachys::renderer::DomRenderer,
tachys::renderer::{types, Rndr},
};
use std::collections::HashSet;
#[cfg(not(feature = "ssr"))]
@ -163,12 +163,9 @@ impl ClassList {
}
}
impl<R> leptos::tachys::html::class::IntoClass<R> for ClassList
where
R: DomRenderer,
{
impl leptos::tachys::html::class::IntoClass for ClassList {
type AsyncOutput = Self;
type State = RenderEffect<(R::Element, String)>;
type State = RenderEffect<(types::Element, String)>;
type Cloneable = Self;
type CloneableOwned = Self;
@ -193,7 +190,7 @@ where
self.write_class_string(class);
}
fn hydrate<const FROM_SERVER: bool>(self, el: &R::Element) -> Self::State {
fn hydrate<const FROM_SERVER: bool>(self, el: &types::Element) -> Self::State {
let el = el.to_owned();
RenderEffect::new(move |prev| {
let mut class = String::new();
@ -202,7 +199,7 @@ where
if let Some(state) = prev {
let (el, prev_class) = state;
if class != prev_class {
R::set_attribute(&el, "class", &class);
Rndr::set_attribute(&el, "class", &class);
(el, class)
} else {
(el, prev_class)
@ -210,7 +207,7 @@ where
} else {
if !class.is_empty() {
if !FROM_SERVER {
R::set_attribute(&el, "class", &class);
Rndr::set_attribute(&el, "class", &class);
}
}
(el.clone(), class)
@ -218,7 +215,7 @@ where
})
}
fn build(self, el: &R::Element) -> Self::State {
fn build(self, el: &types::Element) -> Self::State {
let el = el.to_owned();
RenderEffect::new(move |prev| {
let mut class = String::new();
@ -226,14 +223,14 @@ where
if let Some(state) = prev {
let (el, prev_class) = state;
if class != prev_class {
R::set_attribute(&el, "class", &class);
Rndr::set_attribute(&el, "class", &class);
(el, class)
} else {
(el, prev_class)
}
} else {
if !class.is_empty() {
R::set_attribute(&el, "class", &class);
Rndr::set_attribute(&el, "class", &class);
}
(el.clone(), class)
}
@ -249,7 +246,7 @@ where
self.write_class_string(&mut class);
let (el, prev_class) = state;
if class != *prev_class {
R::set_attribute(&el, "class", &class);
Rndr::set_attribute(&el, "class", &class);
(el, class)
} else {
(el, prev_class)