angular/packages/core/src/hydration
Max Millien dc0446552a fix(core): clean up dehydrated views during HMR component replacement
During HMR, `recreateLView()` destroys the old LView and removes its
DOM nodes, but never cleans up dehydrated view DOM nodes stored in
`LContainer[DEHYDRATED_VIEWS]`. These are SSR-rendered DOM nodes
preserved by Angular's hydration system. When the new view renders,
both the old dehydrated DOM and the new DOM coexist, causing visible
duplication (e.g. `<app-shell>` header/footer appearing twice).

Call `cleanupLView` from the hydration cleanup module after
`destroyLView` and before `removeViewFromDOM` to remove any remaining
dehydrated DOM nodes before the replacement view is rendered.

Fixes #66503
2026-03-16 10:04:06 -06:00
..
annotate.ts refactor(core): remove unused Injector and Renderer2 dependencies from hydration functions 2026-01-02 08:11:16 +01:00
api.ts refactor(platform-server): split zone/zoneless tests. 2026-02-13 09:41:10 -08:00
cleanup.ts fix(core): clean up dehydrated views during HMR component replacement 2026-03-16 10:04:06 -06:00
compression.ts refactor(core): tree-shake REF_EXTRACTOR_REGEXP (and dependencies) 2025-11-10 07:48:39 -08:00
error_handling.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
event_replay.ts fix(core): fix memory leak with event replay 2026-01-07 14:27:44 -08:00
i18n.ts refactor(core): move i18n logic into its dedicated package (#61425) 2025-05-19 08:24:45 +00:00
interfaces.ts feat(core): support IntersectionObserver options in viewport triggers (#64130) 2025-10-09 05:32:21 -07:00
node_lookup_utils.ts refactor(core): change node navigation step to plain const (#59469) 2025-01-13 11:12:47 -05:00
skip_hydration.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
tokens.ts fix(core): fix memory leak with event replay 2026-01-07 14:27:44 -08:00
utils.ts docs: combine multiple documentation improvements into one PR 2026-03-11 09:29:45 -07:00
views.ts fix(core): fixes timing of hydration cleanup on control flow (#60425) 2025-03-21 14:45:23 -07:00