Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
305 changes: 113 additions & 192 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ unexpected_cfgs = { level = "warn", check-cfg = [
"cfg(wasm_bindgen_unstable_test_coverage)"
]}
[workspace.dependencies]
tokio = { version = "1.47.1" }
implicit-clone = { version = "0.5.1" }
tokio = { version = "1.48.0" }
implicit-clone = { version = "0.6.0" }
2 changes: 1 addition & 1 deletion examples/function_router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ instant = { version = "0.1", features = ["wasm-bindgen"] }
once_cell = "1"

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.3.1", features = ["wasm_js"] }
getrandom = { version = "0.3.4", features = ["wasm_js"] }

[[bin]]
name = "function_router"
Expand Down
1 change: 1 addition & 0 deletions examples/immutable/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub fn array_example() -> Html {
folks.set(
folks
.iter()
.cloned()
.chain(std::iter::once(IString::from(name)))
.collect(),
);
Expand Down
1 change: 1 addition & 0 deletions examples/immutable/src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ impl Component for MapExample {
self.values = self
.values
.iter()
.map(|(&k, v)| (k, v.clone()))
.chain(std::iter::once((
self.values.len() as u32,
IString::from(name),
Expand Down
1 change: 1 addition & 0 deletions examples/nested_list/src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ impl List {
children
.iter()
.filter(|c| !c.props.hide)
.cloned()
.enumerate()
.map(|(i, mut c)| {
let props = c.get_mut();
Expand Down
2 changes: 1 addition & 1 deletion examples/password_strength/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"
[dependencies]
yew = { path = "../../packages/yew", features = ["csr"] }
zxcvbn = "3.1.0"
time = "0.3.43"
time = "0.3.44"
js-sys = "0.3.70"
web-sys = { version = "0.3", features = ["Event","EventTarget","InputEvent"] }
wasm-bindgen = "0.2"
Expand Down
4 changes: 2 additions & 2 deletions examples/simple_ssr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ required-features = ["ssr"]

[dependencies]
yew = { path = "../../packages/yew" }
reqwest = { version = "0.12.8", features = ["json"] }
serde = { version = "1.0.218", features = ["derive"] }
reqwest = { version = "0.12.24", features = ["json"] }
serde = { version = "1.0.228", features = ["derive"] }
uuid = { version = "1.18.1", features = ["serde"] }
futures = "0.3"
bytes = "1.7"
Expand Down
2 changes: 1 addition & 1 deletion examples/web_worker_prime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ yew-agent = { path = "../../packages/yew-agent" }
yew = { path = "../../packages/yew", features = ["csr"] }
futures = "0.3.30"
primes = "0.4.0"
serde = { version = "1.0.218", features = ["derive"] }
serde = { version = "1.0.228", features = ["derive"] }
4 changes: 2 additions & 2 deletions packages/yew-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ yew = { version = "0.21.0", path = "../yew" }
wasm-bindgen = "0.2"
js-sys = "0.3"
pinned = "0.1.0"
thiserror = "2.0.16"
thiserror = "2.0.17"
bincode = { version = "2.0.0-rc.3", features = ["serde"] }
wasm-bindgen-futures = "0.4"
serde = { version = "1", features = ["derive"] }
Expand All @@ -37,4 +37,4 @@ features = [
]

[dev-dependencies]
serde = "1.0.218"
serde = "1.0.228"
22 changes: 15 additions & 7 deletions packages/yew/src/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! This module contains useful utilities to get information about the current document.

use std::marker::PhantomData;
use std::rc::Rc;

use implicit_clone::unsync::IArray;
use implicit_clone::ImplicitClone;
Expand All @@ -15,20 +16,24 @@ where
it.into_iter().map(|n| n.into())
}

fn array_single<T: ImplicitClone + 'static>(singl: T) -> IArray<T> {
IArray::Rc(Rc::new([singl]))
}

/// A special type necessary for flattening components returned from nested html macros.
#[derive(Debug)]
pub struct NodeSeq<IN, OUT: ImplicitClone + 'static>(IArray<OUT>, PhantomData<IN>);

impl<IN: Into<OUT>, OUT: ImplicitClone + 'static> From<IN> for NodeSeq<IN, OUT> {
fn from(val: IN) -> Self {
Self(IArray::Single([val.into()]), PhantomData)
Self(array_single(val.into()), PhantomData)
}
}

impl<IN: Into<OUT>, OUT: ImplicitClone + 'static> From<Option<IN>> for NodeSeq<IN, OUT> {
fn from(val: Option<IN>) -> Self {
Self(
val.map(|s| IArray::Single([s.into()])).unwrap_or_default(),
val.map(|s| array_single(s.into())).unwrap_or_default(),
PhantomData,
)
}
Expand All @@ -38,7 +43,7 @@ impl<IN: Into<OUT>, OUT: ImplicitClone + 'static> From<Vec<IN>> for NodeSeq<IN,
fn from(mut val: Vec<IN>) -> Self {
if val.len() == 1 {
let item = val.pop().unwrap();
Self(IArray::Single([item.into()]), PhantomData)
Self(array_single(item.into()), PhantomData)
} else {
Self(val.into_iter().map(|x| x.into()).collect(), PhantomData)
}
Expand All @@ -49,15 +54,18 @@ impl<IN: Into<OUT> + ImplicitClone, OUT: ImplicitClone + 'static> From<IArray<IN
for NodeSeq<IN, OUT>
{
fn from(val: IArray<IN>) -> Self {
Self(val.iter().map(|x| x.into()).collect(), PhantomData)
Self(val.into_iter().map(|x| x.into()).collect(), PhantomData)
}
}

impl<IN: Into<OUT> + ImplicitClone, OUT: ImplicitClone + 'static> From<&IArray<IN>>
for NodeSeq<IN, OUT>
{
fn from(val: &IArray<IN>) -> Self {
Self(val.iter().map(|x| x.into()).collect(), PhantomData)
Self(
val.clone().into_iter().map(|x| x.into()).collect(),
PhantomData,
)
}
}

Expand All @@ -70,11 +78,11 @@ impl<IN: Into<OUT> + Clone, OUT: ImplicitClone + 'static> From<&ChildrenRenderer
}

impl<IN, OUT: ImplicitClone + 'static> IntoIterator for NodeSeq<IN, OUT> {
type IntoIter = implicit_clone::unsync::Iter<Self::Item>;
type IntoIter = implicit_clone::unsync::IArrayIntoIter<Self::Item>;
type Item = OUT;

fn into_iter(self) -> Self::IntoIter {
self.0.iter()
self.0.into_iter()
}
}

Expand Down
2 changes: 1 addition & 1 deletion tools/benchmark-hooks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ crate-type = ["cdylib"]

[dependencies]
rand = { version = "0.9.2", features = ["small_rng"] }
getrandom = { version = "0.3.1", features = ["wasm_js"] }
getrandom = { version = "0.3.4", features = ["wasm_js"] }
wasm-bindgen = "0.2.92"
web-sys = { version = "0.3.70", features = ["Window"]}
yew = { version = "0.21.0", features = ["csr"], path = "../../packages/yew" }
Expand Down
2 changes: 1 addition & 1 deletion tools/benchmark-ssr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tokio = { workspace = true, features = ["macros", "rt-multi-thread", "time"] }
average = "0.16.0"
tabled = "0.20.0"
indicatif = "0.18.0"
serde = { version = "1.0.218", features = ["derive"] }
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.145"
clap = { version = "4", features = ["derive"] }

Expand Down
8 changes: 4 additions & 4 deletions tools/build-examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
publish = false

[dependencies]
reqwest = { version = "0.12.12", features = ["blocking", "json"] }
regex = "1.11.2"
toml = "0.9.5"
serde = { version = "1.0.218", features = ["derive"] }
reqwest = { version = "0.12.24", features = ["blocking", "json"] }
regex = "1.12.2"
toml = "0.9.8"
serde = { version = "1.0.228", features = ["derive"] }
Loading