feat: Update leptos to v0.5.3 (#27)

This commit is contained in:
luoxiaozero 2023-11-28 15:49:02 +08:00 committed by GitHub
parent 64b4e64835
commit 227a3211ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 14 additions and 50 deletions

View file

@ -13,8 +13,8 @@ license = "MIT"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
leptos = { version = "0.5.2" }
leptos_meta = { version = "0.5.2", optional = true }
leptos = { version = "0.5.3" }
leptos_meta = { version = "0.5.3", optional = true }
web-sys = { version = "0.3.63", features = [
"DomRect",
"File",

View file

@ -7,9 +7,9 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
leptos = { version = "0.5.2" }
leptos_meta = { version = "0.5.2" }
leptos_router = { version = "0.5.2" }
leptos = { version = "0.5.3" }
leptos_meta = { version = "0.5.3" }
leptos_router = { version = "0.5.3" }
leptos_devtools = "0.0.1"
thaw = { path = "../", default-features = false }
icondata = { version = "0.1.0", features = [

View file

@ -43,7 +43,9 @@ pub fn Demo(demo_code: DemoCode, children: Children) -> impl IntoView {
for node in frag.nodes {
match node {
View::Text(text) => html.push_str(&text.content),
_ => leptos::logging::warn!("Only text nodes are supported as children of <DemoCode />."),
_ => {
leptos::logging::warn!("Only text nodes are supported as children of <DemoCode />.")
}
}
}

View file

@ -1,11 +1,7 @@
mod breadcrumb_item;
mod theme;
use crate::{
use_theme,
utils::{mount_style, Provider},
Theme,
};
use crate::{use_theme, utils::mount_style, Theme};
pub use breadcrumb_item::BreadcrumbItem;
use leptos::*;
pub use theme::BreadcrumbTheme;

View file

@ -1,4 +1,3 @@
use crate::utils::Provider;
use leptos::*;
use std::collections::HashSet;

View file

@ -1,6 +1,5 @@
mod grid_item;
use crate::utils::Provider;
pub use grid_item::*;
use leptos::*;

View file

@ -1,8 +1,5 @@
use super::{LoadingBar, LoadingBarRef};
use crate::{
components::Teleport,
utils::{ComponentRef, Provider},
};
use crate::{components::Teleport, utils::ComponentRef};
use leptos::*;
#[component]

View file

@ -2,7 +2,6 @@ mod menu_group;
mod menu_item;
mod theme;
use crate::utils::Provider;
use leptos::*;
pub use menu_group::MenuGroup;
pub use menu_item::*;

View file

@ -1,10 +1,7 @@
use std::time::Duration;
use super::{message_environment::MessageEnvironment, MessageVariant};
use crate::{
components::Teleport,
utils::{mount_style, Provider},
};
use crate::{components::Teleport, utils::mount_style};
use leptos::*;
use uuid::Uuid;

View file

@ -1,11 +1,7 @@
mod tabbar_item;
mod theme;
use crate::{
use_theme,
utils::{mount_style, Provider},
Theme,
};
use crate::{use_theme, utils::mount_style, Theme};
use leptos::*;
pub use tabbar_item::*;
pub use theme::TabbarTheme;

View file

@ -1,10 +1,6 @@
mod tab;
use crate::{
theme::use_theme,
utils::{mount_style, Provider},
Theme,
};
use crate::{theme::use_theme, utils::mount_style, Theme};
use leptos::*;
pub use tab::*;

View file

@ -3,7 +3,6 @@ mod common;
use self::common::CommonTheme;
use crate::{
mobile::{NavBarTheme, TabbarTheme},
utils::Provider,
AlertTheme, AutoCompleteTheme, AvatarTheme, BreadcrumbTheme, ButtonTheme, ColorPickerTheme,
InputTheme, MenuTheme, MessageTheme, ProgressTheme, SelectTheme, SkeletionTheme, SliderTheme,
SwitchTheme, TableTheme, TagTheme, TypographyTheme, UploadTheme,

View file

@ -24,7 +24,6 @@ pub fn Text(#[prop(optional)] code: bool, children: Children) -> impl IntoView {
}
.into_any();
} else {
view! { <span class="thaw-text">{children()}</span> }
.into_any()
view! { <span class="thaw-text">{children()}</span> }.into_any()
}
}

View file

@ -2,7 +2,6 @@
mod component_ref;
mod event_listener;
mod mount_style;
mod provider;
mod signal;
mod stored_maybe_signal;
@ -10,7 +9,6 @@ mod stored_maybe_signal;
pub(crate) use component_ref::ComponentRef;
pub(crate) use event_listener::*;
pub(crate) use mount_style::mount_style;
pub(crate) use provider::Provider;
pub use signal::SignalWatch;
pub(crate) use stored_maybe_signal::*;

View file

@ -1,13 +0,0 @@
/// https://github.com/leptos-rs/leptos/issues/2038
use leptos::*;
#[component]
pub fn Provider<T>(value: T, children: Children) -> impl IntoView
where
T: Clone + 'static,
{
run_as_child(move || {
provide_context(value);
children()
})
}