fix(@angular/build): reset component updates on dev-server SSR page request - #34177
Merged
alan-agius4 merged 1 commit intoSep 25, 2026
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Angular SSR middlewares to accept and invoke a resetComponentUpdates callback during the html:transform:pre hook execution. It also adds corresponding unit tests and updates the setup middleware plugin. The review feedback recommends replacing the arbitrary setTimeout(50) delays in the new unit tests with deterministic Promises to prevent potential test flakiness in slower CI environments.
…equest When server-side rendering is enabled (either internal or external mode), page reload requests are handled by the SSR middleware before reaching the index HTML middleware. As a result, `resetComponentUpdates` was never invoked on page reloads, causing stale component HMR updates to persist in `templateUpdates` and be re-applied over freshly rendered pages. We now pass `resetComponentUpdates` to `createAngularSsrInternalMiddleware` and `createAngularSsrExternalMiddleware`, and trigger it when an SSR HTML transform occurs (`html:transform:pre`). Fixes angular#34163
alan-agius4
force-pushed
the
fix/ssr-dev-server-hmr-reset
branch
from
September 25, 2026 09:55
bad4bdc to
45f257d
Compare
clydin
approved these changes
Sep 25, 2026
Collaborator
Author
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.
When server-side rendering is enabled (either internal or external mode), page reload requests are handled by the SSR middleware before reaching the index HTML middleware. As a result,
resetComponentUpdateswas never invoked on page reloads, causing stale component HMR updates to persist intemplateUpdatesand be re-applied over freshly rendered pages.We now pass
resetComponentUpdatestocreateAngularSsrInternalMiddlewareandcreateAngularSsrExternalMiddleware, and trigger it when an SSR HTML transform occurs (html:transform:pre).Fixes #34163