In previous versions of SvelteKit, one could preserve local component state using certain directives inside comments, these being // @hmr:keep (used before or beside a variable declaration) and // @hmr:keep-all (which applies to all variables).
Currently, these directives are no longer respected even though the documentation still references them, and there is no notice I could find saying this behavior would be removed.
I believe this is caused by the dropping of svelte-hmr in favor of having hmr built into Svelte 5, which seems to not have implemented this feature, so, sorry in advance if I were actually supposed to have opened this issue in the svelte repo instead.
I've sent a PR to remove that FAQ since it was so outdated. If those are features that you were relying on, I'd suggest filing a feature request over at https://github.com/sveltejs/svelte/issues
Describe the bug
In previous versions of SvelteKit, one could preserve local component state using certain directives inside comments, these being
// @hmr:keep
(used before or beside a variable declaration) and// @hmr:keep-all
(which applies to all variables). Currently, these directives are no longer respected even though the documentation still references them, and there is no notice I could find saying this behavior would be removed.I believe this is caused by the dropping of svelte-hmr in favor of having hmr built into Svelte 5, which seems to not have implemented this feature, so, sorry in advance if I were actually supposed to have opened this issue in the svelte repo instead.
Reproduction
OLD: https://stackblitz.com/edit/stackblitz-starters-tbnujh?file=src%2Froutes%2F%2Bpage.svelte CURRENT: https://stackblitz.com/edit/sveltejs-kit-template-default-ncwrwc?file=src%2Froutes%2F%2Bpage.svelte
Logs
No response
System Info
Severity
annoyance
Additional Information
No response