aurelia / hot-module-reload

Core functionality for Aurelia's hot-module-reolad (HMR) capabilities, which is shared by all loaders and tools.
MIT License
25 stars 8 forks source link

When a state template is replaced, the ViewModel is detached and unbound but not attached or bound #20

Open rluba opened 4 years ago

rluba commented 4 years ago

I'm submitting a bug report

Please tell us about your environment:

Current behavior: When changing the template of a route component, the state instance ("view model"?) gets it’s detached() and unbind() handlers called, but neither attached() nor bind() are called again - leading to lots of NPEs in our case.

When changing the template of a regular component, neither detached() nor unbind() are called.

Expected/desired behavior:

Route components should act like regular components: Either call all lifecycle methods during HMR or none.