12 Commits

Author SHA1 Message Date
Matt Yan
72b4c0ed9d use latest wasm-opt 2025-03-02 23:56:22 +09: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
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
Jedd Dryden
a53a045970
Simplified and Uniform Example Instructions (#3113)
* Add `--open` to `boids`

* Added running instructions to `contexts`

* Amended `counter` instructions

- Added `--open` flag
- Removed unnecessary instructions on how to run with `release` profile

* Amended `counter_functional` instructions

- Added `--open` flag
- Removed unnecessary instructions on how to run with `release` profile

* Amended `dyn_create_destroy_apps` instructions

- Added `--open` flag
- Removed unnecessary instructions on how to run with `release` profile

* Added running instructions to `file_upload`

* Added running instructions to `function_memory_game``

* Amended `function_router` instructions

- Amended `release` profile instructions
- Added `--open` flag

* Added running instructions to `function_todomvc`

* Added running instructions to `futures`

* Added running instructions to `game_of_life`

* Added running instructions to `immutable`

* Added running instructions to `inner_html`

* Added running instructions to `js_callback`

* Amended `keyed_list` instructions

- Added `--open` flag
- Amended `release` profile notice

* Added running instructions to `mount_point`

* Added running instructions to `nested_list`

* Added running instructions to `node_refs`

* Amended `password_strength` instructions

- Added `--open` flag
- Amended `release` profile notice

* Added running instructions to `portals`

* Amended `router` instructions

- Added `--open` flag
- Amended `release` profile notice

* Amended `simple_ssr` instructions

- Simplified wording
- Removed unnecessary notes
- Changed commands so that they should be executed from the `examples/simple_ssr` directory like every other example

* Amended `ssr_router` instructions

- Removed unnecessary notes
- Changed commands so that they should be executed from the `examples/ssr_router` directory like every other example

* Added running instructions to `suspense`

* Added running instructions to `timer`

* Added running instructions to `todo_mvc`

* Added running instructions to `two_apps`

* Added running instructions to `web_worker_fib`

* Added running instructions to `webgl`

* Amended various examples

- Simplified running instructions
- Moved running instructions to the bottom of each `README.md`

* Amended `examples/README.md` instructions

- Added `release` profile notice
- Added `--open` flag
- Removed `--release` flag

* Apply grammar suggestions from code review

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

* Update examples/function_router/README.md Grammar

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

* Add Grammar Suggestions from Review

* Apply Spelling Suggestion

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

---------

Co-authored-by: Kaede Hoshikawa <futursolo@users.noreply.github.com>
2023-04-02 03:19:08 +05:00
Kaede Hoshikawa
989d804947
Fix Clippy for 1.63 (#2825) 2022-08-12 22:16:05 +09:00
Muhammad Hamza
c28a71e78e
Use nightly for Rustfmt (#2630)
* add rustfmt.toml, use nightly in CI, update contributing docs

* run `cargo +nightly fmt`
2022-04-21 23:21:15 +05:00
WorldSEnder
daf6ec0152
Reduce size of examples (#2601)
* Reduce size of examples with this one weird trick

* oops, fixup function_router
2022-04-11 17:02:59 +05:00
Julius Lungys
b9bd18f3f4
add struct component context consumpion doc (#2533)
* add structs example

* Update website/docs/concepts/contexts.mdx

Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
2022-03-20 11:49:29 +02:00
Kaede Hoshikawa
8bc2212716
#[cfg(feature = "render")] and yew::Renderer (#2498)
* Bring changes to this branch.

* Bring changes to this branch.

* Add feature render and renderer.

* Bring changes to this branch.

* Migrate examples to Renderer.

* Satisfy no any render.

* Satisfy ssr.

* Satisfy feature render.

* Lint feature soundness.

* Suppress tests.

* Fix pr-flow, update docs.

* Add a notice.

* Adjust visibility.

* Correctly feature gate tests.

* make test scope available under feature render.

* Fix CI.

* Fix CI.

* Restore tests module to its original place as well.

* Make bundles crate private.

* Make most bundle APIs private.

* Adjust docs.

* Adjust debug implementation.

* Replace start_app with Renderer.

* Adjust documentation.

* Remove unused lint.

* Remove start_app from docs.

* DomBundle -> ReconcileTarget.

* Adjust documentation.

* Once render, now csr.

* Fix docs as well.
2022-03-20 00:48:47 +09:00
Muhammad Hamza
f05ba4152c
Update to edition 2021 (#2354)
* cargo fix --edition

* change edition="2018" to edition="2021" in Cargo.toml
2022-01-12 16:22:00 +02:00
Allan
b3f8ca1920
Replace Model with App or MyComponent (#2336)
`Model` is ambiguous and not a user-friendly name.
Some of the newer docs are already referring to the root component as
`App`.

This PR follows this naming scheme:
 - `App` for a root component
 - `MyComponent` for an arbitrary component

This naming is inspired by the React docs.

i18n references were not changed. They need a larger rewrite which will
go in a separate PR.
2022-01-07 20:50:21 +05: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