Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(runtime-core): optimize the order of keys in mergeProps #11883

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

zh-lx
Copy link
Contributor

@zh-lx zh-lx commented Sep 10, 2024

fix #11880

The cause of this bug is that during the execution of mergeProps, my-info="default 1" first adds my-info to props, then v-bind="{ myInfo: 'default 2', 'my-info': 'Some value' }" adds myInfo to props and updates the value of my-info (but does not change the order of the keys). During rendering, the keys in props are rendered in the order they were added. Since myInfo was added after my-info, the final rendered value is that of myInfo.
Therefore, during the execution of mergeProps, the order of keys corresponding to later updates should always remain at the end.

Copy link

github-actions bot commented Sep 10, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB (+20 B) 37.7 kB (+8 B) 34 kB (+67 B)
vue.global.prod.js 159 kB (+20 B) 57.6 kB (+9 B) 51.2 kB (-103 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 48.8 kB (+20 B) 18.8 kB (+9 B) 17.2 kB (-39 B)
createApp 55.3 kB (+20 B) 21.3 kB (+9 B) 19.4 kB (-33 B)
createSSRApp 59.3 kB (+20 B) 22.9 kB (+9 B) 20.9 kB
defineCustomElement 60 kB (+20 B) 22.8 kB (+8 B) 20.7 kB (+11 B)
overall 69.1 kB (+20 B) 26.3 kB (+10 B) 23.9 kB (+6 B)

Copy link

pkg-pr-new bot commented Sep 10, 2024

Open in Stackblitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@11883

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@11883

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@11883

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@11883

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@11883

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@11883

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@11883

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@11883

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@11883

vue

pnpm add https://pkg.pr.new/vue@11883

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@11883

commit: df6b863

@zh-lx zh-lx changed the title fix: optimize the order of keys in mergeProps fix(runtime-core): optimize the order of keys in mergeProps Sep 10, 2024
@edison1105 edison1105 added 🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. wait changes labels Sep 10, 2024
@edison1105 edison1105 added ready to merge The PR is ready to be merged. and removed wait changes labels Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. ready to merge The PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect v-bind merged result due to casting
2 participants