2071 Commits

Author SHA1 Message Date
dependabot[bot]
d81c49d1de
Update gloo-file requirement from 0.1 to 0.2 (#2121)
Updates the requirements on [gloo-file](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-file
  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:25:51 +00: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
Muhammad Hamza
20f76e78da
Tidy up documentation (2) (#2137)
* Tidy up documentation.

* Fix spelling (maybe)

* Fix CI

* Update docs/concepts/function-components.md

Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>

* apply review

Co-authored-by: teymour-aldridge <teymour.aldridge@icloud.com>
Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
2021-11-11 16:25:31 +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
Mikola Péter
6edb135a4d
add redirection to crm example (#2119) 2021-11-11 10:16:33 +01: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
Jonathan Birk
3ebd866d13
Minor fixup of tutorial files (#2131)
* Make the talk titles consistent

* Add replacing the hardcoded list of talks with the one generated from data

* Update website/docs/tutorial.md

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

* Update website/docs/tutorial.md

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

Co-authored-by: Simon <simon@siku2.io>
2021-11-05 17:49:57 +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
Drew Hutton (Yoroshi)
05728e1001
Add Function Components Example (#2088)
* feat(examples): add function components todo example

* chore(examples): apply feedback for function components example

* chore(examples): apply more feedback for function components example

* feat(examples): implement custom hook for edit boolean toggle

* chore(examples): prep for merge, add more documentation

* chore(examples): add more descriptive comment to function component hook, fix cargo.toml
2021-10-16 20:05:06 +01: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
5b7d00951e
Update strum_macros (#2117) 2021-10-15 21:35:55 +01:00
Robin Moussu
799a098841
Use git serve --open in the tutorial (#2108)
The line `server listening at 0.0.0.0:8080` isn’t very visible in the
logs of `trunk serve`, and can be easily be lost if the user does
multiple changes before looking at them. A beginner to web development
may not have the reflex to open this address, or may try to open
`dist/index.html` directly. In both cases he will not be able to see its
application.
2021-10-15 21:35:30 +01:00
dependabot[bot]
1e96431995
Update strum requirement from 0.21 to 0.22 (#2115)
Updates the requirements on [strum](https://github.com/Peternator7/strum) to permit the latest version.
- [Release notes](https://github.com/Peternator7/strum/releases)
- [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Peternator7/strum/commits)

---
updated-dependencies:
- dependency-name: strum
  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-10-15 21:15:16 +01:00
mc1098
77b46bfa40
Fix trybuild (#2103) 2021-10-08 01:57:24 +01:00
mc1098
9c8692262b
Add wasm-bindgen docs for versioned yew.rs (#2098) 2021-10-05 15:17:29 +02: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
Muhammad Hamza
78bb994ba2
impl PartialEq for UseStateHandle and UseReducerHandle (#2092) 2021-09-29 11:26:07 +01:00
Jon Cahill
4ab710c0e5
Update tutorial to use use_effect_deps instead of use_effect (#2090) 2021-09-27 13:18:37 +01:00
mc1098
e503c9acda
Remove web_sys re-export (#2084)
* 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
2021-09-27 02:07:38 +02:00
Andrew Straw
0e4be56a18
yew-agent: add missing web-sys features (#2085) 2021-09-26 08:33:00 +01:00
mc1098
c0ee782224
Add services removal in next version warning (#2083)
This adds a caution on the Services overview page that these services
will be removed in the next version of Yew.
2021-09-24 13:13:08 +02:00
Xavientois
97498cdfcd
Use into_prop_value to convert str prop to Option<String> (#2080) 2021-09-24 09:00:39 +02:00
Janis Petersons
a442ce5df5
Component lifecycle scheduler optimizations (#2065)
* yew: partial render deduplication implementation

* yew/scheduler: batching and comment fixes

* yew/scheduler: clippy fixes

* yew/vcomp: add lifecycle debug logging

* ci: add release clippy and cargo check passes

* ci: fix release check

* ci: remove duplicate check calls
2021-09-22 17:57:14 +02:00
mc1098
4ca68e07ca
Fix unmaintained anymap dependency (#2071)
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.
2021-09-21 21:10:14 +02:00
mc1098
7a3dd267c2
Fixes not removing readers in file upload example (#2055)
In the file upload example we store the FileReaders while reading from
the uploaded file but once read we never remove them from the vec.
2021-09-21 21:09:31 +02:00
arctic_hen7
650c438a30
Add Perseus and Sycamore as alternatives (#2066) 2021-09-20 12:52:39 +02:00
mc1098
adb3fcfce1
Update dependencies (#2064)
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.
2021-09-19 11:14:08 +02:00
mc1098
99a91345cd
Fix event handler during capture phase (#2062)
* 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.
2021-09-18 11:10:24 +01:00
mc1098
2ede4ad81c
Remove unused ssri dependency (#2063)
It got updated recently but this dependency is never used.
2021-09-18 11:09:05 +01:00
Kat Marchán
c2ae6b2acf
deps: bump to ssri 7.0 for more permissive license (#2059)
Fixes: #2057
2021-09-16 18:12:17 +01:00
mc1098
c4dee74e4a
Add support for missing boolean attributes (#2051) 2021-09-12 20:03:03 +01:00
mc1098
b04026db59
Fix misleading information on events page (#2046)
The events page made a specific reference to the currentTarget of an
event and provided a link to MDN, however, Yew events have the
currentTarget of `body` when using the `html!` macro because of the global mutliplexer.
2021-09-11 21:33:10 +01:00
mc1098
e65688e20c
Add events page to v0.18 (#2043) 2021-09-10 07:42:37 +01:00
mc1098
83e565a1e6
Add check for hook state (#2042)
This checks if the hook state has been set and if not provides a
specific error message for why the hook state has not been set.
2021-09-09 22:26:31 +02:00
mc1098
9035fa5071
Add documentation for infinite loops (#2040)
* Add documentation for possible infinite loops

Explains with an example of how a component could cause an infinite loop
to occur. This applies to both `v0.18` and `master`.

* Capitalize "Yew"

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

Co-authored-by: Simon <simon@siku2.io>
2021-09-08 23:05:57 +02:00
mc1098
4c6da9aab3
Add fully qualified primitives in proc macro (#2037)
* Add primitive shadowing in macro tests

* Fix primitive types to be fully qualified
2021-09-07 09:40:09 +02:00
mc1098
1ab7779a8f
Remove 'static lifetime from hook init function (#2039)
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.
2021-09-07 09:37:46 +02:00
mc1098
282eb1943f
Expand event documentation for next (#2036)
* Expand event documentation

* Add import for code block

* Fix formatting
2021-09-06 21:02:58 +01:00
Xavientois
eeddcb95be
Add "struct update" syntax to pass props to component (..props instead of with props) (#2024)
* 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>
2021-09-06 06:41:51 +01:00
mc1098
58753d9607
Add no_implicit_prelude to proc macro tests (#2033)
* 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
2021-09-05 23:33:30 +01:00
Matt
df3303f00b
Development tips update: Jetbrains' proc-macro support and functional component template (#2028)
* jetbrains' proc-macro support and functional component template

* fix code fence formatting

* more accurate phrasing

* better template

* better template
2021-09-04 18:28:10 +01:00
mc1098
e1b85b2b80
Move tutorial to next docs (#2032)
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.
2021-09-04 17:38:17 +02:00
mc1098
df9d7ab160
Fix VTag reuse to reset ancestor NodeRef (#2030)
* Add test for VTag reuse not resetting NodeRef

Add a failing test to identify the issue #2029

* Fix NodeRef reset when reusing VTag element
2021-09-03 16:30:57 +01:00
Christian Beier
915abba985
Fix typo in docs listing external libs (#2027) 2021-09-01 13:21:02 +01:00