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

App entry point #9

Open jods4 opened 7 years ago

jods4 commented 7 years ago

My application root is by convention app. It starts like this: aurelia.start().then(() => aurelia.setRoot());

I noticed that app is not loaded through any of the module.hot.accept paths in aurelia-loader-webpack and hence does not support HMR. Changing code in app.ts triggers a full reload.

app.html on the other hand goes through module.hot.accept and triggers a hot reload, but the view is only updated the very first time. After that, it still triggers a hot reload but the view is not updated anymore. I don't have that problem with other views, they refresh fine.

niieani commented 7 years ago

Interesting. Any thoughts on how to correct this?

jods4 commented 7 years ago

Unfortunately no.

I have not debugged where app gets loaded and why it doesn't go through the normal code path.

Then for the app.html weird behavior, I must admit I don't fully understand yet what the aurelia HMR module does, so no idea what happens here.

niieani commented 7 years ago

This is where app is inferred when no root is specified: https://github.com/aurelia/framework/blob/d650b01993aa2db81f8c9587793b73b2d1f0476d/src/aurelia.js#L133

Alexander-Taran commented 6 years ago

@jods4 maybe can be closed?

jods4 commented 6 years ago

@Alexander-Taran was there a fix for that?

Alexander-Taran commented 6 years ago

@jods4, sir. Can't know sir. I'm asking you (-: Maybe it was resolved and you are already happy?

jods4 commented 6 years ago

Nothing that I know of.