From: Evan You Date: Mon, 24 Aug 2020 22:13:17 +0000 (-0400) Subject: fix(hmr): properly force hmr full component props update X-Git-Tag: v3.0.0-rc.8~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=499bc0bfc4aedcb6ee4ec55ba823838b5496eba8;p=thirdparty%2Fvuejs%2Fcore.git fix(hmr): properly force hmr full component props update fix #1942 --- diff --git a/packages/runtime-core/src/componentProps.ts b/packages/runtime-core/src/componentProps.ts index 90abf4149f..28d7de2a5e 100644 --- a/packages/runtime-core/src/componentProps.ts +++ b/packages/runtime-core/src/componentProps.ts @@ -153,7 +153,12 @@ export function updateProps( const rawCurrentProps = toRaw(props) const [options] = normalizePropsOptions(instance.type) - if ((optimized || patchFlag > 0) && !(patchFlag & PatchFlags.FULL_PROPS)) { + if ( + // always force full diff if hmr is enabled + !(__DEV__ && instance.type.__hmrId) && + (optimized || patchFlag > 0) && + !(patchFlag & PatchFlags.FULL_PROPS) + ) { if (patchFlag & PatchFlags.PROPS) { // Compiler-generated props & no keys change, just set the updated // the props. diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index f35435a1c6..930464ebc6 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -1451,9 +1451,6 @@ function baseCreateRenderer( nextVNode: VNode, optimized: boolean ) => { - if (__DEV__ && instance.type.__hmrId) { - optimized = false - } nextVNode.component = instance const prevProps = instance.vnode.props instance.vnode = nextVNode