ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

Investigate HMR

Open imhoffd opened this issue 6 years ago • 9 comments

We should investigate HMR and possibly enable it by default at some point.

https://github.com/angular/angular-cli/wiki/stories-configure-hmr

imhoffd avatar Nov 30 '18 23:11 imhoffd

hello, I think this feature is important with development process. Can you make some simple instruction to run custom script in package.json for HMR

hiepxanh avatar Jan 27 '19 06:01 hiepxanh

@hiepxanh Sorry, somehow I missed your comment.

This issue is here because I'd like to provide a way to develop with HMR out of the box for Ionic. Ideally it'd be enabled by default, assuming it works well with Angular and Ionic (this is what needs to be investigated).

imhoffd avatar Feb 01 '19 18:02 imhoffd

Hello!

Just to be sure, ionic 4 (angular) is compliant with HMR, isn't it? I just followed the guide and it seems to work (I got one error in the browser console after the reload, but not sure about the impact).

core.js:15724 ERROR Error: Uncaught (in promise): TypeError: c.getBoolean is not a function TypeError: c.getBoolean is not a function at Config.push../node_modules/@ionic/angular/dist/fesm5.js.Config.getBoolean (fesm5.js:2663) at fesm5.js:3742 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:391) at Object.onInvoke (core.js:17299) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:390) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:150) at zone.js:910 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423) at Object.onInvokeTask (core.js:17290) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422) at resolvePromise (zone.js:852) at zone.js:917 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423) at Object.onInvokeTask (core.js:17290) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195) at drainMicroTaskQueue (zone.js:601) at push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask (zone.js:502) at ZoneTask.invoke (zone.js:487) at timer (zone.js:3045)

cguy avatar Apr 05 '19 15:04 cguy

image image me took, I got the same problem when using HMR

hiepxanh avatar May 30 '19 08:05 hiepxanh

If you encounter issues with that guide, post it in the angular-cli repo, not here. Ionic does not officially support HMR for Angular yet.

imhoffd avatar May 30 '19 16:05 imhoffd

Hi @dwieeb

I think this may require revision as HMR has been presented on the forum as well as in the cli?

https://forum.ionicframework.com/t/ionic-5-angular-11-and-hot-module-replacement/199956

Nevertheless I wonder if it is implemented correctly as the --hmr flag is not passed on

https://forum.ionicframework.com/t/ionic-5-angular-11-and-hot-module-replacement/199956/4

Tommertom avatar Feb 11 '21 09:02 Tommertom

@dwieeb I think HMR is supported in Angular, and due to what @Tommertom says, it should be working fine, I think this 2 years old ticket can be resolved now.

almothafar avatar Feb 17 '21 10:02 almothafar

@almothafar Have you tried it with ionic 6? If yes then please let me know the CLI for that?

I use this with a native device

ionic cap run android -l --host=0.0.0.0

Sampath-Lokuge avatar Feb 06 '22 14:02 Sampath-Lokuge

@Sampath-Lokuge as far as I remember, there is nothing changed from 5 to 6, I can't check now as I left that job now and no more working with Ionic

almothafar avatar Feb 06 '22 18:02 almothafar