One of the nicest things of working in the JS ecosystem (yes, I know) is that local webservers (Webpack, Vite, etc.) support hot module reload (HMR), whereby small changes you make to files get injected into the webpage without a hard refresh. What this means is that page state is preserved, which is a significant benefit when dealing with complex interactions.
Is this a thing in LiveView, or a planned feature? Maybe I’m ignorant, but in every project I’ve worked in, even changing a single word in a template makes the whole page reload (i.e. the live_reload
option in Phoenix.Endpoint). Yes, the reloading is fast, but you still lose the entire state, including any form inputs. When you save changes to a file, I’d love to be able to have LV insert the diffs, and only the diffs, into the page, instead of triggering a reload. There’s no reason why adding a margin to a div should cause you to start over whatever you were doing on the page!
I searched and found this thread, which sounds like what I’m looking for, but I couldn’t get it to work in my dev environment.