A while ago, the default behaviour of svelte HMR was changed to reset component-local state, and variables which should be preserved need to be annotated with // @hmr:keep. The quick start on the website (and the templates in the repo) do not use this, so their fast reloading demo is broken. Anecdotally, this was pretty confusing for me getting started :D
Steps to reproduce
npx create-snowpack-app using template @snowpack/app-template-svelte
npm start in the new directory
Edit some text in App.svelte and save
The value of the timer is reset, instead of continuing to increase
Quick checklist
What package manager are you using?
npm
What operating system are you using?
Windows
Describe the bug
https://github.com/rixo/svelte-hmr#preservation-of-local-state
A while ago, the default behaviour of svelte HMR was changed to reset component-local state, and variables which should be preserved need to be annotated with
// @hmr:keep
. The quick start on the website (and the templates in the repo) do not use this, so their fast reloading demo is broken. Anecdotally, this was pretty confusing for me getting started :DSteps to reproduce
npx create-snowpack-app
using template @snowpack/app-template-sveltenpm start
in the new directoryApp.svelte
and saveLink to minimal reproducible example (optional)
No response