55 Commits

Author SHA1 Message Date
Nika
b246e0d5ed
Update broken links (#3911)
* tree-wide: update links to https://rustwasm.github.io/wasm-bindgen

https://rustwasm.github.io/wasm-bindgen -> https://wasm-bindgen.github.io/wasm-bindgen
https://rustwasm.github.io/docs/wasm-pack -> https://drager.github.io/wasm-pack/book/
https://rustwasm.github.io/wasm-pack -> https://github.com/drager/wasm-pack
2025-09-01 14:15:44 +00:00
Cecile Tonglet
b00721954a
Better ImplicitClone ergnomics (#3508)
* Use cheap-to-clone types more

* Use IArray in NodeSeq & add IntoPropValue for &AttrValue

* Add function get_mut() on VChild to make things easier

* Use AttrValue in timer_functional example

* fix VList PartialEq

* extract implicit-clone as workspace dep and bump to 0.5.1

* docs: advocate using IArray and IMap instead of Vec and HashMap

* docs: AI translation for lifecycles.mdx in Japanese and simplified Chinese
---------

Co-authored-by: Mattuwu <syan4@ualberta.ca>
2025-08-27 15:21:50 +09:00
Tim Kurdov
f0b182d391
yew: function_component -> component (#3885) 2025-07-21 10:06:41 +09:00
Tim Kurdov
4f3b85e31d
website: make tutorial testable (#3879) 2025-07-19 18:49:07 +09:00
Tim Kurdov
fd96a9abca
Add for-loops to html! (#3498) 2025-07-15 15:29:27 +09:00
Jens Reimann
84e882ead5 docs: explain how to use comments
Closes: #2910
2025-03-01 23:17:38 +09:00
dependabot[bot]
7ea787285e
Bump the website-deps group across 1 directory with 15 updates (#3798)
* Bump the website-deps group across 1 directory with 15 updates

Bumps the website-deps group with 14 updates in the /website directory:

| Package | From | To |
| --- | --- | --- |
| [@docusaurus/core](https://github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus) | `3.5.2` | `3.7.0` |
| [@docusaurus/plugin-client-redirects](https://github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus-plugin-client-redirects) | `3.5.2` | `3.7.0` |
| [@docusaurus/preset-classic](https://github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus-preset-classic) | `3.5.2` | `3.7.0` |
| [@mdx-js/react](https://github.com/mdx-js/mdx/tree/HEAD/packages/react) | `3.0.1` | `3.1.0` |
| [docusaurus-plugin-sass](https://github.com/rlamana/docusaurus-plugin-sass) | `0.2.5` | `0.2.6` |
| [react](https://github.com/facebook/react/tree/HEAD/packages/react) | `18.3.1` | `19.0.0` |
| [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) | `18.3.10` | `19.0.8` |
| [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom) | `18.3.1` | `19.0.0` |
| [sass](https://github.com/sass/dart-sass) | `1.79.4` | `1.83.4` |
| [@docusaurus/tsconfig](https://github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus-tsconfig) | `3.5.2` | `3.7.0` |
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `8.8.0` | `8.22.0` |
| [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `8.8.0` | `8.22.0` |
| [prettier](https://github.com/prettier/prettier) | `3.3.3` | `3.4.2` |
| [typescript](https://github.com/microsoft/TypeScript) | `5.6.2` | `5.7.3` |



Updates `@docusaurus/core` from 3.5.2 to 3.7.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/v3.7.0/packages/docusaurus)

Updates `@docusaurus/plugin-client-redirects` from 3.5.2 to 3.7.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/v3.7.0/packages/docusaurus-plugin-client-redirects)

Updates `@docusaurus/preset-classic` from 3.5.2 to 3.7.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/v3.7.0/packages/docusaurus-preset-classic)

Updates `@mdx-js/react` from 3.0.1 to 3.1.0
- [Release notes](https://github.com/mdx-js/mdx/releases)
- [Changelog](https://github.com/mdx-js/mdx/blob/main/changelog.md)
- [Commits](https://github.com/mdx-js/mdx/commits/3.1.0/packages/react)

Updates `docusaurus-plugin-sass` from 0.2.5 to 0.2.6
- [Release notes](https://github.com/rlamana/docusaurus-plugin-sass/releases)
- [Commits](https://github.com/rlamana/docusaurus-plugin-sass/compare/v0.2.5...v0.2.6)

Updates `react` from 18.3.1 to 19.0.0
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v19.0.0/packages/react)

Updates `@types/react` from 18.3.10 to 19.0.8
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

Updates `react-dom` from 18.3.1 to 19.0.0
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v19.0.0/packages/react-dom)

Updates `sass` from 1.79.4 to 1.83.4
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.79.4...1.83.4)

Updates `@docusaurus/module-type-aliases` from 3.5.2 to 3.7.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/v3.7.0/packages/docusaurus-module-type-aliases)

Updates `@docusaurus/tsconfig` from 3.5.2 to 3.7.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/v3.7.0/packages/docusaurus-tsconfig)

Updates `@types/react` from 18.3.10 to 19.0.8
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

Updates `@typescript-eslint/eslint-plugin` from 8.8.0 to 8.22.0
- [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/v8.22.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 8.8.0 to 8.22.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.22.0/packages/parser)

Updates `prettier` from 3.3.3 to 3.4.2
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.3.3...3.4.2)

Updates `typescript` from 5.6.2 to 5.7.3
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.6.2...v5.7.3)

---
updated-dependencies:
- dependency-name: "@docusaurus/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: website-deps
- dependency-name: "@docusaurus/plugin-client-redirects"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: website-deps
- dependency-name: "@docusaurus/preset-classic"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: website-deps
- dependency-name: "@mdx-js/react"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: website-deps
- dependency-name: docusaurus-plugin-sass
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: website-deps
- dependency-name: react
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: website-deps
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: website-deps
- dependency-name: react-dom
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: website-deps
- dependency-name: sass
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: website-deps
- dependency-name: "@docusaurus/module-type-aliases"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: website-deps
- dependency-name: "@docusaurus/tsconfig"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: website-deps
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: website-deps
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: website-deps
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: website-deps
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: website-deps
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: website-deps
...

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

* chore: fix formatting

* chore: bump prettier (can't reproduce element.mdx warning locally?)

* workflow: show formatting diff for locally unproduceable errors

* chore: format elements.mdx

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matt Yan <syan4@ualberta.ca>
Co-authored-by: Siyuan Yan <44753941+Madoshakalaka@users.noreply.github.com>
2025-02-21 07:33:40 +09:00
Tim Kurdov
0091679779
Make <textarea> a void element (#3465)
* made <textarea> a void element
* added defaultvalue special attr to <textarea>
* updated error message when trying to pass children to textarea

* updated docs, fixed formatting
* fixed hydration test
* fixed suspense test
* fixed heading in docs
* fixed clippy warnings
* fixed SSR, added SSR test for precedence of value over defaultvalue
* fixing wasm-bindgen-test screwups & replacing deprecated function use
2025-02-20 18:13:07 +00:00
伊欧
d77cf0196b
Prepare for 0.22 release (#3750)
* Update CHANGELOG
https://github.com/yewstack/yew/actions/runs/11314974928/job/31465588862

* Add items.

* Write blog.

* Archive the documents.

* Add author.

* Update SSR document.

* Fix typo.

* Add simplified Chinese translation.

* Update package.json

* Sync documents

* Add traditional Chinese translation.

* Sync documents

* Add Japanese translation.

* Sync documents

* Fix typo by `fmt:write`.

* Fix typo by `write-translations`.

* Apply suggestions from code review

* Fix typo.

* #3769 in changelog

---------

Co-authored-by: Elina <imelina@elina.website>
2024-12-17 16:27:02 +08:00
Jonathan Picques
1bcd539f8f
Fix typo in introduction (#3448) 2023-10-06 22:48:10 +09: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
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
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
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
Allan
f8fc8859ee
Fix onsubmit event type in docs (#2926) 2022-10-18 21:27:07 +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
Udasi Tharani
acecfabce7
[Docs] String Literals Behavior (#2734)
* add note for string literals in docs

* Apply suggestion from review

Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
2022-06-19 16:51:56 +00:00
WorldSEnder
74c1a709a8
Update a bunch of outdated links (#2723)
* update a bunch of outdated links

* run prettier

* bump deps

* update translations

* change missed translation links
2022-06-13 14:18:08 +02:00
Douglas Sousa
151a6c6481
Update docs attrvalue (#2725)
* update: Promote use of AttrValue instead of String or Rc<String>

* update: Also mention AttrValue in the elements' page

* format: ran fmt:write to correct formatting issue

* fix: refactor doc comments to conform to compiling rules
2022-06-13 13:50:53 +02:00
Maximilian von Hohenbühel
4d6329a755
Update introduction.mdx (#2730)
* Update introduction.mdx

The `if else` example was syntactically correct, but had a semantic issue of not using the condition variable. Could lead to confusion if you are a newbie.

* Update conditional-rendering.mdx

changed if condition variable in html docs
2022-06-12 23:13:47 +09:00
Mark Wainwright
9d00e0ede7
Added notes to the documentation about SVG tag casing (#2703)
* Note about tag casing and fixed example

* Added notes about tag casing

* Removed broken part of SVG example

* Slight change to SVG example

* removed some newlines

* Update website/docs/concepts/html/introduction.mdx

Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com>

Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com>
2022-05-25 15:52:34 +05:00
WorldSEnder
88e4673264
Document event delegation (#2668) 2022-05-07 21:19:32 +05:00
WorldSEnder
cd5b8a520c
Improve grammar and paragraph structure in documentation (#2620)
* Read through the docs and correct spelling and grammar

* Run prettier

* Apply review suggestions

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

* adjust translation messages

Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
2022-04-20 16:41:42 +05:00
WorldSEnder
dc60d6099e
Fix links and add CI checks in documentation (#2595)
* Docs overhaul part2

* fix links and require them for CI
* remove translations for 0.17

* remove a bunch of unused documentation

* run prettier

* fixup links and locations of some translations
2022-04-10 21:01:18 +00:00
Muhammad Hamza
3ad4dbe837
Format website with prettier (#2536)
* add prettier

* ci

* run prettier

* run prettier in CI

* run prettier --write

* ignore README.md

* specify googleAnalytics

* fmt

* npm run write-translations

* fmt

* ignore i18n json files

they're autogenerated and don't like being formatted

* post merge fixes & some updates

* post merge fixes
2022-04-06 22:52:15 +05:00
WorldSEnder
ee6a67e3ea
Scoped event handlers (#2510)
* implement event handling with multiple subtree roots
* add listeners to all subtree roots
* move host element to Registry
* add BSubtree argument
* surface level internal API for BSubtree
* cache invalidation & document limitations
* Update portal documentation
* Add test case for hierarchical event bubbling
* add shadow dom test case
* add button to portals/shadow dom example
* change ShadowRootMode in example to open

BSubtree controls the element where listeners are registered.
 we have create_root and create_ssr

Async event dispatching is surprisingly complicated.
Make sure to see #2510 for details, comments and discussion

takes care of catching original events in shadow doms
2022-03-25 17:09:15 +01:00
Julius Lungys
70c9a71ff3
update HTML concept to use function components (#2511)
* update HTML concept to use function components

* adress comments 1

* fix test

* adress comments 2

* code outside of html
2022-03-20 13:22:55 +02:00
Peter Kolloch
3a11f15ec5
[events.mdx] relative link to use_deps_with_effects fixed (#2491)
Co-authored-by: Peter Kolloch <peter.kolloch@nexxiot.com>
2022-03-05 01:06:17 +01:00
Peter Kolloch
451227fe5c
[Events] Cross references to use_effect_with_deps (#2486)
Figuring out how to use manual event listening with Function Components
took me a while. The new docs already contain a great example!

I add a small cross reference here to make it more discoverable.

Co-authored-by: Peter Kolloch <peter.kolloch@nexxiot.com>
2022-03-03 16:40:01 +01:00
Jabez Borja
4f65b3961f
docs: fix typo (#2450) 2022-02-11 09:32:57 +01:00
Teymour Aldridge
c7599c54d8
Tidy up the documentation. (#2404)
- fix a number of typos/grammatical errors
- also includes some stylistic changes
2022-01-25 23:14:36 +02:00
Muhammad Hamza
f6f0e34d0f
Overhaul Documentation (#2321)
* Reorganize docs

* delete wasm-build-tools.mdx

* more small updates

* i hate versioned docs

* seems like I've got the traits of the certain owl who guards over the civilization when it comes to `;`

* just work please

* Update website/docs/concepts/components/lifecycle.mdx

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

* little things

* post merge fixes

* npm update

Co-authored-by: Julius Lungys <32368314+voidpumpkin@users.noreply.github.com>
2022-01-05 17:49:26 +02:00
Kaede Hoshikawa
7d52858d01
Remove context & job agent (#2295)
* Remove context and job agent.

* Revert "Remove context and job agent."

This reverts commit 408f6fcdf062800c9e9852e6662a55ff3eef4533.

* Revert "Revert "Remove context and job agent.""

This reverts commit 44a42dfb313c111ceaa654163c8aa610a88e6a95.

* Update example.

* Fix docs.

* Fix test.

* Rename examples.

* Fix examples & docs.

* Update website/docs/concepts/function-components/custom-hooks.mdx

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

* Examples in alphabetical order.

Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
2021-12-29 17:15:26 +05:00
Matt
90b4e55ebc
Docusaurus Overhaul (#2275)
* change suffixes from md to mdx
fix broken links for English locale
tree shake and update docusaurus
add docusaurus ideal image plugin
use svg and themed image
delete unused static asset

* move localized landing page

* change GitLocalize project page

* nit pick

* remove ignore to have the block checked
2021-12-20 12:10:45 +02:00
Muhammad Hamza
996bf5b41a
Final documentation touch ups & tag 0.19.0 (#2220)
* some documentation fixes

* more fixes

* why it didn't work before is beyond me

* next redirect

* change 0.18 docs folder structure to make it inline with next

* move docs to /docs

now that home is its own page, docs should be under `/docs/`

* tag 0.19.0 version on website
2021-11-30 00:06:51 +05:00
Julius Lungys
399a5e8790
Update docosaurus to v2 beta 9 (#2215)
* Update docosaurus to v2 beta 9
- Also fix tabs
- Add toml language highlighting

* move around introduction files

* fix link
2021-11-29 14:19:29 +05:00
Julius Lungys
8d674c5fda
Add key docs and Move fragments docs (#2178)
* Add key docs

* add frogments to sodebar

* remove duplicate title

* Apply suggestions from code review

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>

* Apply suggestions from code review

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

* remove html comments

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
2021-11-23 09:01:58 +05: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
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
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
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
ed2e1ea00e
Add testing for website code blocks (#2014)
* Add doc-test to test website code snippets

Heavily inspired by tokio-rs/website repo.

* Fix code snippets to pass doc tests

Some code snippets are explicitly ignored and some are not run
to avoid having to include dependencies for one liners.

* Add website code snippet tests to CI

* Fix CI

* Remove doc-test from workspace

* Exclude doc-test from workspace

* Refactor code snippets and tests

Code snippets can import types from doc_test crate i.e.:
```rust
use doc_test::agents::EventBus;
```
This allows for moving some boilerplate away from the example and still
checks that the code compiles correctly.

Also some slight changes to some of the examples and the information
about `ComponentLink` which is deprecated.

* Move doc-test to packages

* Rename doc-test crate to website-test

The new name makes it more clear the purpose of this crate.

* fix ci
2021-08-28 13:17:28 +02:00
mc1098
4e974dad92
Remove ShouldRender type alias (#2011)
Remove `ShouldRender` type alias for bool. In the Component trait an
extra comment has been added to explain what the returned bool
represents.
2021-08-25 17:52:09 +02:00
Muhammad Hamza
f50c8c3cba
Components v2 (2) (#1961)
* Start rewrite

* Rc > cloning props

* fmt + rm useless file

* move props inside `Context`

* router compiles

* fix boids example

* fix counter example

* fix crm example

* fix dyn_create_destroy_apps example

* fix file_upload example

* fix futures example

* fix game_of_life example

* fix inner_html example

* fix js_callback example

* fix mount_point example

* fix keyed_list example

* fix web_gl example

* fix two_apps example

* fix todomvc example

* fix timer example

* fix store example

* fix nested_list example

* fix node_refs example

* fix pub_sub example

* fix multi_thread example

* don't call `changed` if props weren't changed

* formatting

* fix doc tests, remove neq_assign

* update router example, fix neq_assign compile errors

* fix macro/rest of doc tests

* start updating documentation

* `Component`'s documentation

* Apply suggestions from code review

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>

* Apply suggestions from code review (part 2)

* Apply suggestions from code review (part 3)

* fix context

* clippy

* post merge fixes

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
2021-08-25 13:11:39 +01:00
mc1098
c6099cf875
Remove InputData & ChangeData (#2000) 2021-08-16 18:02:14 +02:00
Xavientois
4a14d0f0a4
Add requirement for braces around most props (#1939)
* Limit the properties to literals and brace-enclosed expressions

* Update examples with new syntax

* Update packages/yew-macro/src/props/prop.rs

Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>

* Fix lints and strip braces around single expressions

* Update docs with new prop syntax

* Add some test cases for new syntax

* Ensure all tests are passing

* Clean up missed code

* Update tests

* Update reverted docs

* Revert versioned docs

* Fix optional attributes paragraph

* Remove accidentally added files

* Remove accidentally added french docs

* Update packages/yew-macro/src/props/prop.rs

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>

* Fix forgotten braces and test cases

* Revert i18n old docs

* Revert translated docs

* Remove suggested fix in favour of more succinct error message

* Update errors after rebase

* Remove files accidentally added while rebasing

* Fix merge conflicts

Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
2021-07-18 18:54:21 +02:00
Muhammad Hamza
2412a68bee
Refactor and cleanup codebase (#1842)
* remove yew-dsl

* remove yew-components

* remove yew-services

* remove yew::format

* fix CI

* move yew::agent to yew-agent crate

* move yew-functional to yew

plus a couple of misc fixes

* move futures and neqassign out of yewtil

* move yewtil::store to yew_agent, remove yewtil

* formatting

* fix tests

* update docs

* use `rustwasm` gloo repo instead of mine

* add docs

* use rustwasm/gloo repo

* remove unused file

* fix Makefile.toml

* Fix issues after rebase

* Apply suggestions from code review (part 1)

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>

* Apply suggestions from code review (part 2)

* move `#[function_component(_)]` tests

missed those before

* Apply suggestions from code review

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
2021-07-18 15:57:09 +02:00