(
target: Type<unknown>,
replacement: Type<unknown>,
overrides: Record<string, unknown> = {},
)
| 606 | |
| 607 | // Use a separate replacement class so JIT `depsTracker` computes a fresh standalone scope. |
| 608 | function hmrUpdateFrom( |
| 609 | target: Type<unknown>, |
| 610 | replacement: Type<unknown>, |
| 611 | overrides: Record<string, unknown> = {}, |
| 612 | ) { |
| 613 | const replacementDef = getComponentDef(replacement)!; |
| 614 | ɵɵreplaceMetadata( |
| 615 | target, |
| 616 | (cmp: any) => { |
| 617 | cmp.ɵcmp = {...replacementDef, ...overrides, type: cmp}; |
| 618 | }, |
| 619 | [], |
| 620 | [], |
| 621 | null, |
| 622 | '', |
| 623 | ); |
| 624 | } |
| 625 | |
| 626 | it('should swap and clear standalone directives during HMR', () => { |
| 627 | @Component({ |
no test coverage detected