I recently wrote a game in Svelte 4, and went through a transition from using the <script>/$ reactivity to stores. This looks MUCH nicer to deal with.
Their examples seem to be missing some imports? Trying to use $state as shown with svelte@5.0.6 gives "ReferenceError: state is not defined".