Skip to content

Conversation

@bikathi
Copy link

@bikathi bikathi commented Nov 4, 2025

Description

Hi, my pr includes code for a bare bones typing speed testing tool (analysis Not Included), this I feel will be a good starting point for many people looking to learn by example.

The example uses TailwindCSS for styling so it can also serve as a good starting point for those who want to use Yew with Tailwind. I have also added sample logic for uploading and reading data from a text file, which should serve as a good example for users who want to do things related to file uploads. Feel free to ask any.

PS: See the GH Pages live link here: https://bikathi.github.io/typing-speed-test/ and a screenshot below:
2025-11-04 15 40 42  __1  d72e839a2631

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

Size Comparison

examples master (KB) pull request (KB) diff (KB) diff (%)
async_clock 98.471 99.194 +0.724 +0.735%
boids 167.342 167.557 +0.215 +0.128%
communication_child_to_parent 91.493 91.740 +0.247 +0.270%
communication_grandchild_with_grandparent 102.606 102.851 +0.244 +0.238%
communication_grandparent_to_grandchild 98.964 99.209 +0.245 +0.248%
communication_parent_to_child 88.821 89.068 +0.247 +0.278%
contexts 103.934 104.188 +0.254 +0.244%
counter 85.499 85.751 +0.252 +0.295%
counter_functional 85.766 86.014 +0.248 +0.289%
dyn_create_destroy_apps 88.579 88.800 +0.221 +0.249%
file_upload 97.831 98.043 +0.212 +0.217%
function_delayed_input 91.099 91.561 +0.462 +0.507%
function_memory_game 169.749 169.927 +0.178 +0.105%
function_router 330.131 330.347 +0.216 +0.065%
function_todomvc 162.195 162.442 +0.247 +0.152%
futures 237.559 238.091 +0.532 +0.224%
game_of_life 104.179 104.395 +0.216 +0.207%
immutable 193.012 197.890 +4.878 +2.527%
inner_html 79.965 80.212 +0.247 +0.309%
js_callback 107.369 107.859 +0.490 +0.457%
keyed_list 179.716 179.960 +0.244 +0.136%
mount_point 83.186 83.433 +0.247 +0.297%
nested_list 112.989 113.231 +0.242 +0.214%
node_refs 90.832 91.078 +0.246 +0.271%
password_strength 1751.676 1751.908 +0.232 +0.013%
portals 92.329 92.577 +0.248 +0.269%
router 303.819 304.045 +0.226 +0.074%
suspense 111.678 112.224 +0.546 +0.489%
timer 88.174 88.361 +0.188 +0.213%
timer_functional 95.899 96.031 +0.132 +0.137%
todomvc 142.264 142.513 +0.249 +0.175%
two_apps 85.226 85.473 +0.247 +0.290%
typing-speed-tester N/A 799.074 N/A N/A
web_worker_fib 132.932 133.676 +0.744 +0.560%
web_worker_prime 185.158 186.084 +0.926 +0.500%
webgl 82.522 82.746 +0.224 +0.271%

⚠️ The following example has changed its size significantly:

examples master (KB) pull request (KB) diff (KB) diff (%)
immutable 193.012 197.890 +4.878 +2.527%

@bikathi bikathi changed the title Provide Code for /examples Folder Provide Typing Speed Testing App for /examples Folder Nov 6, 2025
@bikathi bikathi marked this pull request as draft November 6, 2025 06:03
@bikathi bikathi marked this pull request as ready for review November 6, 2025 06:13
bikathi and others added 7 commits November 6, 2025 09:20
…k#3933)

* Bump the cargo-deps group across 1 directory with 18 updates

