230 Commits

Author SHA1 Message Date
Muhammad Hamza
c91364b5c6
make layout testing code public (#2310) 2021-12-28 22:38:56 +02:00
Muhammad Hamza
3758e6d077
Refactor and simplify Callback (#2301)
* yeet Callback::once

* yeet Callback::reform

* remove passive overrides

Event's passive state will be determined by sane defaults set by Yew

* clippy

* docs

* make CI happy

* Revert "yeet Callback::reform"

This reverts commit 33e7770d

* why?

I literally tick-marked reformat before commit. Does it not use rustfmt???

* Update packages/yew/src/callback.rs

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

Co-authored-by: Julius Lungys <32368314+voidpumpkin@users.noreply.github.com>
2021-12-28 21:27:31 +02:00
Alexander Mescheryakov
f0fb40650e
Add pending event listener on the VTag (#2300)
* Add pending event listener on the VTag

* Remove deprecated set_listener and rename add_listener

* Add return value comment
2021-12-28 21:01:33 +05:00
Muhammad Hamza
5181e1aca7
Fix basename handling in router (#2297) 2021-12-26 21:38:05 +02:00
Alexander Mescheryakov
61efc8042e
constify VList::new (#2293)
* Use const constructor for VList and fix EMPTY VList access

* Add comment
2021-12-23 20:57:50 +01:00
Muhammad Hamza
73b5f6b4c1
Allow function_component creation based on function name (#2292)
* function_component without name

* fmt

* fc

* update docs

* remove fc
2021-12-23 13:30:17 +01:00
Matt
ac891de426
Bump Docusaurus to beta 14 (#2288)
* fix docs.rs logo url

* fix formatting

* bump docusaurus to beta14

* bring back the semicolon
2021-12-22 23:29:53 +05:00
Zachary Stewart
a166815b88
Implement IntoPropValue for Rc<str> (#2285)
* add IntoPropValue implementations for Rc<str>

* add test

* update test logs which record the new impls
2021-12-22 01:42:26 +05:00
WorldSEnder
47364b667a
Fix a problem with NodeRefs and vtags, ref (#2279)
* fix #2206
2021-12-20 14:45:39 +05:00
Kaede Hoshikawa
d8ec50150e
Add HashRouter, basename and use gloo-history (#2239)
* Migrate to gloo-history.

* Fix docs wording.

* Add basename handling to navigator.

* Fix basename handling.

* Add lints and tests.

* Fix wording.

* Fix docs.

* Fix pr-flow.

* Fix some documentation.

* Add Navigator Kind.

* Remove history.rs

* Add documentation for navigator & Concrete Router Props.

* Update website/docs/concepts/router.md

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

* Add docs about basename.

* Update documentation.

* Fix docs.

Co-authored-by: Julius Lungys <32368314+voidpumpkin@users.noreply.github.com>
2021-12-19 20:38:33 +05:00
Kaede Hoshikawa
5b0bbd55c9
Fix defaulted type parameter. (#2284)
* Fix defaulted type parameter.

* Add test.
2021-12-19 16:46:32 +05:00
WorldSEnder
f5b921984a
Silence some warnings from derive(Properties) (#2266)
* silence some warnings from derive(Properties)

* for consistency preserve [#deny(..)]

* preserve some attributes on the struct def

adds a test case to check for several warnings

* add #[deny] in test cases to error instead of warning on failure

Co-authored-by: Julius Lungys <32368314+voidpumpkin@users.noreply.github.com>
2021-12-16 14:38:53 +05:00
Matt
1ef364ffda
Add braces when html_nested used on html element (#2270)
* add braces when html_nested used on html element

* run rustfmt
2021-12-15 22:56:24 +01:00
WorldSEnder
c2d39d7d48
Raw field names in property structs (#2273)
* raw property names

* add component test
2021-12-15 22:55:34 +01:00
Matt
2e0fa8eae4
simplfy the readme for yew-router (#2272) 2021-12-15 22:54:54 +01:00
Julius Lungys
f749ca3c83
Move/Remove tools (#2274)
* move tools

* delete yew-validation

* update paths

* fix cargo.toml
2021-12-15 22:53:01 +01:00
Julius Lungys
cf0f59af55
Add paths for yew dependencies (#2265) 2021-12-12 21:19:38 +01:00
GitHub Action
8246827030 (cargo-release) version yew-agent-v0.1.0 2021-12-11 20:12:22 +00:00
Julius Lungys
39724c6d5d
fix yew-agent for release (#2264)
* add mising metadata

* lover version to make it bumpable
2021-12-11 22:09:38 +02:00
GitHub Action
07d569b833 (cargo-release) version yew-router-v0.16.0 2021-12-11 19:58:27 +00:00
Julius Lungys
4515df03ee
Change path versions to tag versions (#2263) 2021-12-11 21:56:01 +02:00
GitHub Action
47a6d080c0 (cargo-release) version yew-router-macro-v0.16.0 2021-12-11 19:48:32 +00:00
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