PatrickJS / angular-hmr

:fire: Angular Hot Module Replacement for Hot Module Reloading
https://patrickjs.com
Apache License 2.0
505 stars 46 forks source link

angular cli hmr not reload component #62

Open elvisbegovic opened 6 years ago

elvisbegovic commented 6 years ago

I use angular cli v 1.3rc0 and follow "stories hmr" from their wiki, it works well for a lot of component but there are some components that after file change, cli rebuild correctly and page is refresh (without reload whole browser like when press F5) this behavior is works perfectly BUT new edition aren't applied, always old one is there and when I pres F5 the edited text appear correctly.

Any idea?

moshejs commented 6 years ago

I'm having the same issue. Sometimes I need to refresh or recompile the build in order to see changes in the view.

PatrickJS commented 6 years ago

can you reproduce the issue in a repo so I can see what's going on

elvisbegovic commented 6 years ago

Please apologize Difficult to me i have relativly big project. 70module 60lazyload module. Mabye you @moshejs can give us better input, example ?!?

Thanks to investigate

Cc @gdi2290

moshejs commented 6 years ago

I always update to the latest build (as of now: ng 4.3.3 / cli 1.3.0).

I don't know how to reproduce the issue, but here's the behavior:

dev changes HTML HMR does it's thing... view appears to "flicker" (state is reset transferred.) ...HMR update complete. DOM doesn't update.

dev presses F5 The changes between updates can now be seen.

I think this is what OP is trying to say, I am having the same issue.

cjntaylor commented 6 years ago

I believe I've traced this issue. angular/cli > ~1.3.0 uses webpack ~3.4.1. I think the issue is that the generated modules are slightly different, so the code that attempts to reload the template doesn't work.

Downgrading to angular/cli@1.2.6 and ensuring that webpack ALSO downgrades to 2.x seems to revert this issue.

moshejs commented 6 years ago

And that will explain my first breaking change. Thank you for your work.

It would also help to, upgrade our code..

svvac commented 6 years ago

Also see #70