From 8c13a8d2fef54aa0792b345eb5642d3c31b2e913 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Tue, 26 Mar 2024 20:24:57 +0530 Subject: [PATCH 1/3] fix: show hydration mismatch details for non-rectified mismatches too when __PROD_HYDRATION_MISMATCH_DETAILS__ is set --- packages/runtime-core/src/hydration.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/runtime-core/src/hydration.ts b/packages/runtime-core/src/hydration.ts index de02ae46d8a..d4053cb1033 100644 --- a/packages/runtime-core/src/hydration.ts +++ b/packages/runtime-core/src/hydration.ts @@ -365,7 +365,12 @@ export function createHydrationFunctions( const forcePatch = type === 'input' || type === 'option' // skip props & children if this is hoisted static nodes // #5405 in dev, always hydrate children for HMR - if (__DEV__ || forcePatch || patchFlag !== PatchFlags.HOISTED) { + if ( + __DEV__ || + __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__ || + forcePatch || + patchFlag !== PatchFlags.HOISTED + ) { if (dirs) { invokeDirectiveHook(vnode, null, parentComponent, 'created') } @@ -443,6 +448,7 @@ export function createHydrationFunctions( if (props) { if ( __DEV__ || + __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & (PatchFlags.FULL_PROPS | PatchFlags.NEED_HYDRATION) @@ -450,7 +456,7 @@ export function createHydrationFunctions( for (const key in props) { // check hydration mismatch if ( - __DEV__ && + (__DEV__ || __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__) && propHasMismatch(el, key, props[key], vnode, parentComponent) ) { hasMismatch = true From dffa775fbb1b6f397a637e1e9c5a1f2c01c2133c Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Tue, 26 Mar 2024 20:31:05 +0530 Subject: [PATCH 2/3] chore: retrigger ci From 8c81119b4a5feefc93bc5965d6cad8b6936e2e45 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Fri, 29 Mar 2024 17:16:52 +0530 Subject: [PATCH 3/3] chore: fix condition --- .gitignore | 1 + packages/runtime-core/src/hydration.ts | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 810f8852690..9dd21f59bf6 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ TODOs.md .eslintcache dts-build/packages *.tsbuildinfo +*.tgz diff --git a/packages/runtime-core/src/hydration.ts b/packages/runtime-core/src/hydration.ts index d4053cb1033..8469577608e 100644 --- a/packages/runtime-core/src/hydration.ts +++ b/packages/runtime-core/src/hydration.ts @@ -365,12 +365,7 @@ export function createHydrationFunctions( const forcePatch = type === 'input' || type === 'option' // skip props & children if this is hoisted static nodes // #5405 in dev, always hydrate children for HMR - if ( - __DEV__ || - __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__ || - forcePatch || - patchFlag !== PatchFlags.HOISTED - ) { + if (__DEV__ || forcePatch || patchFlag !== PatchFlags.HOISTED) { if (dirs) { invokeDirectiveHook(vnode, null, parentComponent, 'created') }