gameoflife

Gameoflife

Visualising Conway's Game of Life using p5 and Svelte

Conway's Game of Life

Live at cgof.netlify.app

Challenges

  • Stateful DOM inputs such as seed selection and and toggle checkboxes retain their state after navigating forward and back from another page, but then fail to sync the svelte app state to the DOM state. Hence we end up with inconsistencies such as the seed being selected is different from the one being displayed in the canvas. Fix: Remove input autocomplete. Make a form element and apply this autocomplete=off to the entire form instead of applying it individually to each input. src: SO and MDN.

  • Getting a memory leak on the build tool:

    FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
    ...
    error Command failed with signal "SIGABRT".
    

    Node: v12.14.1 Rollup: v^2.3.4

    Fix: Don't know. But when process gets SIGABRT, it doesn't let go of the port 5000. We can make it do so using:

    lsof -i:5000
    kill -INT <process-id>
    

Top categories

svelte logo

Want a Svelte site built?

Hire a Svelte developer
Loading Svelte Themes