* Add documentation for wasm-bindgen
Adds a wasm-bindgen section to docs and gives a high level
description of it's crates and how they are used with Yew.
* Fix typos and formatting
* Expand JS example section
* fix re-export web_sys through yew info
* Add HtmlSelectElement feature
* Fix identing
* Fix code example comment
`first_node` function can fail and in some situations, when the VNode
has not been mounted yet, so this adds a safe version that returns an
`Option<Node>` and refactors the previous version to use the "unchecked"
prefix as it can and should panic if the first node cannot be found.
* Remove `web_sys` re-export
Removes re-exporting the `web_sys` dependency from the yew crate and
removes some `web_sys` features that were only enabled for re-exporting.
* re-export events through yew::events
This changes the dependency on anymap which is unmaintained and has a
soundness bug to an updated fork `anymap2` where the soundness bug has
been fixed.
General review of dependencies, removing ones that are not used and
bumping up minor versions to avoid breakage.
Consistent use of caret so that we use the most recent minor/patch
version of a dependency when building Yew crates.
* Add failing test for non bubbling events
Adds a failing test to identify the issue raised in #2061
* Fix handling events in capture phase
The global mutltiplex registers an event listeners on the body element
and then we do the event bubbling manually in Yew, however, because we
were still registering event listeners to run on the bubbling phase
events that do not bubble (like blur) never reach the body element.
Hooks with initialization functions had a 'static lifetime requirement
on the signature, however, any closure given only needs to have a
lifetime that lives as long as the hook call.
* Reword to use double-dot syntax instead of "with"
* Implement double-dot syntax for props in components
* Update documentation with new syntax
* Update forgotten doc
* Add descriptive comments
* Check props and base expression
* Make compatible with 1.49.0 by removing then
* Fix website tests
* Update error output
* Implicitly convert string literals to String if they are listed as props
* Remove unused keyword
* Rename function for checking if string literal
* Fix weird formatting
* Update code based on review
* Update website/docs/concepts/html/components.md
Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
* Base expression span includes dot2 now
* Improve specificity of error message
* Chain together error messages
* Add an example failure case to illustrate combined error message
* Update based on review comments
* Fix missing clones
Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
* Add no_implicit_prelude to derive_props test
* Add no_implicit_prelude to html_macro tests
* Fix function_component macro tests
function_component macro tests weren't being run by try build due to
change in dir name. Imports corrected now that function_component is now
in yew.
Adds no_implicit_prelude to *-pass tests
* Add no_implicit_prelude to props_macro tests
* fix typo in comment
Tutorial should be in the docs so that it can be matched to the version
yew that a user is trying to be informed on.
The tutorial now comes under the scope of website testing so had to
tweak the tutorial to pass the tests.
Updates to using the latest stable gloo, in some cases removing
dependencies on `master` branch.
Removes `weblog` in favour of `gloo_console`, where applicable.
* yew: partial event listener multiplexer
web_sys implementaion compiles but the std_web implementation is unfinished. Keeping this only to commit curretn progress before reverting std_web.
* yew: partial event listener multiplexer
Feature parity with master, except for bubbling.
* yew/listener: fix and test synchronous listeners
* yew/listener: add placeholder comments
* yew/listener: passive listener test
* yew: extend and fix APIs and docs
* yew/listener: event bubbling
* clippy: ignore warning
* Update yew/src/callback.rs
Co-authored-by: Simon <simon@siku2.io>
* Update yew/src/html/listener/listener_stdweb.rs
Co-authored-by: Simon <simon@siku2.io>
* Apply suggestions from code review
Co-authored-by: Simon <simon@siku2.io>
* Apply suggestions from code review
Co-authored-by: Simon <simon@siku2.io>
* yew/listner: remove redundant function
* yew/listner: restore delibarate formatting
* yew/callback: make Flags a newtype
* yew/listener: use utility function
* yew/listener: deferred listeners
* yew/listner: input and change tests
* yew/listener: optimize listener registration
* yew/listener: remove benchmark placeholders
Seems easybench-wasm does not support specifying a module path.
* yew/callback: revert CallbackOnce -> Once
* yew: convert listener_tests to a build flag
* Apply suggestions from code review
Co-authored-by: Simon <simon@siku2.io>
* yew: fix doc comments
* yew: simplify iteration
* yew/remove unneeded default passive listeners
* yew/listeners: DRY some more
* yew/listener: fix clippy warnings
* yew/listeners: remove legacy comment
* yew/listeners: document stopping propagation
* yew/listeners: update tests
* ci: see how test run on stable
* ci: let's find the new MSRV
* ci: try to run integration tests only on stable
* yew/test: clean up residual dirty state
* yew/listeners: minor doc string and inline fixes
* yew/listener: document reasonning for function
Co-authored-by: Simon <simon@siku2.io>
* Add doc-test to test website code snippets
Heavily inspired by tokio-rs/website repo.
* Fix code snippets to pass doc tests
Some code snippets are explicitly ignored and some are not run
to avoid having to include dependencies for one liners.
* Add website code snippet tests to CI
* Fix CI
* Remove doc-test from workspace
* Exclude doc-test from workspace
* Refactor code snippets and tests
Code snippets can import types from doc_test crate i.e.:
```rust
use doc_test::agents::EventBus;
```
This allows for moving some boilerplate away from the example and still
checks that the code compiles correctly.
Also some slight changes to some of the examples and the information
about `ComponentLink` which is deprecated.
* Move doc-test to packages
* Rename doc-test crate to website-test
The new name makes it more clear the purpose of this crate.
* fix ci
onsubmit takes a `SubmitEvent` which is not available in web_sys.
`SubmitEvent` does not inherit from `FocusEvent` so
`FocusEvent::related_target` panics too!
As with onformdata onsubmit will use `Event` to remain safe and requires
users to define their own type or use Reflect api.
Trybuild change because of the new comment.