2310 Commits

Author SHA1 Message Date
Julius Lungys
2fcb2a32bd
Add yew-agent repository, homepage, documentation (#2985) 2022-11-28 20:01:39 +02:00
Ophir LOJKINE
f4a0e2d0a2
Fix typo in release notes (#2982) 2022-11-27 00:51:03 +00:00
brahms116
6e3fa1b6c7
Update example cargo toml in build sample app docs (#2981)
Updated cargo toml to target yew version "0.20.0"
2022-11-26 21:01:27 +05:00
A. Bos
03cd37f1ea
Update from-0_19_0-to-0_20_0.mdx (#2979) 2022-11-25 14:51:59 +01:00
GitHub Action
e32d8bd8bb (cargo-release) version {{crate_name}}-v{{version}} 2022-11-25 18:28:11 +05:00
GitHub Action
05d2ec4434 (cargo-release) version {{crate_name}}-v{{version}} 2022-11-25 18:28:11 +05:00
GitHub Action
09a7f2f457 (cargo-release) version {{crate_name}}-v{{version}} 2022-11-25 18:28:11 +05:00
GitHub Action
1bbe75ec9b (cargo-release) version {{crate_name}}-v{{version}} 2022-11-25 18:28:11 +05:00
Muhammad Hamza
de9c1ebb39 Interpolate string properly 2022-11-25 18:28:11 +05:00
Muhammad Hamza
6dc1bda70a Fix publish actions 2022-11-25 18:28:11 +05:00
Muhammad Hamza
80ce114663
Do not commit and push changelog during release (#2977)
This is done prior to the release
2022-11-25 10:45:50 +00:00
Muhammad Hamza
f0209c786f
Prepare for Yew 0.20 (#2973)
* 0.20 Changelog

* Improve changelog generator

* Add blog post

* Add blog post

* Apply suggestions from code review

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

* update Changelog

* update Cargo.toml

* changelog gen compiles

* website version 0.20

* add migration guides

* prettier

* i18n

Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com>
Co-authored-by: Julius Lungys <32368314+voidpumpkin@users.noreply.github.com>
2022-11-25 15:19:07 +05:00
Julius Lungys
5355b65ff5
Fix changelog generator (#2958)
Co-authored-by: Julius Lungys <jl@nikulipe.com>
2022-11-10 01:15:27 +09:00
Muhammad Hamza
40d2c9c5cf
Fix changelog workflow (#2954) 2022-11-08 23:02:29 +05:00
Muhammad Hamza
90c7ff105a
Add VNode::from_html_unchecked (#2842)
* Add VNode::html_from_raw

* Add docs for VNode::html_from_raw

* feature lock to available flags

* Actually raw

* Formatting + docs

* Tests

* More tests + docs

* fmt

* clippy

* CI

* No <div> around multi top-level nodes

* Update docs

* Fix braw detach

* Clippy & fmt

* Fix compile errors

* I hope you get attacked by Cow, Clippy

* Address review

* Reduce DOM calls

* improve detach bundle impl

* Add more tests

* Update example

* fmt

* Apply review suggestions

* fmt

* fix ci

* fix braw shift with multiple nodes

* rename function name

* fmt

* this should've been there

* ci be green
2022-11-08 21:24:49 +05:00
Allan
a5f844ddcb
Use keyed lists in tutorial example (#2948)
* Use keyed lists in tutorial example

The example should follow best practices such as using keyed lists.

* Add keys explanation when it is first introduced

* Fix link to keyed lists

* Add forgotten key prop
2022-11-08 21:22:42 +05:00
WorldSEnder
3b4fa888bc
add ability to update app props (#2951) 2022-11-08 21:22:05 +05:00
Christopher Schramm
b649e9dacd
Avoid clippy::let-underscore-drop (#2952)
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`.
2022-11-08 21:21:06 +05:00
Allan
812c65c54c
Improve debugging page in docs (#2928)
* Improve debugging page in docs

- add gloo console logging as an option
- moved subsubheading "Latest Info" under "Source Maps" to a subheading "Past Articles", which makes more sense for the content
- updated examples for `wasm-logger` and also made an equivalent one for `gloo-console`

I removed a lot of text to make it easier to read and improve clarity.
I did look it over but there may be other info you'd like to keep on the page.

I wanted to add more for `panics` but I wasn't sure what to put.

* Run Prettier

* Mention tracing-web under console logging

The source map support is also changed but will require more explanation.
2022-11-07 10:23:54 +01:00
David M. Golembiowski
1f49353361
Proposed Documentation Improvements (#2883)
* Proposed Documentation Improvements

#### Retrieved from https://yew.rs/docs/concepts/wasm-bindgen#jsvalue on 9/24/2022
`JsCast` is nicely structured so far, although I thought this section was worded strangely.
> The `dyn_into` method will consume `self`, as per convention for into methods in Rust, __and the type returned is `Result<T, Self>` this means if the casting fails then the value in `Err` is so you can try again or do something else with the original type.__

I believe this edit conveys the original idea, but makes more sense to the reader:

> The
[`dyn_into`](https://rustwasm.github.io/wasm-bindgen/api/wasm_bindgen/trait.JsCast.html#method.dyn_into)
method will consume `self`, as per convention for into methods in Rust, and the type returned is
`Result<T, Self>`. This means if the casting fails then the `Self` value in `Err` is preserved. You could try again
or do something else with the original type.

* Update website/versioned_docs/version-0.19.0/concepts/wasm-bindgen/introduction.mdx

Co-authored-by: Kaede Hoshikawa <futursolo@users.noreply.github.com>

* update latest docs

Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
Co-authored-by: Kaede Hoshikawa <futursolo@users.noreply.github.com>
2022-11-06 18:42:46 +05:00
Nadir Miralimov
81be10870a
Fix code listing in tutorial/index.mdx (#2836)
* Fix code listing in tutorial/index.mdx

Sync with line 358

* update latest tutorial

Changes here should be enough

Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
2022-11-06 18:29:03 +05:00
Tilman
868b2c235a
Fix +/- marker and highlighting with ignore in the tutorial (#2939)
* Fix missing +/- markers

* Fix missing period

* Fix change highlights lines

* Fix missing +/- markers and ignore highlights

* Fix missing period.

* Fix changes hightlighters

* Fix one space too many
2022-11-06 18:18:03 +05:00
Muhammad Hamza
ccaa06a2fa
Clippy + update lock files (#2949) 2022-11-05 16:05:08 +01:00
Muhammad Hamza
374e5f107e
Imrpove home page and slogan (#2940)
* Redo home page

* formatting

* write translations

* responsive layout

* Update features & tagline

* fmt

* no safe
2022-11-04 21:09:56 +05:00
Kaede Hoshikawa
da09755c27
Separate Yew Platform (#2893)
* Remove pinned module.

* Create Yew Platform.

* Remove some additional dependencies.

* Fix clippy.

* Restore wasm-bindgen-futures.

* Fix docs.

* Migrate to prokio.

* Fix docs warnings.

* Fix dependencies.
2022-10-21 06:56:15 +09:00
Fangdun Tsai
71408e2e56
chore(awesome): add viz.rs (#2929) 2022-10-21 06:41:37 +09:00
Bocar
ff729cbe4a
Add new line indicator to tutorial/index.mdx (#2906)
* Add new line indicator to tutorial/index.mdx

* Add line 3 to set of highlight lines

* Add changes to docs/tutorial/index.mdx
2022-10-21 00:14:50 +05:00
Nils Loewen
730f25c46b
Fix typo in contrib instructions cargo make tests -> cargo make test (#2909)
* Fix typo in contrib instructions `cargo make tests` -> `cargo make test`

* Use `cargo make test-flow` for running all tests

* Remove 'WebSocket service tests' section from CONTRIBUTING.md
2022-10-19 19:46:35 +09:00
Kaede Hoshikawa
5f6e094996
Use Ref::filter_map if rustc is later than 1.63 (#2904) 2022-10-19 19:45:27 +09:00
Allan
f8fc8859ee
Fix onsubmit event type in docs (#2926) 2022-10-18 21:27:07 +02:00
Aftab Alam
8c97bfbb9b
updated README.md (#2919)
* updated README.md

added hyperlink to banner

* updated hyperlink linked to Examples

the link is updated. now the text 'Examples' when clicked redirects to the master branch and with that to the up-to-date examples.
2022-10-15 16:15:51 +02:00
Ilaygoldman
fb264c9487
Change link of repojacking vulnerable link (#2915)
* Change link of repojacking vulnerable link

The link to https://github.com/youncccat/zzhack is vulnerable to repojacking (it redirects to the orignial project that changed name), you should change the link to the current name of the project. if you won't change the link, an attacker can open the linked repository and attacks users that trust your links

* fixing all vulnerable repojacking list
2022-10-11 21:17:09 +02:00
Muhammad Hamza
7ada3447bb
Fix issues with tuples in closing tag (#2886)
* Add test case for #2225

* Fix issues with tuples in closing tag

* Improve diagnostics

* fmt

* better diagnostics
2022-10-08 20:59:08 +05:00
WorldSEnder
bb71b5db61
Fix checked property being reset (#2907)
if the value is uncontrolled, do not touch it. Only if it is explicitly given
2022-10-08 20:50:19 +05:00
Muhammad Hamza
426a1fd81d
Evaluate props in the order they're defined (#2887)
* don't change order of props

* rename `SortedPropList` to `PropList`

* docs + test

* remove dead code

* fmt
2022-10-08 10:40:55 +02:00
wdcocq
32b3150cb3
Fix panic because of unwrapping when resuming suspension (#2902)
* Replace unwrap with if let to prevent panic

* Add resume after unmount test

* Change BaseSuspense methods to associated functions

* Fix rustfmt issues
2022-10-04 05:45:46 +02:00
Marcel
ee92b6d305
Async example (#2892)
* Async example

* Formatted

* Demo send_future and send_stream

* Better comment

* Reduce dependencies

* Typo

* Remove tokio_stream dependency

* Remove tokio dependency

* Formatting

* Variety of async methods

* Updated README

* Remove wasm-bindgen-futures dependency
2022-10-03 16:33:16 +05:00
dependabot[bot]
de065cf0c4
Bump @docusaurus/theme-classic from 2.0.1 to 2.1.0 in /website (#2897)
Bumps [@docusaurus/theme-classic](https://github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus-theme-classic) from 2.0.1 to 2.1.0.
- [Release notes](https://github.com/facebook/docusaurus/releases)
- [Changelog](https://github.com/facebook/docusaurus/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/docusaurus/commits/v2.1.0/packages/docusaurus-theme-classic)

---
updated-dependencies:
- dependency-name: "@docusaurus/theme-classic"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 03:20:12 +09:00
Will Lee
a1c30cd4a5
* fix bug - filter the exact entry to set state.edit_value in examples/todomvc (#2895)
Co-authored-by: lizhigang <lizhigang@magictavern.com>
2022-10-03 02:24:52 +09:00
dependabot[bot]
55cda9623b
Bump @docusaurus/plugin-client-redirects from 2.0.1 to 2.1.0 in /website (#2899)
Bumps [@docusaurus/plugin-client-redirects](https://github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus-plugin-client-redirects) from 2.0.1 to 2.1.0.
- [Release notes](https://github.com/facebook/docusaurus/releases)
- [Changelog](https://github.com/facebook/docusaurus/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/docusaurus/commits/v2.1.0/packages/docusaurus-plugin-client-redirects)

---
updated-dependencies:
- dependency-name: "@docusaurus/plugin-client-redirects"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 02:23:52 +09:00
dependabot[bot]
a1da962953
Bump @typescript-eslint/eslint-plugin from 5.33.0 to 5.38.1 in /website (#2898)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.33.0 to 5.38.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.38.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 02:23:31 +09:00
dependabot[bot]
6d965612d5
Bump @easyops-cn/docusaurus-search-local in /website (#2901)
Bumps [@easyops-cn/docusaurus-search-local](https://github.com/easyops-cn/docusaurus-search-local) from 0.31.0 to 0.32.0.
- [Release notes](https://github.com/easyops-cn/docusaurus-search-local/releases)
- [Changelog](https://github.com/easyops-cn/docusaurus-search-local/blob/master/docusaurus-search-local/CHANGELOG.md)
- [Commits](https://github.com/easyops-cn/docusaurus-search-local/compare/v0.31.0...v0.32.0)

---
updated-dependencies:
- dependency-name: "@easyops-cn/docusaurus-search-local"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 02:23:03 +09:00
WorldSEnder
0ecee11a2f
Fix portal shifting on reconciliation too often (#2891)
* 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
2022-09-28 09:32:19 +03:00
Muhammad Hamza
6c91afa13e
Document how to specify attributes and properties (#2888) 2022-09-27 00:03:05 +09:00
Tobias
6aa5b16601
fix wrong link going to inappropiate site (#2889) 2022-09-26 07:04:53 +05:00
Dietmar Maurer
73d9c04782
Context: cleanup - avoid storing a copy of children (#2885)
The new changed() signature allows accessing old_props, so
there is no more need to store an additional copy of children.
2022-09-25 18:42:30 +05:00
Andrew Davis
de851f0ba5
Fix outdated info about interface types proposal (#2880)
* Update status of wasm Interface Types / Component Model Proposals
The Interface Types proposal has been superseeded by the Component
Model Proposal. Updating index.mdx with correct information.

* Improvements to wording of webassembly component model description
The same thing can be said a little more compactly.
2022-09-25 21:55:57 +09:00
Muhammad Hamza
9e0d7966bc
Make Yew lints opt-in (#2882)
* Add compiler flag for Yew lints

* Use --cfg yew_lints in CI

* Remove lints feature

* bless the fail.stderr

* Fix CI
2022-09-25 21:54:24 +09:00
Muhammad Hamza
7e24fb3c58
Clippy fixes (#2881)
* Clippy in root

* Clippy in examples

* didn't mean to commit this file
2022-09-25 21:25:23 +09:00
Nathan West
6751946477
Various improvements to Classes, oriented around reducing allocations (#2870)
* 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
2022-09-21 13:41:10 +09:00