Commit Graph

47 Commits

Author SHA1 Message Date
伊欧 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 408f6fcdf0.

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

This reverts commit 44a42dfb31.

* 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
mc1098 0f92d4878e
Add focusin and focusout event support (#1945)
* Adds focusin and focusout event support

* Update element-fail.stderr file
2021-07-09 19:21:44 +02:00
mc1098 efcd928c63
Add documentation for VRef (#1923)
* Add documentation for VRef

Documents the way that VRef can be used to hold a web-sys Node value in
Yew.

* Improve phrasing and correct example mistake

Single quotes to double for strings, thankfully we are in Rust not JS
2021-06-17 13:04:14 +02:00
mc1098 778aedafd3
Add documentation for boolean attributes (#1913)
* Add documentation for boolean attributes

Adds documentation for explicit key=value syntax of boolean attributes.

* Improve wording to be more correct for Yew

Rewording to avoid stating that a literal 'true' is required by boolean
attributes.

Make it clear that the html example provided is only functionally
equivalent to the actual output emitted.
2021-06-12 15:31:36 +02:00
Simon f17d370217 Implicit optional attributes (#1637) 2021-06-05 23:00:58 +02:00
Muhammad Hamza 10b67ea18c
Docusaurus v2 (#1872)
* Docusaurus v2

* i18n

* Fix firebase hosting config
2021-05-26 22:32:07 +02:00