Skip to content

Commit 502ee0e

Browse files
clydinAndrewKushnir
authored andcommitted
fix(core): correctly clear template HMR internal renderer cache (#58724)
The internal renderer cache within the renderer factory was not being correctly cleared due to a type-casting error. This prevented template HMR from correctly updating the component. A more explicity cast has now been used to mitigate this problem. Component template HMR is currently considered experimental. PR Close #58724
1 parent 4dfe5b6 commit 502ee0e

File tree

1 file changed

+2
-2
lines changed
  • packages/core/src/render3

1 file changed

+2
-2
lines changed

packages/core/src/render3/hmr.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ function recreateMatchingLViews(def: ComponentDef<unknown>, rootLView: LView): v
123123
* @param def A ComponentDef instance.
124124
*/
125125
function clearRendererCache(factory: RendererFactory, def: ComponentDef<unknown>) {
126-
// Cast to `any` to read a private field.
126+
// Cast to read a private field.
127127
// NOTE: This must be kept synchronized with the renderer factory implementation in platform-browser.
128-
(factory as any).rendererByCompId?.remove(def.id);
128+
(factory as {rendererByCompId?: Map<string, unknown>}).rendererByCompId?.delete(def.id);
129129
}
130130

131131
/**

0 commit comments

Comments
 (0)