Skip to content

Refactor of examples/game_of_life#3598

Merged
Madoshakalaka merged 2 commits intoyewstack:masterfrom
jesper-olsen:master
Aug 21, 2025
Merged

Refactor of examples/game_of_life#3598
Madoshakalaka merged 2 commits intoyewstack:masterfrom
jesper-olsen:master

Conversation

@jesper-olsen
Copy link
Contributor

@jesper-olsen jesper-olsen commented Feb 4, 2024

Description

Refactor of examples/game_of_life as follows:

  1. Moved conway grid logic from main.rs to cell.rs - to better separate model & yew code.
  2. Renamed cell.rs to conway.rs
  3. Simplified and removed some codeblocks - e.g. directly count neighbours, instead of retuning them so that they can be counted...

Functionality is unchanged, LOC is reduced from 282 to 210 (~25%).

Fixes #0000

Checklist

  • I have reviewed my own code
  • I have added tests

@github-actions
Copy link

github-actions bot commented Feb 4, 2024

Size Comparison

Details
examples master (KB) pull request (KB) diff (KB) diff (%)
async_clock 99.195 99.195 0 0.000%
boids 168.005 168.005 0 0.000%
communication_child_to_parent 91.554 91.554 0 0.000%
communication_grandchild_with_grandparent 102.578 102.578 0 0.000%
communication_grandparent_to_grandchild 97.573 97.573 0 0.000%
communication_parent_to_child 87.470 87.470 0 0.000%
contexts 103.686 103.686 0 0.000%
counter 84.274 84.274 0 0.000%
counter_functional 84.623 84.623 0 0.000%
dyn_create_destroy_apps 87.274 87.274 0 0.000%
file_upload 98.170 98.170 0 0.000%
function_memory_game 170.059 170.059 0 0.000%
function_router 336.237 336.237 0 0.000%
function_todomvc 162.450 162.450 0 0.000%
futures 236.567 236.567 0 0.000%
game_of_life 104.512 104.362 -0.149 -0.143%
immutable 193.274 193.274 0 0.000%
inner_html 79.920 79.920 0 0.000%
js_callback 107.411 107.411 0 0.000%
keyed_list 195.425 195.425 0 0.000%
mount_point 83.287 83.287 0 0.000%
nested_list 112.415 112.415 0 0.000%
node_refs 90.649 90.649 0 0.000%
password_strength 1782.874 1782.874 0 0.000%
portals 92.442 92.442 0 0.000%
router 305.597 305.597 0 0.000%
suspense 111.410 111.410 0 0.000%
timer 88.542 88.542 0 0.000%
timer_functional 94.578 94.578 0 0.000%
todomvc 142.697 142.697 0 0.000%
two_apps 85.640 85.640 0 0.000%
web_worker_fib 134.121 134.121 0 0.000%
web_worker_prime 184.396 184.396 0 0.000%
webgl 82.856 82.856 0 0.000%

✅ None of the examples has changed their size significantly.

@jesper-olsen jesper-olsen changed the title grid logic 2 conway.rs Refactor of examples/game_of_life Feb 4, 2024
@Madoshakalaka
Copy link
Member

thanks for the contribution

@Madoshakalaka Madoshakalaka enabled auto-merge (squash) August 21, 2025 09:09
@Madoshakalaka Madoshakalaka merged commit 741849d into yewstack:master Aug 21, 2025
8 checks passed
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.

2 participants