@hmr
directives no longer work
#12985
Labels
documentation
Improvements or additions to documentation
@hmr
directives no longer work
#12985
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
The text was updated successfully, but these errors were encountered: