angular/packages/core/src
Max Millien 1890c3008b 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

(cherry picked from commit dc0446552a)
2026-03-16 09:04:11 -07:00
..
animation refactor(core): Update determineLongestAnimation to account for playback rate 2026-03-12 16:36:54 -07:00
application refactor(core): add tracing for component creation 2026-03-06 17:48:27 +00:00
authoring docs: Adds @see links and update defer reference 2026-03-09 23:59:43 +00:00
change_detection refactor(common): Removes unused generic type parameters from KeyValueDiffers 2026-03-11 17:49:15 +00:00
compiler refactor(forms): move control logic into FormField directive 2026-01-29 13:17:40 -08:00
debug refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
defer docs: combine multiple documentation improvements into one PR 2026-03-11 16:29:49 +00:00
di fix(core): ensure definitions compile 2026-03-10 16:58:22 +00:00
hydration fix(core): clean up dehydrated views during HMR component replacement 2026-03-16 09:04:11 -07:00
i18n docs: add @see links to API docs for better discoverability 2026-01-05 12:12:24 -05:00
interface refactor(core): move interfaces around (#64535) 2025-10-20 17:49:39 +00:00
internal refactor(core): add tracing for component creation 2026-03-06 17:48:27 +00:00
linker refactor(core): interface cleanup 2026-03-10 19:44:36 +00:00
metadata refactor(core): replacing usages of Default strategy with Eager 2026-02-11 14:40:49 -08:00
platform fix(core): return StaticProvider for providePlatformInitializer 2025-12-15 15:16:37 -08:00
reflection build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
render fix(core): prevent animations renderer from impacting animate.leave (#63921) 2025-09-19 21:26:18 +00:00
render3 fix(core): clean up dehydrated views during HMR component replacement 2026-03-16 09:04:11 -07:00
resource refactor(core): remove old resource params 2026-03-11 17:44:16 +00:00
sanitization fix(core): sanitize translated form attributes 2026-03-12 10:01:30 -07:00
testability fix(core): cleanup testability subscriptions (#61261) 2025-05-21 12:06:23 +00:00
util refactor: ensure modules with 'declare global' are correctly handled by Rollup 2026-03-12 13:58:03 -07:00
view refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
zone docs: Adds links to relevant guides for APIs in core package 2025-11-17 08:47:35 -08:00
authoring.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
cached_injector_service.ts refactor(core): move interfaces around (#64535) 2025-10-20 17:49:39 +00:00
change_detection.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
console.ts refactor: remove unnecessary TSLint rule flags (#59365) 2025-01-07 16:06:21 +00:00
core.externs.js refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
core.ts fix(core): export DirectiveWithBindings 2026-02-02 11:08:42 -08:00
core_private_export.ts fix(core): fix memory leak with event replay 2026-01-07 14:27:44 -08:00
core_reactivity_export.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
core_reactivity_export_internal.ts refactor(core): expose isWritableSignal to the publicApi 2025-10-29 20:31:41 +00:00
core_render3_private_export.ts refactor(core): remove private export of getDebugNode 2026-03-09 18:21:23 +00:00
di.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
document.ts refactor(core): correct all typeof ngDevMode comparison patterns introduced by #63875 2025-12-08 10:30:01 -08:00
error_details_base_url.ts refactor(core): update error message links to versioned docs (#66374) 2026-01-09 22:33:51 +00:00
error_handler.ts refactor(core): correct all typeof ngDevMode comparison patterns introduced by #63875 2025-12-08 10:30:01 -08:00
errors.ts docs: add new debugging and troubleshooting di guide 2026-02-20 18:01:16 +00:00
event_delegation_utils.ts refactor(core): correct all typeof ngDevMode comparison patterns introduced by #63875 2025-12-08 10:30:01 -08:00
event_emitter.ts docs: Adds links to relevant guides for APIs in core package 2025-11-17 08:47:35 -08:00
image_performance_warning.ts refactor(core): update error message links to versioned docs (#66374) 2026-01-09 22:33:51 +00:00
linker.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
metadata.ts refactor(core): move interfaces around (#64535) 2025-10-20 17:49:39 +00:00
ng_reflect.ts refactor(core): remove redundant providedIn: 'root' from injection tokens 2025-11-04 00:31:52 +00:00
pending_tasks.ts docs: Adds links to relevant guides for APIs in core package 2025-11-17 08:47:35 -08:00
pending_tasks_internal.ts feat(core): Add stability debugging utility 2025-12-17 15:43:05 -08:00
profiler.ts refactor(core): implement missing OnDestroy for schedulers 2026-01-02 08:19:57 +01:00
r3_symbols.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
render.ts feat(core): add event listener options to renderer (#59092) 2024-12-10 13:39:47 -08:00
transfer_state.ts refactor: replace getDocument() with inject(DOCUMENT) 2025-11-25 13:04:58 -05:00
type_checking.ts refactor(core): expose function to assert type of variables (#62648) 2025-07-16 12:40:25 +02:00
version.ts refactor(core): mark VERSION as @__PURE__ for better tree-shaking (#63400) 2025-08-27 11:39:06 -07:00
zone.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00