fix(runtime-core): handle prop starts with on, but is not an event handler
close #7871
This is an edge case where the user uses on-xxx as a prop not an eventHandler, and mergeProps treats it as an event listener. This PR modifies the merging logic only to treat it as an event listener if the prop's value is a function.
/ecosystem-ci run
📝 Ran ecosystem CI: Open
| suite | result |
|---|---|
| naive-ui | :x: failure |
| nuxt | :white_check_mark: success |
| pinia | :white_check_mark: success |
| router | :white_check_mark: success |
| test-utils | :white_check_mark: success |
| vant | :white_check_mark: success |
| vite-plugin-vue | :white_check_mark: success |
| vitepress | :white_check_mark: success |
| vue-macros | :white_check_mark: success |
| vuetify | :white_check_mark: success |
| vueuse | :white_check_mark: success |
/ecosystem-ci run
📝 Ran ecosystem CI: Open
| suite | result |
|---|---|
| naive-ui | :x: failure |
| nuxt | :x: failure |
| pinia | :white_check_mark: success |
| router | :white_check_mark: success |
| test-utils | :white_check_mark: success |
| vant | :white_check_mark: success |
| vite-plugin-vue | :white_check_mark: success |
| vitepress | :white_check_mark: success |
| vue-macros | :white_check_mark: success |
| vuetify | :white_check_mark: success |
| vueuse | :white_check_mark: success |
Size Report
Bundles
| File | Size | Gzip | Brotli |
|---|---|---|---|
| runtime-dom.global.prod.js | 100 kB (+44 B) | 38 kB (+26 B) | 34.2 kB (+17 B) |
| vue.global.prod.js | 159 kB (+44 B) | 57.9 kB (+25 B) | 51.4 kB (+8 B) |
Usages
| Name | Size | Gzip | Brotli |
|---|---|---|---|
| createApp (CAPI only) | 47 kB (+44 B) | 18.3 kB (+18 B) | 16.7 kB (+20 B) |
| createApp | 55 kB (+44 B) | 21.3 kB (+19 B) | 19.4 kB (+30 B) |
| createSSRApp | 59 kB (+44 B) | 23 kB (+20 B) | 20.9 kB (+5 B) |
| defineCustomElement | 59.8 kB (+44 B) | 22.9 kB (+27 B) | 20.8 kB (-45 B) |
| overall | 68.7 kB (+44 B) | 26.4 kB (+19 B) | 24 kB (+2 B) |
I think there's a problem here with merging arrays of listeners. e.g.:
Listener c gets discarded because the incoming value is an array.
/ecosystem-ci run
📝 Ran ecosystem CI: Open
| suite | result | latest scheduled |
|---|---|---|
| language-tools | :white_check_mark: success | :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 |
@vue/compiler-core
pnpm add https://pkg.pr.new/@vue/compiler-core@7872
@vue/compiler-dom
pnpm add https://pkg.pr.new/@vue/compiler-dom@7872
@vue/compiler-sfc
pnpm add https://pkg.pr.new/@vue/compiler-sfc@7872
@vue/compiler-ssr
pnpm add https://pkg.pr.new/@vue/compiler-ssr@7872
@vue/reactivity
pnpm add https://pkg.pr.new/@vue/reactivity@7872
@vue/runtime-core
pnpm add https://pkg.pr.new/@vue/runtime-core@7872
@vue/runtime-dom
pnpm add https://pkg.pr.new/@vue/runtime-dom@7872
@vue/server-renderer
pnpm add https://pkg.pr.new/@vue/server-renderer@7872
@vue/shared
pnpm add https://pkg.pr.new/@vue/shared@7872
@vue/compat
pnpm add https://pkg.pr.new/@vue/compat@7872
vue
pnpm add https://pkg.pr.new/vue@7872
commit: fa4379e