feat(dev-server): hmr config + global CSS hot-swap (#145) - #185
Merged
lukekania merged 1 commit intoJun 9, 2026
Merged
Conversation
First slice of Hot Module Replacement: read the `hmr` flag and hot-swap
global stylesheets in place without a full page reload.
- project-resolver: parse `architect.serve.options.hmr` (base + active
serve configuration override) into `ResolvedAngularProject.hmr`;
defaults to false.
- cli: add `--hmr` / `--no-hmr` to `serve` (CLI wins over angular.json,
else inherit, else false). When HMR is on and a rebuild touches only
global stylesheet entries, emit a CSS-update instead of a reload.
- dev-server: new `DevServerEvent::CssUpdate { timestamp }` →
`event: css-update` SSE frame; the injected client swaps the
`styles.css` <link> with a cache-busted href, preserving page state.
Component template/style HMR and the `/@ng/component` update endpoint
land in follow-up slices on the milestone branch.
This was referenced Jun 9, 2026
This was referenced Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First slice of Hot Module Replacement (#145): read the
hmrflag and hot-swap global stylesheets in place without a full page reload.Changes
architect.serve.options.hmr(base + active serve-configuration override) intoResolvedAngularProject.hmr; defaults tofalse.--hmr/--no-hmrtoserve(CLI wins overangular.json, else inherit, elsefalse). When HMR is on and a rebuild touches only global stylesheet entries, emit a CSS update instead of a reload.DevServerEvent::CssUpdate { timestamp }→event: css-updateSSE frame; the injected client swaps thestyles.css<link>with a cache-busted href, preserving page/component/form state.Scope
Component template/style HMR and the
/@ng/componentupdate endpoint land in the follow-up slices stacked on this branch. Default (hmr: false) keeps today's full-reload behavior unchanged.Tests
hmrdefault-false, read-from-serve-options, configuration-override.css-updateSSE frame shape; injected client subscribes tocss-updateand does not reload.Part of the v0.11.0 builder-parity milestone; targets the milestone branch. No version bump on sub-branches (bumped once at milestone completion).