* Add keyboard service
* fix not working implementation; run cargo fmt
* make callback to keyboard event use KeyPressEvent instead of String
* add key_down and key_up events as well
* link to documentation and provide compatibility notice
* feat: add create_effect method to help create effect callback
* style: fmt code with rustfmt
* feat: support bunch update in one render loop
* typo: change bunch to batch
* style: fmt with cargo
* Early msgs queue for Public worker
* Early msgs queue for Public worker
* update (#1)
* Fix typo
* Require fmt in travis script
* Apply cargo format to all modules
* ??
* Merge (#2)
* Fix typo
* Require fmt in travis script
* Apply cargo format to all modules
* avoid allocating in diff_classes
* avoid allocating for diff_kind
* avoid allocating for diff_value
* simplify diff_attributes and avoid allocations
* return iterator for diff_classes and diff_attributes
* rustfmt on vtags
* clean apply_diff
* more cleaning
* apply suggestions
* Update proc-macro2, syn and quote to 1.0
CLOSES#590
* Fixed typo
* Add support for optional callbacks to component properties
* Add tests for a component with optional callback
* Fix typo
* Add `Classes` to prelude
* binary ser/de issue fix
* merge (#3)
* Fix typo
* Require fmt in travis script
* Apply cargo format to all modules
* avoid allocating in diff_classes
* avoid allocating for diff_kind
* avoid allocating for diff_value
* simplify diff_attributes and avoid allocations
* return iterator for diff_classes and diff_attributes
* rustfmt on vtags
* clean apply_diff
* more cleaning
* apply suggestions
* Update proc-macro2, syn and quote to 1.0
CLOSES#590
* Fixed typo
* Add support for optional callbacks to component properties
* Add tests for a component with optional callback
* Fix typo
* Add `Classes` to prelude
* added bincode type for data ser de
* fixed Into func
* Update (#5)
* in yewstack org
* Initial implementation using an iterator adaptor to provide a coherent struct to implement Into<VNode> (via From<>) for
* update large table example to demonstrate new .html() method instead of 'for'
* ran cargo fmt
* Add a section for project templates to the README
* Change org to YewStack
* Implement FromIterator instead of wrapping iterator
* remove dead code
* ran fmt
* Add extend method to Classes
* change to union
* renamed union back to extend
* removed unused import of RangeFull
* update
* Fix touch events (#656)
* Update changelog for v0.9 release (#657)
* Implement Debug for ChildRenderer<T> (#655)
* Implement Debug for ChildRenderer<T>
* fix formatter type lifetime
* remove fmt
* cargo fmt
* Emit initial route to router subscribers (#634)
* Fix typo in RenderService (#658)
* Add From<&String> for Classes implementation
* @jstarry feedback
- cargo fmt
- rename DEDICATED_WORKERS_* to REMOTE_AGENTS_*
- remove unrelated changes
* TypeId ask key instead &str
* Remove .gitignore changes
* Update agent.rs
* Update agent.rs
* Fix merge conflict
* Add Dispatchers, which act like bridges, but don't require a callback to create; updated router example
* cargo fmt
* improve comment
* Another approach
* add newtype around dispatcher bridges
* added debug impl, run cargo fmt
* fix example
* make button on routing example start on loading variant
* revert singleton_id changes
* actually revert singleton_id changes
* slabs own option<callback>
* cargo fmt
* remove dead lines
* address bad doc comment
* fix router example
* fix handler id initialization in local agent
* add appropriate error message when id is not associated with callback
* remove misleading comment
* use a type alias to the shared output slab
659: Add From<&String> for Classes implementation r=jstarry a=jstarry
We used to support using `&String`s as classes so adding that functionality back in
Co-authored-by: Justin Starry <jstarry@users.noreply.github.com>
651: Fix VNode orphaning inside of VTags r=jstarry a=hgzimmerman
Fixes https://github.com/yewstack/yew/issues/643
VTags now recursively detach their children when they are detached themselves. This means that Components nested within `<div>`s or other elements will now properly run their `destroy` function and be dropped by the framework.
Its nice to finally squash a bug that's bothered me for more than a year.
Co-authored-by: Henry Zimmerman <zimhen7@gmail.com>
640: Properly handle where clause in derive props macro r=jstarry a=astraw
This fixes#638.
So far, I was not able to the test suite to run, so I wasn't able to write a test for this.
Co-authored-by: Andrew Straw <strawman@astraw.com>
Co-authored-by: Justin Starry <jstarry@users.noreply.github.com>
589: Allow components to accept children elements r=jstarry a=jstarry
Fixes: https://github.com/yewstack/yew/issues/537
#### Terminology
- (B) Base component that renders components nested inside each other
- (P) Parent component that has a `children` property and can render those children
- (C) Child component that is nested inside parent and included inside the Parent's `children`
#### Todo
- [x] Add example for nested components
- [x] Support arbitrary html nested inside component tags
- [x] Support nested components inside component tags
- [x] Allow modifying & accessing (C) props when rendering (P)
- [x] Allow filtering (C) components when rendering (P)
- [x] Children prop be required or optional
- [x] Clean up nested component example
- [x] Fix parser for generic component type
- [x] Write tests
- [x] Update documentation and README
- [x] ~~Investigate passing required properties from (P) -> (C)~~
- [x] ~~Allow sending messages from (C) -> (B)~~
Co-authored-by: Justin Starry <jstarry@users.noreply.github.com>
626: Add extend method to Classes r=jstarry a=hgzimmerman
Also implement Clone.
Addresses https://github.com/yewstack/yew/issues/621
----
I'm a little off-put by the use of `format!()` having to be used to concatenate strings that are later used as classes.
This change allows for usages like:
```rust
html!{
<div class=Classes::new().union("some-class").union("other-class") />
}
```
or
```rust
html!{
<div class=self.class.clone().union("other-class") />
}
```
Co-authored-by: Henry Zimmerman <zimhen7@gmail.com>
622: Remove special 'for' syntax (WIP) r=jstarry a=hgzimmerman
Attempts to address https://github.com/yewstack/yew/issues/606
I'm running into coherence issues and conflicting implementations with `ToString` and `IntoIterator` when I try to do a blanket impl for `impl <T: IntoIterator<etc...> From<T> for VNode<COMP>`. If I replace the `ToString` blanket impl with concrete impls for `String` and `&str`, I still run into coherence issues where downstream crates might provide a conflicting impl.
I figured that the easiest path forward is to create my own iterator and implement `Into<VNode<COMP>>` for it via an impl for `From`.
So this PR thusfar gets us from:
#### Before
```rust
html! {
for self.props.items.iter().map(renderItem)
}
```
#### To the start of this PR.
```rust
html! {
self.props.items.iter().map(renderItem).html()
}
```
#### To now
```rust
html! {
self.props.items.iter().map(renderItem).collect::<Html<Self>>()
}
```
Which strictly speaking, is _better_, as it frees up a keyword, but isn't anywhere near what you ideally want:
#### Ideal
```rust
html! {
self.props.items.iter().map(renderItem)
}
```
-------
Any feedback on how to achieve this design goal would be appreciated.
Co-authored-by: Henry Zimmerman <zimhen7@gmail.com>