core
core copied to clipboard
fix(vMemo): prevent unexpected render in v-for + v-memo
This PR fixes the unexpected render when v-memo is used in a keyed v-for list. In the past, we just used an array as the renderCache of a list whatever if it is keyed. This PR adds a map that uses nodes.key as key and node as the value to the cache. When updates, if a list is keyed, it will check the cache from the map, so that can prevent unexpected render.
close #10392
Size Report
Bundles
| File | Size | Gzip | Brotli |
|---|---|---|---|
| runtime-dom.global.prod.js | 100 kB (+230 B) | 38 kB (+91 B) | 34.3 kB (+81 B) |
| vue.global.prod.js | 158 kB (+385 B) | 57.9 kB (+148 B) | 51.6 kB (+133 B) |
Usages
| Name | Size | Gzip | Brotli |
|---|---|---|---|
| createApp (CAPI only) | 47.2 kB | 18.3 kB | 16.8 kB |
| createApp | 55.2 kB | 21.3 kB | 19.5 kB |
| createSSRApp | 59.3 kB | 23.1 kB | 21 kB |
| defineCustomElement | 60.1 kB | 22.9 kB | 20.8 kB |
| overall | 69.1 kB | 26.5 kB | 24.1 kB |
/ecosystem-ci run
π Ran ecosystem CI: Open
| suite | result | latest scheduled |
|---|---|---|
| language-tools | :white_check_mark: success | :x: failure |
| nuxt | :white_check_mark: success | :white_check_mark: success |
| pinia | :white_check_mark: success | :white_check_mark: success |
| quasar | :x: failure | :white_check_mark: success |
| radix-vue | :x: failure | :white_check_mark: success |
| router | :white_check_mark: success | :white_check_mark: success |
| test-utils | :white_check_mark: success | :white_check_mark: success |
| vant | :white_check_mark: success | :white_check_mark: success |
| vite-plugin-vue | :white_check_mark: success | :white_check_mark: success |
| vitepress | :white_check_mark: success | :white_check_mark: success |
| vue-i18n | :white_check_mark: success | :white_check_mark: success |
| vue-macros | :white_check_mark: success | :white_check_mark: success |
| vuetify | :white_check_mark: success | :white_check_mark: success |
| vueuse | :white_check_mark: success | :white_check_mark: success |
| vue-simple-compiler | :white_check_mark: success | :white_check_mark: success |
@baiwusanyu-c could you help to re-run the ecosystem-ci?
/ecosystem-ci run
π Ran ecosystem CI: Open
| suite | result | latest scheduled |
|---|---|---|
| language-tools | :white_check_mark: success | :x: failure |
| nuxt | :white_check_mark: success | :white_check_mark: success |
| pinia | :white_check_mark: success | :white_check_mark: success |
| quasar | :white_check_mark: success | :white_check_mark: success |
| radix-vue | :white_check_mark: success | :white_check_mark: success |
| router | :white_check_mark: success | :white_check_mark: success |
| test-utils | :white_check_mark: success | :white_check_mark: success |
| vant | :white_check_mark: success | :white_check_mark: success |
| vite-plugin-vue | :white_check_mark: success | :white_check_mark: success |
| vitepress | :white_check_mark: success | :white_check_mark: success |
| vue-i18n | :white_check_mark: success | :white_check_mark: success |
| vue-macros | :white_check_mark: success | :white_check_mark: success |
| vuetify | :white_check_mark: success | :white_check_mark: success |
| vueuse | :white_check_mark: success | :white_check_mark: success |
| vue-simple-compiler | :white_check_mark: success | :white_check_mark: success |
Could you please resolve the conflicts?
Could you please resolve the conflicts?
Sure, glad to see this PR finally noticed by othersπ
@vue/compiler-core
pnpm add https://pkg.pr.new/@vue/compiler-core@10431
@vue/compiler-sfc
pnpm add https://pkg.pr.new/@vue/compiler-sfc@10431
@vue/compiler-ssr
pnpm add https://pkg.pr.new/@vue/compiler-ssr@10431
@vue/compiler-dom
pnpm add https://pkg.pr.new/@vue/compiler-dom@10431
@vue/reactivity
pnpm add https://pkg.pr.new/@vue/reactivity@10431
@vue/runtime-core
pnpm add https://pkg.pr.new/@vue/runtime-core@10431
@vue/runtime-dom
pnpm add https://pkg.pr.new/@vue/runtime-dom@10431
@vue/server-renderer
pnpm add https://pkg.pr.new/@vue/server-renderer@10431
@vue/shared
pnpm add https://pkg.pr.new/@vue/shared@10431
vue
pnpm add https://pkg.pr.new/vue@10431
@vue/compat
pnpm add https://pkg.pr.new/@vue/compat@10431
commit: 5167f16
I also added corresponding test case
/ecosystem-ci run
π Ran ecosystem CI: Open
| suite | result | latest scheduled |
|---|---|---|
| language-tools | :x: failure | :white_check_mark: success |
| nuxt | :white_check_mark: success | :white_check_mark: success |
| pinia | :white_check_mark: success | :white_check_mark: success |
| primevue | :white_check_mark: success | :white_check_mark: success |
| quasar | :white_check_mark: success | :white_check_mark: success |
| radix-vue | :white_check_mark: success | :white_check_mark: success |
| router | :white_check_mark: success | :white_check_mark: success |
| test-utils | :white_check_mark: success | :white_check_mark: success |
| vant | :white_check_mark: success | :white_check_mark: success |
| vite-plugin-vue | :white_check_mark: success | :white_check_mark: success |
| vitepress | :white_check_mark: success | :white_check_mark: success |
| vue-i18n | :white_check_mark: success | :white_check_mark: success |
| vue-macros | :white_check_mark: success | :white_check_mark: success |
| vuetify | :white_check_mark: success | :white_check_mark: success |
| vueuse | :white_check_mark: success | :white_check_mark: success |
| vue-simple-compiler | :white_check_mark: success | :white_check_mark: success |
language-tools failed seems not related to this PR
/ecosystem-ci run language-tools
π Ran ecosystem CI: Open
| suite | result | latest scheduled |
|---|---|---|
| language-tools | :white_check_mark: success | :white_check_mark: success |