angular/packages/core/test
Kristiyan Kostadinov 9714b65d99 fix(core): replace metadata in place during HMR (#59644)
Currently during HMR we swap out the entire module definition (e.g. `MyComp.ɵcmp = newDef`). In standalone components and most module-based ones this works fine, however in some cases (e.g. circular dependencies) the compiler can produce a `setComponentScope` call for a module-based component. This call doesn't make it into the HMR replacement function, because it is defined in the module's file, not the component's. As a result, the dependencies of these components are cleared out upon replacement.

A secondary problem is that the `directiveDefs` and `pipeDefs` fields can save references to definitions that later become stale as a result of HMR.

These changes resolve both issues by:
1. Performing the replacement by copying the properties from the new definition onto the old one, while keeping it in place.
2. Preserving the initial `directiveDefs`, `pipeDefs` and `setInput`.

Fixes #59639.

PR Close #59644
2025-01-21 09:50:27 -08:00
..
acceptance fix(core): replace metadata in place during HMR (#59644) 2025-01-21 09:50:27 -08:00
animation refactor(platform-browser): improve error message for UNEXPECTED_SYNTHETIC_PROPERTY (#58983) 2025-01-08 15:56:18 +00:00
authoring refactor(core): Migrate all packages with the explicit-standalone-flag schematic. (#58160) 2024-10-14 14:58:57 +00:00
bundling refactor(core): move linkedSignal implementation to primitives (#59501) 2025-01-21 07:58:09 -08:00
change_detection refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
compiler refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
debug refactor(core): Migrate all packages with the explicit-standalone-flag schematic. (#58160) 2024-10-14 14:58:57 +00:00
di refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
dom refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
hydration refactor(core): change node navigation step to plain const (#59469) 2025-01-13 11:12:47 -05:00
i18n refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
linker refactor(core): remove the standalone feature (#58288) 2024-10-24 16:19:02 -07:00
metadata refactor(core): Migrate all packages with the explicit-standalone-flag schematic. (#58160) 2024-10-14 14:58:57 +00:00
playground/zone-signal-input refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
reflection refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
render3 fix(core): Ensure that a destroyed effect never run. (#59415) 2025-01-08 16:40:44 +00:00
resource refactor(core): port resource() to linkedSignal() (#59024) 2025-01-16 09:22:46 -08:00
sanitization refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
signals fix(core): treat exceptions in equal as part of computation (#55818) 2025-01-16 08:10:10 -08:00
strict_types refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
testability refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
util refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
zone refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
application_config_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
application_init_spec.ts feat(core): add syntactic sugar for initializers (#53152) 2024-10-22 09:38:18 -07:00
application_module_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
application_ref_integration_spec.ts refactor(core): Migrate all packages with the explicit-standalone-flag schematic. (#58160) 2024-10-14 14:58:57 +00:00
application_ref_spec.ts refactor(core): Migrate all packages with the explicit-standalone-flag schematic. (#58160) 2024-10-14 14:58:57 +00:00
BUILD.bazel test(core): Add scheduler in tests to tie into ApplicationRef.isStable (#53579) 2024-01-09 16:05:31 -08:00
change_detection_scheduler_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
component_fixture_spec.ts refactor(core): Migrate all packages with the explicit-standalone-flag schematic. (#58160) 2024-10-14 14:58:57 +00:00
defer_fixture_spec.ts refactor: replace ɵPendingTasks with ɵPendingTasksInternal (#59138) 2024-12-10 13:45:07 -08:00
dev_mode_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
directive_lifecycle_integration_spec.ts refactor(core): Migrate all packages with the explicit-standalone-flag schematic. (#58160) 2024-10-14 14:58:57 +00:00
error_handler_spec.ts refactor(core): removing error related dead code. (#58272) 2024-10-22 09:42:47 -07:00
event_emitter_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
fake_async_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
forward_ref_integration_spec.ts refactor(core): Migrate all packages with the explicit-standalone-flag schematic. (#58160) 2024-10-14 14:58:57 +00:00
runtime_error_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
test_bed_effect_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
test_bed_spec.ts refactor(core): Migrate all packages with the explicit-standalone-flag schematic. (#58160) 2024-10-14 14:58:57 +00:00
transfer_state_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
util_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00