-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
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:
- Go to any project.
cd <project> bun installthenbun devthen open http://localhost:3000/- Click on any "Counter", increase it (changes the state obviously).
- Now make a change on the code of the project, and press save.
- Results from testing:
- ✅ react-vite - state is persisted
- ✅ vue vite - state is persisted
- ❌ solid-start - state is NOT persisted
- ❌ solid-vike - state is NOT persisted
- ❌ solid-vite - state is NOT persisted
- ❌ svelte-vite - state is NOT persisted
- ❌ svelte-kit - state is NOT persisted
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
- OS: macOS
- Browser: Arc (Chrome)
- Version:
- "solid-js": "^1.9.4"
- "vite": "^6.0.11"
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels