ionic-cli
ionic-cli copied to clipboard
Investigate HMR
We should investigate HMR and possibly enable it by default at some point.
https://github.com/angular/angular-cli/wiki/stories-configure-hmr
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 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).
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)
me took, I got the same problem when using HMR
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.
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
@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 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 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