-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
page.data
mutable in legacy mode
#13178
Comments
If anything,
|
This isn't related to the page state specifically, it's related to how Svelte 4 (and therefore legacy mode) behaves when imports are mutated. In this playground example, you can see that when clicking the button, incrementing the value causes reactivity: The So while we could adjust Svelte 5 to not update the text when mutations to an import happen, we cannot and should not adjust the behavior here, as this has nothing to do with Re immutability warnings: I'm not sure what we can really do here without wrapping it in a proxy, and that will cause problems itself. I think it's fine as is. |
Why can't |
Because it's a recipe for chaos - better to have it be a reflection of what your actual data is and change it through specific actions |
I just wanted something like a mutable |
Describe the bug
I found that the new
page.data
is mutable in legacy mode but not in rune mode.Reproduction
Can't import from the new '$app/state` module in Sveltelab for unknown reasons (Kit updated). So here is the code:
Logs
No response
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: