You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I don't know why I just realized this now, I thought it was normal but out of React, Svelte, Vue, and Solid.
Only Svelte and Soliddon't persist state between HMR updates.
Alright I learned a bit more about this after a couple of searches. Here's a related issue: solidjs/solid-refresh#12
It's very interesting. Feel free to close this since I think it's probably too much of a hassle. I can understand Solid and Svelte are architecturally different from Vue and React.
Describe the bug
So I don't know why I just realized this now, I thought it was normal but out of React, Svelte, Vue, and Solid.
Only Svelte and Solid don't persist state between HMR updates.
Is it because Solid and Svelte have a "compiler"?
Edit: Interestingly I found something on why Svelte disables it and how to re-enable it: https://stackoverflow.com/questions/78013735/how-do-i-preserve-state-when-hot-reloading-in-a-standard-sveltekit-dev-environme. It's good that it's at least documented, but not sure for SolidJS.
Your Example Website or App
https://github.com/blankeos/solid-hmr-signal-bugs
Steps to Reproduce the Bug or Issue
To reproduce:
cd <project>
bun install
thenbun dev
then open http://localhost:3000/Expected behavior
State is persisted (kinda useful when styling modals currently opened, making changes the component is in a specific state, etc.)
Screenshots or Videos
solid-signal-persist-hmr.mp4
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: