351 Commits

Author SHA1 Message Date
dependabot[bot]
1d9daa949f
Bump serde from 1.0.160 to 1.0.162 (#3259)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.160 to 1.0.162.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.160...1.0.162)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-05 19:29:22 +09:00
Kaede Hoshikawa
9cebb09b58
Update dependencies. (#3253) 2023-04-30 20:42:43 +05:00
Kaede Hoshikawa
dbe671e8c4
Fix clippy for Rust 1.69 (#3246)
* Fix clippy for Rust 1.69.

* use std::marker::PhantonData.

* Change callee to caller.
2023-04-28 23:32:11 +05:00
Dillen Meijboom
d0205a8ea3
feat: implement hydration for vraw (#3245) 2023-04-26 02:48:04 +05:00
dependabot[bot]
c38de0e03c
Bump tokio from 1.26.0 to 1.27.0 (#3216)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.26.0 to 1.27.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.26.0...tokio-1.27.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-10 11:40:24 +03:00
Julius Lungys
24d79e840a
Add webkitdirectory to the boolean attributes list (#3214)
* Implement bool IntoPropValue String & AttrValue

* Revert "Implement bool IntoPropValue String & AttrValue"

This reverts commit 8468e7a3d9d5d55fc6e1360e49bb2be9f3772376.

* Add webkitdirectory to the boolean attributes list
2023-04-05 21:40:12 +03:00
Kaede Hoshikawa
934aedbc88
Enable PartialEq for all virtual dom types (#3206)
* Enable PartialEq for VComp.

* Fix VList's children PartialEq.

* Update use context test.
2023-04-04 09:54:29 +09:00
Arniu Tseng
6f4cdf2802
Pass hook dependencies as the first function argument (#2861)
* Add use_effect_with

* Fix doc

* Add NeverEq

* Save as deps-and-runner

* remove with_deps

* fix other use_effect_with_deps

* add migration guide

* fix website

* fix doc test

* return use_effect_base

* fix docs

* fmt

* fix doc tests

* noeq

* use_callback

* finsihing touches

* fmt

* nighly fmt

* fix mistake

---------

Co-authored-by: Julius Lungys <32368314+voidpumpkin@users.noreply.github.com>
2023-04-03 19:15:11 +03:00
Greg Johnston
bdf5712d96
Incremental performance improvements to element creation (#3169)
* enable interning

* intern tag names

* intern attribute keys and event listener types

* intern attribute values

* cache and clone elements

* clean up the node cloning version a bit

* use HashMap instead of Vec for element cache

* Revert "intern attribute values"

This reverts commit 28653c4660dcf1942fab3b0ad7d4c840b96e0f2a.

* add `enable-interning` feature to Yew that activates the same in wasm-bindgen

* remove interning feature
2023-04-02 22:29:21 +03:00
Kaede Hoshikawa
9d7fafa3ff
Make VList's children Rc'ed (#3050)
* Make VList's children Rc'ed.

* Slightly optimise for bundle size.

* Revert manual cloning.

* Add a benchmark.

* Revert "Revert manual cloning."

This reverts commit 1f737f26f85a13e49186df71eb41425387f3aa02.

* Revert "Slightly optimise for bundle size."

This reverts commit 71cf2a1d36f1a99463c68aae3d128aa3be93dc03.

* Add size marker.

* Revert "Add size marker."

This reverts commit 3ca55be4ea309f516d91ecd8e2aa8256dd810d11.

* Update benchmark.

* Fix children_mut visibility.

* Try to exclude add_child behaviour.

* Fix typo.

* Adjust visibility and docs.

* Fix hydration with empty children.
2023-04-02 23:51:59 +09:00
dependabot[bot]
138a74ffc7
Bump serde from 1.0.158 to 1.0.159 (#3192)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.158 to 1.0.159.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.158...v1.0.159)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-02 01:17:49 +03:00
Muhammad Hamza
cc9dd0271e
Update dependencies (#3171)
* Update to syn 2

* bless macro outputs

* update prettyplease

* fix review + update lockfile
2023-03-28 19:41:55 +09:00
Jonas Scholz
b85313b2a2
Add MathML support + test. (#3121)
Co-authored-by: Jonas Scholz <jonas.scholz123@gmail.com>
2023-03-18 13:59:17 +05:00
dependabot[bot]
d63a91c08a
Bump tokio from 1.25.0 to 1.26.0 (#3146) 2023-03-05 10:11:47 +09:00
dependabot[bot]
532b0c7a7d
Bump base64ct from 1.5.3 to 1.6.0 (#3144) 2023-03-05 10:11:18 +09:00
Vlad Beskrovny
c7b7e45e4c
Implement component name completion in html! for IntelliJ Rust plugin (#2972) 2023-02-02 22:36:51 +09:00
Cecile Tonglet
bff497e002
Pass string types to Html props (#2872)
* Pass string types to Html props

* Not sure why passing None explicitly here...

* Update test stderr
2023-02-02 20:00:51 +09:00
Kaede Hoshikawa
65b930acb6
Deduplicate suspensions when considering subsequent renders for suspensions (#3099)
* FIx duplicate suspension.

* Fix tests.

* Fix tests.

* Fix tests.
2023-02-01 22:04:43 +05:00
Kaede Hoshikawa
456a05ba40
Fix clippy for 1.67 (#3100)
* Fix clippy for 1.67

* Fix trybuild.
2023-02-01 21:57:05 +05:00
WorldSEnder
c5ffe601f2
Implement an internal DomSlot for positioning instead of NodeRef (#3048)
use instead of NodeRef, decoupling the two
fixes #3043

* implement internal DomSlot
* move DomSlot into submodule of dom_bundle
* hide behind feature csr
* add test cases
* write get in continuation style, this saves a clone
* private DomSlot::get
2023-01-09 15:08:08 +01:00
Kaede Hoshikawa
b55be12d3c
Prefer pop_first if it is available (#3084) 2023-01-08 23:09:49 +09:00
Cecile Tonglet
d4c2f03c3d
Add method map() on Children to wrap easily (#3039) 2023-01-05 11:30:05 +01:00
Kai Salmon
1542e2b181
Only handle "normal" clicks on <Link>s (#3056)
* Fixing https://github.com/yewstack/yew/issues/2911

Prevents Link onclick behaviour from executing if the Ctrl key (for
Windows and Linux) or Meta Key (For Mac) is pressed.

This technically introduces a bug that means that links will reload the
page on windows machines when the windows key is held down. However,
this error is also in React Router, so I think we can get away with it.

See:
11156ac7f3/packages/react-router-dom/dom.ts (L29)

* Router Links now use default browser behaviour for alt and shift keys.

This change is inspired by 11156ac7f3/packages/react-router-dom/dom.ts (L29)

This allows uses to shift click links to save whatever the link points
at, and alt click on links to open them in new windows
2022-12-22 21:38:26 +01:00
WorldSEnder
aebd225963
Reentrant event listeners (#3037)
* add test case for reentrent event listeners
* use Fn to allow reentrent event listeners
2022-12-21 01:57:55 +00:00
Cecile Tonglet
d14fcd2e2d
Add impl IntoIterator on &Classes (#3038) 2022-12-14 02:07:16 +05:00
WorldSEnder
57f45e2c81
Assert there are no circular references (#3025)
* assert there are no circular references

the check is costly in release builds and should always fail
note that the current PartialEq impl is *not* symmetric!
should be fixed as well, with an improved design

* remove internal test for cyclic node refs

wasm_bindgen does not yet support #[should_panic]
see also https://github.com/rustwasm/wasm-bindgen/issues/2286
2022-12-10 16:36:59 +01:00
WorldSEnder
d7f988055f
Fix top-level reconciliation in portals (#3020) 2022-12-10 14:42:53 +01:00
Cecile Tonglet
772763c2e2
Make Classes cheap to clone (#3021)
* Use AttrValue instead of Cow in Classes

* Wrap indexset into Rc

* Impl ImplicitClone for Classes

* clippy

* Trigger CI

* Update macro stderr

* Copy optimization made for String to AttrValue

* Update macro stderr again
2022-12-10 18:02:36 +05:00
WorldSEnder
9e980a36b4
Fix clippy::let_unit_value lint in propless components (#2970) 2022-12-09 00:10:22 +05:00
IchHabeKeineNamen
77b0d40455
fix: dead links (#3013) 2022-12-06 06:31:35 +00:00
GitHub Action
17f125c9ec (cargo-release) version {{crate_name}}-v{{version}} 2022-11-28 19:14:03 +00:00
Julius Lungys
2fcb2a32bd
Add yew-agent repository, homepage, documentation (#2985) 2022-11-28 20:01:39 +02: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
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
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
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
Muhammad Hamza
ccaa06a2fa
Clippy + update lock files (#2949) 2022-11-05 16:05:08 +01: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
Kaede Hoshikawa
5f6e094996
Use Ref::filter_map if rustc is later than 1.63 (#2904) 2022-10-19 19:45:27 +09: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
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
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
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