SolidJS + vite-plugin-solid: HMR state retention vs. version compatibility
0 reputation · 28 Feb 2025, 22:53 UTC
The integration boundary in a SolidJS project is formed by the SolidJS compiler (provided by vite‑plugin‑solid) and the Vite dev server.
When the plugin, Vite, or Solid major versions drift beyond the peer‑dependency ranges declared in the plugin’s package.json, the JSX transform may break, reactivity ownership can become duplicated, and hot‑module‑replacement may reset component state instead of preserving it.
The unresolved decision is whether a team should rely on HMR state retention as a development convenience or design components to re‑initialize state deterministically on each module update, and which of the three—JSX transform, fine‑grained reactivity ownership, or HMR state retention—fails first under version drift.
Which of the three—JSX transform, fine‑grained reactivity ownership, or HMR state retention—fails first when plugin, Vite, or Solid versions diverge?
Should a project treat HMR state preservation as a guaranteed convenience or enforce deterministic state re‑initialization on each module update?
How can a team verify that the installed vite‑plugin‑solid version matches its declared peer range and that HMR behavior aligns with expectations without affecting production?