fix(hydration): don't error if data-allow-mismatch provided for fragment
Fixes hydrateFragment method throws hydration mismatch error despite of data-allow-mismatch attribute exists in parent node.
fragment not enough children test was wrong since Hydration completed but contains mismatches. error was ignored in test environment and not checked at all
__TEST__ flag prevented to catch error for testing
added toHaveBeenErrored method that looks same as toHaveBeenWarned, but error level
Summary by CodeRabbit
-
Tests
- Enhanced hydration mismatch scenario test coverage with improved error assertions.
- Added custom error assertion matcher for testing utilities.
-
Chores
- Improved hydration error logging to conditionally suppress messages when appropriate.
- Updated test infrastructure for better error tracking and validation.
✏️ Tip: You can customize this high-level summary in your review settings.
Size Report
Bundles
| File | Size | Gzip | Brotli |
|---|---|---|---|
| runtime-dom.global.prod.js | 100 kB (+9 B) | 37.9 kB (-1 B) | 34.2 kB (+22 B) |
| vue.global.prod.js | 158 kB (+9 B) | 57.8 kB (+1 B) | 51.5 kB (+87 B) |
Usages
| Name | Size | Gzip | Brotli |
|---|---|---|---|
| createApp (CAPI only) | 46.6 kB | 18.3 kB | 16.7 kB |
| createApp | 54.6 kB | 21.3 kB | 19.4 kB |
| createSSRApp | 58.7 kB (+9 B) | 23 kB (+4 B) | 20.9 kB (-2 B) |
| defineCustomElement | 59.4 kB | 22.8 kB | 20.8 kB |
| overall | 68.4 kB | 26.4 kB | 24 kB |
@vue/compiler-core
npm i https://pkg.pr.new/@vue/compiler-core@12505
@vue/compiler-dom
npm i https://pkg.pr.new/@vue/compiler-dom@12505
@vue/compiler-ssr
npm i https://pkg.pr.new/@vue/compiler-ssr@12505
@vue/compiler-sfc
npm i https://pkg.pr.new/@vue/compiler-sfc@12505
@vue/reactivity
npm i https://pkg.pr.new/@vue/reactivity@12505
@vue/runtime-core
npm i https://pkg.pr.new/@vue/runtime-core@12505
@vue/runtime-dom
npm i https://pkg.pr.new/@vue/runtime-dom@12505
@vue/server-renderer
npm i https://pkg.pr.new/@vue/server-renderer@12505
@vue/shared
npm i https://pkg.pr.new/@vue/shared@12505
vue
npm i https://pkg.pr.new/vue@12505
@vue/compat
npm i https://pkg.pr.new/@vue/compat@12505
commit: 9e90946
Thanks for the PR. I've made some minor tweaks https://github.com/vuejs/core/pull/12505/commits/9e909466d103658fac2604f72e9287e8559edc90 LGTM
@edison1105 thanks you so much for instant help!
I very hope the PR will be merged next release
@edison1105 can you merge this PR, please?