612: Add support for optional callbacks to component properties r=jstarry a=Wodann
Added transformer for conversion of a closure to an optional callback, as requested in issue #609.
Co-authored-by: Wodann <remco.kuijper@gmail.com>
608: Update proc-macro2, syn and quote to 1.0 r=jstarry a=hobofan
CLOSES#590
I also tried to lift the recursion limits in the examples, but it looks like they are still required (maybe due to macros from stdweb?).
Co-authored-by: Maximilian Goisser <goisser94@gmail.com>
591: Remove allocation in vtag diff r=jstarry a=tafia
**Disclaimer**: I couldn't test it on my system yet.
This PR attempts to remove all allocations (`String`, `Vec` and `HashSet`) used in various vtag diff functions.
I believe this should have an impact both in terms of performance and memory.
Co-authored-by: Johann Tuffe <tafia973@gmail.com>
585: Add own Classes struct implementation r=DenisKolodin a=DenisKolodin
Hide details of Classes set implementation and add a feature to produce that struct from variety of sources like `&str`, `String` and `Vec<T> where T: AsRef<str>`.
I need this to have an effective way to construct complex classes set for https://github.com/yewstack/facade. With this PR we can do something like:
```rust
let mut classes = vec!["container"];
classes.push("fluid");
// or
let mut classes = Classes::new();
classes.append("container");
if fluid_flag {
container.append("fluid");
}
html! {
<div classes=classes />
}
```
In the future we can implement `impl Info<Classes> for (tuple)` and simplify macro by delegating **tuples to classes** conversion to type system (instead of macro).
Let's give a chance to CI to check it 🤞
Also I applied `cargo fmt` to the root crate sources.
Co-authored-by: Denis Kolodin <deniskolodin@gmail.com>
583: Add default mounted() method to Component trait r=jstarry a=hgzimmerman
Fixes https://github.com/yewstack/yew/issues/572
I made the choice to have `on_mount()` not return a `ShouldRender` bool, because I don't think there is a situation where altering parts of a component state relevant to the `view()` should ever take place in `on_mount()` instead of `create()`. Let me know your thoughts, because its an easy enough change to make.
Co-authored-by: Henry Zimmerman <zimhen7@gmail.com>
Hide details of Classes set implementation and add a feature to produce that struct
from variety of sources like `&str`, `String` and `Vec<T> where T: AsRef<str>`.
562: Reorganize html module r=jstarry a=jstarry
This splits the html module so that it now has two submodules: `scope` and `listener`
Co-authored-by: Justin Starry <jstarry@users.noreply.github.com>