358 Commits

Author SHA1 Message Date
GitHub Action
c29cd71436 (cargo-release) version yew-v0.19.3 2021-12-11 19:44:45 +00:00
GitHub Action
4d96d3d87d (cargo-release) version yew-macro-v0.19.3 2021-12-11 19:44:22 +00:00
Julius Lungys
abeb8bc3f1
(cargo-release) version yew-v0.19.2 (#2262) 2021-12-11 21:41:56 +02:00
Julius Lungys
457e98682d
Fix failed release (#2261)
* Revert "(cargo-release) version yew-v0.19.2"

This reverts commit feb45d81bc4ac7f5c6966622cb87286a1fa46d4e.

* (cargo-release) version yew-macro-v0.19.2

* remove publish = false
2021-12-11 21:31:34 +02:00
GitHub Action
feb45d81bc (cargo-release) version yew-v0.19.2 2021-12-11 19:25:55 +00:00
Leon
5c5642782f
docs: fix functional and struct components links (#2258)
* docs: fix functional and struct components links

* docs: fix link to func comp in rs

Co-authored-by: Leon Minasyan <leon-minasyan@yandex-team.ru>
2021-12-11 19:14:11 +01:00
Cecile Tonglet
63eb95ca44 (cargo-release) version yew-macro-v0.19.1 2021-12-07 19:23:47 +01:00
Cecile Tonglet
8a16d4fc3d
(cargo-release) version yew-v0.19.1 (#2250)
Co-authored-by: GitHub Action <github-action@users.noreply.github.com>
2021-12-06 17:27:57 +01:00
Julius Lungys
1230de98af
(cargo-release) version yew-v0.19.0 (#2249)
Co-authored-by: GitHub Action <github-action@users.noreply.github.com>
2021-12-06 15:54:28 +00:00
Julius Lungys
bbf57e1efe
add back readmes (#2248) 2021-12-06 15:35:05 +00:00
Julius Lungys
cf488c53b5
Fix: use path versions (#2247) 2021-12-06 16:17:50 +01:00
Julius Lungys
5c477f25c8
Fix cargo tomls for release (#2246) 2021-12-06 16:02:01 +01:00
Julius Lungys
d3d4b1dae6
(cargo-release) version yew-macro-v0.19.0 (#2245) 2021-12-06 15:33:32 +01:00
Julius Lungys
1c49e89450
Automatic publishing actions v2 (#2241) 2021-12-06 11:47:47 +01:00
Matt
338dcd8869
Router docs about set-only components (#2214)
* Use From<Cow> of AttrValue in Link component

* docs about `BrowserHistory::default()`

* remove unused cow import

* remove unused cow import

* lint

* More accurate `BrowserHistory::default()` tips

* Update website/docs/concepts/router.md

Co-authored-by: Julius Lungys <32368314+voidpumpkin@users.noreply.github.com>

* Update website/docs/concepts/router.md

Co-authored-by: Simon <simon@siku2.io>

Co-authored-by: Julius Lungys <32368314+voidpumpkin@users.noreply.github.com>
Co-authored-by: Simon <simon@siku2.io>
2021-12-05 16:15:37 +02:00
Julius Lungys
d1a981571c
Add github actions for publishing crates (#2235)
* only actions

* fix clippy

* Apply suggestions from code review
2021-12-04 19:42:50 +02:00
Julius Lungys
4875430852
generate 0.19 CHANGELOG.md (#2199)
* Generate 0.19 CAHNGELOG.md

* remove tokens

* merge router CHANGELOG

* Apply suggestions from code review

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>

* add empty line

* update according to comments 1

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
2021-11-29 18:02:04 +00:00
WorldSEnder
3707ea55e6
Refactor vlist to use less macros and unsafe (#2195)
An ElementWriter struct keeps track of the place where to insert elements,
instead of the previous apply! macro.
The Vec::drain api is used consume ancestors. This removes a panic unsafety:
the previous impl forgets to drop elements

Small fix: author -> authors in web_worker_fib
2021-11-27 16:32:56 +00:00
Julius Lungys
ee1f92f5f3
Fix href lint error in tests (#2204) 2021-11-27 21:13:35 +05:00
Matt
83aa0510ee
implement From<Cow<'static, str>> for AttrValue (#2200)
* implement From<Cow<'static, str>> for AttrValue

* actually fmt code

* oopsies
2021-11-26 10:01:03 +02:00
Matt
fd92ab8948
Add missing router docs: Redirect, Nested Router, and Path Segament capturing (#2192)
* nested router structure diagram

* add Redirect, nested router documentation.

* add reminder

* fix the comment, duh

* snippets get tested too unless ignored

* fix inconsistent var name in snippet

* Add redirect to nested router example
normal component -> struct component

* Document about acceptable types for path segment
Document about router behaviour at fail to parse

* add missing ignore to snippet

* typo

* normal -> struct

* reformat codeblock and the markdown
functional comp -> function comp
consistent code snippet style
removed two ignores

* add back ignores

* typo, snippet correction. grammar.

* correction

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
2021-11-26 10:00:13 +02:00
rjmac
47fad81f19
Check event bubbling cancellation at each step of propagation (#2191)
Rather than once after the innermost node is given the chance to
handle it.

Fixes #2185

Co-authored-by: Robert Macomber <robertm@mox>
2021-11-23 22:38:32 +02:00
Julius Lungys
3742fde220
Add possibility to cancel bubbling (#2172)
* make stop_propogation work

* Update packages/yew/src/virtual_dom/listeners.rs

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>

* Update packages/yew/src/virtual_dom/listeners.rs

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>

* Update packages/yew/src/virtual_dom/listeners.rs

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
2021-11-22 18:30:52 +00:00
Cecile Tonglet
3858aededd
Add the ability to add child nodes conditionally in html! (#1609)
* Initial commit

Forked at: 66d506e13329a06f7dce0b55a9427972b8aad3ff
Parent branch: origin/master

* Add the ability to add child nodes conditionally in html!

* WIP

Forked at: 66d506e13329a06f7dce0b55a9427972b8aad3ff
Parent branch: origin/master

* CLEANUP

Forked at: 66d506e13329a06f7dce0b55a9427972b8aad3ff
Parent branch: origin/master

* Experiment

* Failing test

* More tests

* More tests

* Add new HtmlIterable with syntax `for {...}` instead of `{for ...}`

* Remove HtmlIf from HtmlRoot (already done in HtmlTree)

* WIP

* WIP

* WIP

* WIP

* Revert

* CLEANUP

* WIP

* CLEANUP

* Remove IterableNew

* Renamed HtmlBranch to HtmlRootBraced and moved to mod.rs

* Update yew-macro/tests/html_macro/html-if-pass.rs

Co-authored-by: Simon <simon@siku2.io>

* Suggestion

* Oops

* Added ToNodeIterator to HtmlIf

* Improve error spans

* More html!()

* Move tests to not use browser

* Multiple children in if-expr

* Clippy fix

* Clippy fix again

* Re-trigger CI

* Apply suggestions from code review

Co-authored-by: Simon <simon@siku2.io>

* Replacing ParseResult by syn::Result everywhere

* Remove unnecessary &mut

* Attempt to add test on ToNodeIterator

* Clippy fixes

* Still works for some reason

* Revert "Attempt to add test on ToNodeIterator"

This reverts commit 75b1a85c28df36ad8bf61344eef56e06667da3b6.

* fix CI

* add docs on website

* Apply suggestions from code review

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>

* apparently I can't hide lines on website

* update stderr file

* will this work?

* fix bug where conditions can't be expressions

* better error message

* clippy & fmt

Co-authored-by: Simon <simon@siku2.io>
Co-authored-by: Hamza <muhammadhamza1311@gmail.com>
Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
2021-11-22 20:13:03 +02:00
Kaede Hoshikawa
e92eaeda01
Fix router example. (#2179)
* Fix router example.

* Optimise codebase.

* Update packages/yew-router/src/router.rs

Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com>

Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com>
2021-11-22 20:57:45 +05:00
WorldSEnder
ae7a8be008
use base url for href of links (#2177) 2021-11-22 20:09:41 +05:00
Matt
4c3d6934a8
Remove extra braces in html_nested macro (#2169)
* removed unused braces from html_nested marco

* allow specifying test name

* also fix for html! macro

* also fix for html! macro

* remove misplaced #[allow(unused_braces)]
2021-11-21 17:09:30 +02:00
Teymour Aldridge
7e2542cbf8
Add basic lints to the HTML macro. (#1748)
* Add basic lints to the HTML macro.

* f

* Fix the examples.

* Fix nightly warning message tests.

* apply code review suggestions

* update error message

* rebase onto master

* remove unused props

* remove console log

* remove js void

* fix according to PR comments

Co-authored-by: Julius Lungys <32368314+voidpumpkin@users.noreply.github.com>
2021-11-21 19:54:49 +05:00
mc1098
071f1b28df
Refactor use ref hooks (#2093)
* Refactor use ref hooks

`use_ref` has been renamed to `use_mut_ref` and `use_ref` has become a
similar hook for immutable reference.

This is different from React but I think lines up nicely with Rust as a
reference is immutable unless specified to be a mut ref.

* fix CI

Co-authored-by: Hamza <muhammadhamza1311@gmail.com>
2021-11-21 16:20:19 +02:00
Marcel
068a20abba
AttrValue's PartialEq takes the enum variant into account (#2162)
* Attempt to fix recursion on display

* Include into_string() for AttrValue

* PartialEq takes the enum variant into account #2161

Co-authored-by: mibes <mibes@avaya.com>
2021-11-20 15:40:49 +02:00
Andrew Straw
916dc2e907
allow web worker resource to be relative (#2086)
* allow web worker resource to be relative

fixes #2056

* make backwards compatible with rust < 1.52

* fix clippy warning

* Apply suggestions from code review

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>

* do not reimplement stdlib function

* fixup previous

* improve docstring

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
2021-11-20 15:39:35 +02:00
Marcel
2b1059b4b5
Implements into_string() for AttrValue (#2153)
* Attempt to fix recursion on display

* Include into_string() for AttrValue

Co-authored-by: mibes <mibes@avaya.com>
2021-11-19 20:34:07 +05:00
WorldSEnder
aa9b9b266c
Implementation of portals (#2147)
* initial poc implementation of portals

* add new_before

* add portals example

* add shadow dom example

* add english website documentation
2021-11-16 16:48:04 +01:00
Shihpin Tseng
a5c343dd62
add Clone implementation for use_bridge (#2150) 2021-11-16 09:06:32 +00:00
Marcel
ee54bbdff2
Attempt to fix recursion on display (#2149)
Co-authored-by: mibes <mibes@avaya.com>
2021-11-16 09:03:40 +00:00
Kaede Hoshikawa
fb9c398048
use_bridge hook for agents (#2125)
* Add Redirect Comp.

* Fix router behaviour.

* Fix output.

* Fix pr-flow.

* Remove Redirect.

* Readd 77b46bf.

* Add use_bridge hook.

* Add documentation.
2021-11-12 09:04:03 +01:00
Jonas Platte
39886d4675
Allow Classes properties to be created from string literals (#2141)
* Allow Classes properties to be created from string literals

* Update test output
2021-11-11 22:02:05 +02:00
dependabot[bot]
8a43880586
Update gloo requirement from 0.3 to 0.4 (#2123)
Updates the requirements on [gloo](https://github.com/rustwasm/gloo) to permit the latest version.
- [Release notes](https://github.com/rustwasm/gloo/releases)
- [Commits](https://github.com/rustwasm/gloo/compare/0.3.0...0.4.0)

---
updated-dependencies:
- dependency-name: gloo
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-11 16:10:57 +01:00
dependabot[bot]
7d873b264c
Update gloo-console requirement from 0.1 to 0.2 (#2122)
Updates the requirements on [gloo-console](https://github.com/rustwasm/gloo) to permit the latest version.
- [Release notes](https://github.com/rustwasm/gloo/releases)
- [Commits](https://github.com/rustwasm/gloo/commits/0.2.0)

---
updated-dependencies:
- dependency-name: gloo-console
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-11 16:10:31 +01:00
Muhammad Hamza
dd2db93996
Use functions from gloo_utils instead of re-implementing them (#2124)
* Use functions from `gloo_utils` instead of re-implementing them

* Remove `anyhow` dependency

* fix errors

* review + post merge fixes
2021-11-11 16:45:08 +02:00
Kaede Hoshikawa
706fb48f6e
Reliable use_reducer dispatch and use_state setter (#2126)
* Add Redirect Comp.

* Fix router behaviour.

* Fix output.

* Fix pr-flow.

* Remove Redirect.

* Readd 77b46bf.

* Reliable dispatch for use_reducer.

* Detachable Dispatcher and Setter.

* Update docs wording.

* Update website/docs/concepts/function-components/pre-defined-hooks.md

Co-authored-by: Simon <simon@siku2.io>

* Update website/docs/concepts/function-components/pre-defined-hooks.md

Co-authored-by: Simon <simon@siku2.io>

* Update website/docs/concepts/function-components/pre-defined-hooks.md

Co-authored-by: Simon <simon@siku2.io>

Co-authored-by: Simon <simon@siku2.io>
2021-11-11 12:33:33 +01:00
Kaede Hoshikawa
f43760e3ca
Update Yew Router as per #2113 (#2118)
* Add Redirect Comp.

* Fix router behaviour.

* Fix output.

* Fix pr-flow.

* Remove Redirect.

* Readd 77b46bf.

* Router Context, History and Location.

* Finish Porting.

* Add Switch, Fix example.

* Add state.

* Fix pr-flow.

* Fix pr-flow.

* Fix unstable feature for 1.49.

* Add documentation.

* Error Types & Simplify Implementation.

* Add some tests.

* Update documentation.

* Fix route outside of a Switch.
2021-11-11 13:08:42 +02:00
Muhammad Hamza
2f47b09da4
Add custom type for attribute values (#1994)
* Add custom type for attribute values

* fix tests/example

* Remove `PartialEq<String>` and it's usage

* `ReferenceCounted` -> `Rc`

* fucking fake

* please CI, just turn green
2021-11-08 18:11:22 +01:00
Vinícius Miguel
8fd6100874
Remove trailing semicolon in macro used in expression position (#2127) 2021-11-02 14:22:39 +01:00
mc1098
98821c4018
Fix default passive option (#2111) 2021-10-16 22:16:13 +02:00
Kaede Hoshikawa
35e1ba60aa
Fix Some Router Behaviour (#2107)
* Add Redirect Comp.

* Fix router behaviour.

* Fix output.

* Fix pr-flow.

* Remove Redirect.

* Readd 77b46bf.
2021-10-16 20:02:08 +01:00
Julius Lungys
f2a0d617ce
Add set_if_neq for UseStateHandle (#2109)
* add set_neq for UseStateHandle

* add docs

* update based on PR comments 1
2021-10-16 00:25:16 +01:00
mc1098
77b46bfa40
Fix trybuild (#2103) 2021-10-08 01:57:24 +01:00
mc1098
dbd8545a03
Add documentation for wasm-bindgen (#2082)
* 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
2021-10-02 19:59:50 +02:00
mc1098
ae2ebc9776
Add safe first_node fn (#2094)
`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.
2021-10-02 11:20:18 +02:00