-
-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(vite-plugin-angular): introduce support for Angular v19 HMR/live reload #1523
Conversation
✅ Deploy Preview for analog-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for analog-app ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for analog-blog ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for analog-ng-app ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Finally someone did what angular has never been able to, HMR without reloading the page completely. I still don't understand how the community has been asking for it for years but they can't do it... |
@sawa-ko that's incorrect. It's enabled in Angular v19 already through the Angular CLI and will be the default for new apps in 19.1. We integrated the HMR functionality into Analog. |
Hum, but the angular HMR keeps reloading the entire page when a component changes, right? And no, I don't mean the CSS HMR. |
@sawa-ko By default yes, HMR has to be enabled manually using an environment variable. NG_HMR_TEMPLATES=1 ng serve This will be enabled by default for newly created Angular apps in Angular v19.1 which hasn't been released yet. You can also enable it with the |
PR Checklist
Closes #1524
What is the new behavior?
When using the
liveReload
option in theanalog
plugin with Angular v19, the new HMR code generated by the compiler is handled by the vite plugin, enabling HMR updates without full page reloads.Does this PR introduce a breaking change?
Other information
Links
https://vite.dev/guide/api-plugin.html#handlehotupdate
https://bjornlu.com/blog/hot-module-replacement-is-easy#importmetahotaccept
[optional] What gif best describes this PR or how it makes you feel?