lustre-labs / lustre

A Gleam web framework for building HTML templates, single page applications, and real-time server components.
https://hexdocs.pm/lustre
MIT License
948 stars 66 forks source link

State resets after saving changes #129

Closed xpressivecode closed 4 months ago

xpressivecode commented 4 months ago

OS: osx 13.4.1 gleam version: 1.1.0 lustre version: 4.2.2

https://github.com/xpressivecode/lustre-state-hydration

This above uses the example from the lustre repo. If you click the increment button a few times and add a new paragraph tag, the counter resets to 0 after saving your changes.

hayleigh-dot-dev commented 4 months ago

Hey there, I think you're talking about lustre_dev_tools' live reloading feature. This is totally expected, it's not a bug.

Implementing hot module replacement (HMR) is a very difficult problem, I'd welcome someone taking a look at it though ^..^