The following main.rs replicates the clippy warning:
```
use yew::prelude::*;
struct Props {
droppable: Vec<()>,
}
fn component(props: &Props) -> Html {
let props = Props { droppable: Vec::new() };
html! { <Component ..props /> }
}
fn main() {}
```
If I'm not mistaken this happens when using the `..` on any `Properties` with a field that implements `Drop`.
* Replace unwrap with if let to prevent panic
* Add resume after unmount test
* Change BaseSuspense methods to associated functions
* Fix rustfmt issues
* fix portal shifting on reconciliation too often
the public vdom api changes to only allow directly
setting a Node as sibling (still optional) instead of a NodeRef.
This was the intention all along, since the NodeRef was
not dynamically tracked, and creating a portal into a subtree
already controlled by yew is not supported anway.
* fix feature soundness
* fix doc tests
* Various improvements to Classes, oriented around reducing allocations
- `push` no longer performs unnecessary allocations if `self` is empty.
- Most constructors (FromIterator, From, Extend) are now oriented around push, to take advantage of this
- `to_string` and `into_prop_value`:
- No longer allocate an unnecessary `Vec`; they instead preallocate a string of the correct length and push into it directly.
- No longer use a length check + `unsafe`; they instead match over a fallible .next() and proceed from there.
- Additionally, `into_prop_value` no longer builds a `String` or `Rc` if `Classes` contains a single `&'static str` or is empty.
- `From<String>` no longer clones the string if it contains a single class.
- `impl Eq for Classes`
* Fix duplicated is_empty test
* Allow skipping a callback when reforming
This adds a method to the callback, similar to Rust's filter_map, which
allows to reform a callback, but also suppress the emit in case
the reform function returns `None`.
* Update packages/yew/src/callback.rs
Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com>
* Implement filter_reform for all Callback output types
As suggested in the PR, this implements filter_reform for all output
types of callbacks by mapping to `Option<OUT>`.
* Fix clippy error
Although I believe that the code is more readable/understandable with
an explicit map, I am not sure adding a clippy exception just for that
is justified. So I applied the clippy suggestion.
Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com>
* Adding old_props to fn changed()
* Change old_props type to &Self::Properties
* Update examples that use fn changed() and want old_props
* Fix tests
* Fix invalid test flags
* cargo fmt
* Oops wrong regex
* Revert change for older version
* Remove unnecessary clone
* Add migration guide
* Oh wow the test was not running xD
* add send_stream method for Scope
* add eof stream note
* map stream item type
* No need for nightly, fmt, updates
Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
* Switch to pinned channels.
* Fix ServerRenderer so it's not blocked until the result is resolved.
* Fix tests.
* Remove unused SendError.
* Revert channel-based BufWriter.
* Removed unused fmt module.
* Update docs.
* Add safety comments, adjust borrowing designs.
* Adjust oneshot as well.
* Fix workflow temporarily.
* Cell or UnsafeCell?
* Update safety notice.
* Should be sync.
* Actually should be both.
* Update packages/yew/src/platform/pinned/mpsc.rs
Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
* Set to properties, not attributes
* fix tests
* Add tests
* enable disabled test, fmt
* Introduce @key syntax to forcefully set as attribute
* Everything compiles
* More tests
* id as property
* This was not meant to be committed
* Make test pass, fmt + clippy
* fucking rustfmt
* is this enough formatting
* that was not supposed to be commited
* apply review
* fmt
* fix CI
* will you be happy now, clippy?
* use tracing for logging
* embed spans in the scheduler for tracing
* fix feature soundness
* remove spans from scheduler for now
* feature soundness take 2
* use tracing::* throughout lib code
not yet in testing, and for some errors!
* don't attach noderef to components, add test case
* remove node_ref from VNode and VComp
* fmt & macro tests
* remove uneeded test & todo
this test is done at compile time. there's no node_ref field so it can't be set
* feature soundness & clippy
* add marker field, in an attempt to reduce bundle size
* Update migration guide
* Makes Prepared States to be Rc'ed.
* Update example.
* Make prepared states work on none runtime as well.
* Remove more feature flags.
* Users always have to manually construct dependency into Rc.
* Import Rc.
* Revert "Users always have to manually construct dependency into Rc."
This reverts commit 9eee1da3e9a46e69a7b07e6064eb163e06261bfb.
* Revert "Import Rc."
This reverts commit d6bb90dc155d2bf87fd18eec4b78b8e07a9cc7a7.
* Use IntoPropValue for node refs in html component
* Add NodeRef ImplicitClone test for html element
* Change node_refs example to use ImplicitClone
* Reuse key and ref attribute wrapping
* init use_bridge content
* cargo fmt
* cargo +nightly fmt --all
* more sensible code
* make example compile
* make example compile (for real this time)
* update docs
* oops
* oops
* make super work
* this is rust, not C