Bumps the cargo-deps group with 17 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [tokio](https://github.com/tokio-rs/tokio) | `1.47.1` | `1.48.0` |
| [implicit-clone](https://github.com/yewstack/implicit-clone) | `0.5.1` | `0.6.0` |
| [thiserror](https://github.com/dtolnay/thiserror) | `2.0.16` | `2.0.17` |
| [serde](https://github.com/serde-rs/serde) | `1.0.225` | `1.0.228` |
| [wasm-bindgen-test](https://github.com/wasm-bindgen/wasm-bindgen) | `0.3.53` | `0.3.54` |
| [trybuild](https://github.com/dtolnay/trybuild) | `1.0.111` | `1.0.112` |
| [quote](https://github.com/dtolnay/quote) | `1.0.40` | `1.0.41` |
| [getrandom](https://github.com/rust-random/getrandom) | `0.3.3` | `0.3.4` |
| [clap](https://github.com/clap-rs/clap) | `4.5.47` | `4.5.49` |
| [reqwest](https://github.com/seanmonstar/reqwest) | `0.12.23` | `0.12.24` |
| [regex](https://github.com/rust-lang/regex) | `1.11.2` | `1.12.2` |
| [toml](https://github.com/toml-rs/toml) | `0.9.5` | `0.9.8` |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.99` | `1.0.100` |
| [lipsum](https://github.com/mgeisler/lipsum) | ``35060ef`` | ``e1ab664`` |
| [time](https://github.com/time-rs/time) | `0.3.43` | `0.3.44` |
| [warp](https://github.com/seanmonstar/warp) | `0.3.7` | `0.4.2` |
| [axum](https://github.com/tokio-rs/axum) | `0.8.4` | `0.8.6` |

Updates `tokio` from 1.47.1 to 1.48.0
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](tokio-rs/tokio@tokio-1.47.1...tokio-1.48.0)

Updates `implicit-clone` from 0.5.1 to 0.6.0
- [Commits](yewstack/implicit-clone@v0.5.1...v0.6.0)

Updates `thiserror` from 2.0.16 to 2.0.17
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](dtolnay/thiserror@2.0.16...2.0.17)

Updates `serde` from 1.0.225 to 1.0.228
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](serde-rs/serde@v1.0.225...v1.0.228)

Updates `wasm-bindgen-test` from 0.3.53 to 0.3.54
- [Release notes](https://github.com/wasm-bindgen/wasm-bindgen/releases)
- [Changelog](https://github.com/wasm-bindgen/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/wasm-bindgen/wasm-bindgen/commits)

Updates `trybuild` from 1.0.111 to 1.0.112
- [Release notes](https://github.com/dtolnay/trybuild/releases)
- [Commits](dtolnay/trybuild@1.0.111...1.0.112)

Updates `quote` from 1.0.40 to 1.0.41
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](dtolnay/quote@1.0.40...1.0.41)

Updates `getrandom` from 0.3.3 to 0.3.4
- [Release notes](https://github.com/rust-random/getrandom/releases)
- [Changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)
- [Commits](rust-random/getrandom@v0.3.3...v0.3.4)

Updates `clap` from 4.5.47 to 4.5.49
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](clap-rs/clap@clap_complete-v4.5.47...clap_complete-v4.5.49)

Updates `reqwest` from 0.12.23 to 0.12.24
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](seanmonstar/reqwest@v0.12.23...v0.12.24)

Updates `regex` from 1.11.2 to 1.12.2
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](rust-lang/regex@1.11.2...1.12.2)

Updates `toml` from 0.9.5 to 0.9.8
- [Commits](toml-rs/toml@toml-v0.9.5...toml-v0.9.8)

Updates `anyhow` from 1.0.99 to 1.0.100
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](dtolnay/anyhow@1.0.99...1.0.100)

Updates `lipsum` from `35060ef` to `e1ab664`
- [Release notes](https://github.com/mgeisler/lipsum/releases)
- [Commits](mgeisler/lipsum@35060ef...e1ab664)

Updates `time` from 0.3.43 to 0.3.44
- [Release notes](https://github.com/time-rs/time/releases)
- [Changelog](https://github.com/time-rs/time/blob/main/CHANGELOG.md)
- [Commits](time-rs/time@v0.3.43...v0.3.44)

Updates `warp` from 0.3.7 to 0.4.2
- [Release notes](https://github.com/seanmonstar/warp/releases)
- [Changelog](https://github.com/seanmonstar/warp/blob/master/CHANGELOG.md)
- [Commits](seanmonstar/warp@v0.3.7...v0.4.2)

Updates `axum` from 0.8.4 to 0.8.6
- [Release notes](https://github.com/tokio-rs/axum/releases)
- [Changelog](https://github.com/tokio-rs/axum/blob/main/CHANGELOG.md)
- [Commits](tokio-rs/axum@axum-v0.8.4...axum-v0.8.6)

Updates `serde_derive` from 1.0.225 to 1.0.228
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](serde-rs/serde@v1.0.225...v1.0.228)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.48.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: implicit-clone
  dependency-version: 0.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: thiserror
  dependency-version: 2.0.17
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: serde
  dependency-version: 1.0.228
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: wasm-bindgen-test
  dependency-version: 0.3.54
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: trybuild
  dependency-version: 1.0.112
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: quote
  dependency-version: 1.0.41
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: getrandom
  dependency-version: 0.3.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: clap
  dependency-version: 4.5.49
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: reqwest
  dependency-version: 0.12.24
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: regex
  dependency-version: 1.12.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: toml
  dependency-version: 0.9.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: anyhow
  dependency-version: 1.0.100
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: lipsum
  dependency-version: e1ab6646e65fa7fdc201f97919b82d7f44fb6ae5
  dependency-type: direct:production
  dependency-group: cargo-deps
- dependency-name: time
  dependency-version: 0.3.44
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: warp
  dependency-version: 0.4.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: axum
  dependency-version: 0.8.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: serde_derive
  dependency-version: 1.0.228
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
...

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

* downgrade warp

* fix implicit_clone upgrade

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Molzer <WorldSEnder@users.noreply.github.com>

Add code for typing speed tester tool

Fix failing checks for linting and formatting

Proper attempt at fixing linting and formatting errors

Bump down the required Rust version for project
@bikathi
Copy link
Author

bikathi commented Nov 6, 2025

Hi, Sorry for the multiple commits. I have been fighting with clippy, cargo fmt and my computer in general. Was wondering how best to combine the commits into one since it's the lasts one that really matters for such a PR

@Madoshakalaka
Copy link
Member

Hi, Sorry for the multiple commits. I have been fighting with clippy, cargo fmt and my computer in general. Was wondering how best to combine the commits into one since it's the lasts one that really matters for such a PR

no worries, we squash your commits into one when we merge

@WorldSEnder
Copy link
Member

WorldSEnder commented Nov 17, 2025

o/ I like this as a showcase of what yew can do. We try to use examples usually to show specific capabilities of what can be achieved (apart from todomvc which is a very popular "hello world" app for frameworks). What would say is specifically shown by this example that can not be found in other existing ones or maybe does it show better than existing ones? (Your experience as a learner is valuable here in case you perhaps used some part of another example that can be clarified here). If the purpose is just to have a good start point for tailwind, that is fine too, just thinking you may faced other challenges when implementing it :)

@bikathi
Copy link
Author

bikathi commented Nov 24, 2025

Hi, sorry for the late reply. My example was built from scratch and not based on anyone else's examples. In writing this example, my aim was mainly to showcase that Yew can easily be integrated with some of the popular libraries in the JS world hence my choice for Tailwind. Moreover, I learnt about the Elm-like architecture for creating components which I have showcased a bit of across the library. Finally, as a new-to-Rust person (kind off), I am still struggling with the ownership model particularly when it comes to closures, and here, I forced myself to use and showcase a few. I also never knew how clippy works until I opened this PR, and I had to fight with it, so I have added a new tool to my Rust stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants