176 Commits

Author SHA1 Message Date
Muhammad Hamza
0eb167ac78
Remove ToHtml trait (#3453)
* remove ToHtml trait

* re-add display impls

* make Vec::clone expilit

* fix doc

* fix conflicting impls

Into<Html> and Display can't be implemented on the same type

* update docs

* blanket impl won't work here

* bring back `Vec<VNode>: IntoPropValue<VNode>`

* macro tests

* Revert "fix conflicting impls"

This reverts commit 52f3c1fa8174489ba9cc783d708a49cc7b9c90a4.
These impls are fine now

* make examples compile

* .clone() should be before .into()

* Rc VList

* Make use of ImplicitClone and AttrValue in example

(There is more work to do but it's complicated so I will do it in
another PR)

* Impl ImplicitClone on VChild

---------

Co-authored-by: Cecile Tonglet <cecile.tonglet@cecton.com>
2023-10-28 16:11:28 +05:00
Antoine Büsch
afb232668b
Fix 0.20 to 0.21 migration guide (#3460)
The instructions to help migrate from 0.20 to 0.21 using `ast-grep`
erroneously turned `use_future` into `use_effect`.
2023-10-22 18:28:55 +09:00
Jonathan Picques
1bcd539f8f
Fix typo in introduction (#3448) 2023-10-06 22:48:10 +09:00
Ikko Eltociear Ashimine
d79ee6f6d6
Fix typo in editor-setup.mdx (#3432)
avaliable -> available
2023-10-04 21:37:50 +05:00
Daniel Sousa
ede6d91a34
Add body tags (#3425)
* Changes to be committed:
	modified:   website/docs/getting-started/build-a-sample-app.mdx
	modified:   website/versioned_docs/version-0.20/getting-started/build-a-sample-app.mdx

* Changes to be committed:
	modified:   website/versioned_docs/version-0.21/getting-started/build-a-sample-app.mdx

* Update build-a-sample-app.mdx

* Update build-a-sample-app.mdx

* Update build-a-sample-app.mdx
2023-10-03 21:31:32 +09:00
0xflotus
3a365c4059
docs: fix typo (#3437) 2023-10-03 03:14:44 +05:00
Muhammad Hamza
5e823e729d
Prepare for 0.21 release (#3412)
* Update CHANGELOG

Changelog run: https://github.com/yewstack/yew/actions/runs/6283917852/job/17064800916

* docusaurus docs:version 0.21

* migration guide

* blog post

* prettier

* make website warnings go away

* make GA work

* Apply suggestions from code review

* Apply suggestion from review

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

* prettier

---------

Co-authored-by: Kaede Hoshikawa <futursolo@users.noreply.github.com>
2023-09-29 19:10:07 +09:00
Tim Kurdov
30e2d548ef
Added a note about using suspension (#3410)
* added a note about implementing suspending hooks

* fixed formatting

* extracted part of the note into a danger block

* added :::

* added spaces
2023-09-23 23:00:35 +09:00
RazaGR
5bab22da4a
Add neovim configuration to docs (#3400)
* add neovim configuration doc

add neovim configuration documentation to setup with lazy.vim plugin.

* prettier

---------

Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
2023-09-23 18:15:40 +05:00
Tim Kurdov
a2786b1e14
Improve Context API docs (#3409)
* improved context API docs, added example of struct component context producer

* forgot to commit that oops
2023-09-23 14:56:06 +02:00
Daniel Sousa
954b0ec7b9
Correct minor mistakes in website (#3405)
* Remove whitespace in website tutorial

* Update index.mdx

Remove whitespace in tutorial.

* Add more information to website.

Changes to be committed:
	modified:   website/docs/tutorial/index.mdx
	modified:   website/versioned_docs/version-0.20/getting-started/build-a-sample-app.mdx
	modified:   website/versioned_docs/version-0.20/tutorial/index.mdx

* Remove error: doctest failed, to rerun pass `-p website-test --doc`

Changes to be committed:
	modified:   website/docs/migration-guides/yew/from-0_18_0-to-0_19_0.mdx

* Correction of minor mistakes in website.

Changes to be committed:
	modified:   website/docs/getting-started/build-a-sample-app.mdx
	modified:   website/docs/tutorial/index.mdx
	modified:   website/versioned_docs/version-0.20/getting-started/build-a-sample-app.mdx
	modified:   website/versioned_docs/version-0.20/tutorial/index.mdx

* Run Prettier
Changes to be committed:
	new file:   package-lock.json
	modified:   website/docs/tutorial/index.mdx
	modified:   website/package-lock.json
	modified:   website/package.json
	modified:   website/versioned_docs/version-0.20/getting-started/build-a-sample-app.mdx
2023-09-23 17:48:22 +05:00
Pouriya
2cbe6cee8a
feat: support arrays for Classes/classes!() (#3393)
* feat: support arrays for Classes/classes!()

* style: update
2023-09-23 21:38:59 +09:00
Daniel Sousa
b71dbfe17e
Fix failing doc test in migration guide (#3404)
* Remove error: doctest failed, to rerun pass `-p website-test --doc` (#3404)

Changes to be committed:
	modified:   website/docs/migration-guides/yew/from-0_18_0-to-0_19_0.mdx
2023-09-23 17:34:11 +05:00
Daniel Sousa
e249128f12
Remove whitespace in website tutorial (#3402)
* Remove whitespace in website tutorial

* Update index.mdx

Remove whitespace in tutorial.
2023-09-21 17:30:20 +05:00
Sahil Upasane
6b9d1964eb
Link to tailwind trunk example to CSS docs (#3384)
* Update css.mdx

Added how to use tailwind css with yew

* Added how to use tailwind css with trunk on website docs

* ran prettier

* minor fix
2023-09-02 18:36:30 +09:00
Muhammad Hamza
42e1890f03
Update signature of use_prepared_state/use_transitive_state (#3376)
* Update signature of use_prepared_state

* Update signature of use_transitive_state

* Migration guide + example

* bless trybuild tests

* please fmt

* there's one usage here as well

* use_prepared_state_with_suspension needs updates

* updated tests
2023-08-19 21:58:36 +09:00
Muhammad Hamza
41d42fb89d
Make signature of use_future_with consistent (#3372) 2023-08-15 20:32:27 +09:00
Muhammad Hamza
e59edde1d0
Warn about mismatched DOM in SSR docs (#3377)
Fixes: #2684
2023-08-14 22:46:05 +09:00
Muhammad Hamza
05fc4cc819
Suspense example with struct component (#3375)
* Add example for struct component context consumer

* Replace untested docs example with one from examples dir

Fixes #3351
2023-08-14 21:09:38 +09:00
Kaede Hoshikawa
d803df9336
Update documentation around Children (#3297)
* Update Children to use Html.

* Fix website.

* Update website/docs/advanced-topics/children.mdx

* add further reading section

---------

Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
2023-08-05 18:33:23 +05:00
dependabot[bot]
4023c88c39
Bump indexmap from 1.9.3 to 2.0.0 (#3322)
* Bump indexmap from 1.9.3 to 2.0.0

Bumps [indexmap](https://github.com/bluss/indexmap) from 1.9.3 to 2.0.0.
- [Changelog](https://github.com/bluss/indexmap/blob/master/RELEASES.md)
- [Commits](https://github.com/bluss/indexmap/compare/1.9.3...2.0.0)

---
updated-dependencies:
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* Update dependency minimum version

* clippy

* Bump MSRV to 1.64

* more clippy

* Update action that fails (probably outdated)

* Bump implicit-clone to 0.3.8

* Forgot to bump MSRV in some places

* Forgot to update setup-chromedriver in one place

* Bump implicit-clone to 0.4.0

* Update stderr files

* clippy

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cecile Tonglet <cecile.tonglet@cecton.com>
2023-07-29 22:00:53 +09:00
Kaede Hoshikawa
71b0f206a1
Allow any type to be used as Children (take 2) (#3289)
* Partially copy useful implementation.

* Adjust conversion.

* Temporary fix iterator.

* Add ToString implementation.

* Add Renderable trait.

* Make Macro tests pass.

* Add tests for render_prop as Children.

* Update benchmark and Children used in yew packages.

* Selective suppress lints.

* Rollback unintentional rollback.

* Fix rustfmt.

* Remove unneeded implementation.

* Update Comment.

* Rollback more changes.

* Rollback more changes.

* Fix website.

* Fix documentation tests.

* Add prelude.

* Fix test.

* Blanket Implementation for &'_ T for Renderable types.

* Implement Renderable for &str.

* Update signature.

* Update children to Html in examples.

* Remove unnecessary dereferencing.

* Rollback nested_list example.

* Fix comment.

* Convert to Pattern Matching.

* Add tracing issue.

* Rename Renderable to ToHtml.

* Move ToHtml to yew::html.

* Convert more to match pattern.
2023-06-11 15:33:39 +05:00
Valentin Golev
b9990e8410
An experiment macro to automatically derive Properties structs from args for Yew components. (#3275)
* Update properties.mdx

* Update awesome.md

* prettier'
2023-06-01 23:30:39 +09:00
Herrington Darkholme
2c4ea6071b
doc: use a more friendly link to codemod tool (#3266) 2023-05-12 03:18:43 +00: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
Pavlo Myroniuk
c5324aff62
Fix div prop name in css.mdx (#3185)
* Fix div prop name in css.mdx
* Fix div prop name in yew/website/docs/concepts/basic-web-technologies/css.mdx

`styles` is a not existing property in the `div` component. Changed it to `style`
2023-03-28 19:41:14 +09:00
Ruslan S
ad630a987c
Updated tutorial to indicate wasm32 dependencies compatibility (#3150)
That might be obvious for some, but it took me a few hours to figure out that `sqlx` is actually not `wasm32` compatible.
Funny enough, `cargo build` was working just fine, but `trunk serve` was failing with a very misleading error about `openssl`.
Maybe one day that small note will save a few hours to someone else
2023-03-17 21:00:00 +09:00
TechTheAwesome
47b60ec7a2
Add link to the rust-yew vscode plugin to the yew docs (#3116)
* ADD rust-yew to devel docs

* ADD rust-yew to` v0.20 `docs

* FIX run prettier format

* Add community maintained notice and re-formatting
2023-02-22 18:19:11 +01:00
Johannes Sjölund
9556266061
Improve grammar in website/docs (#3092)
* Improve grammar in website/docs

* Futuresolo's changes to website/docs
2023-02-01 22:21:31 +05:00
finga
30a05fcf07
docs: Fix router documentation (#3078)
Fix passing the route instead of borrowing it as it results in an
error.

Co-authored-by: finga <finga@onders.org>
2023-01-09 22:41:33 +09:00
Brian Donovan
ec4eca4fcb
docs: fix markdown link in the debugging section (#3081)
* docs: fix markdown link

It was missing the closing parenthesis.

* docs: fix markdown link

It was missing the closing parenthesis.
2023-01-08 14:03:04 +00:00
Michael Jones
16df0150a9
Fix typo in wasm-bindgen doc page (#2963) 2022-12-20 22:41:58 +09:00
__
a6a442fbc8
website/docs/tutorial: fix two typos (#2971) 2022-12-20 22:38:25 +09:00
Sasa Cocic-Banjanac
ad4c3fc298
Mention certain components must be children of Router (#2913)
* Mention certain components must be children of Router

* make suggested changes

* fix typos

* update documentation with suggested changes again

* change /> to > in comment

* add ticks to Link & Switch in concepts/router.mdx
2022-12-10 18:01:43 +05:00
A. Bos
03cd37f1ea
Update from-0_19_0-to-0_20_0.mdx (#2979) 2022-11-25 14:51:59 +01: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
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
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
Allan
f8fc8859ee
Fix onsubmit event type in docs (#2926) 2022-10-18 21:27:07 +02: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
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
Rico
9484249948
Update index.mdx (#2865)
Removes double "already" in sentence.
2022-09-10 01:01:28 +05:00
WorldSEnder
e60c07f746
Remove mentions of wee_alloc (#2857) 2022-09-03 19:10:48 +05:00
Cecile Tonglet
c7b4029e1b
Add old props to fn changed() (#2851)
* Adding old_props to fn changed()

* Change old_props type to &Self::Properties

* Update examples that use fn changed() and want old_props

* Fix tests

* Fix invalid test flags

* cargo fmt

* Oops wrong regex

* Revert change for older version

* Remove unnecessary clone

* Add migration guide

* Oh wow the test was not running xD
2022-08-31 17:10:45 +05:00
Mike Lloyd
72213eec08
Replace reqwasm with gloo-net (#2832)
* Replace reqwasm with gloo-net

* Use crates.io urls instead of github.com
2022-08-17 13:13:15 +05:00
WorldSEnder
8172b9ceac
Document usage of the tracing crate (#2831) 2022-08-16 20:04:08 +09:00