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-dom): avoid unnecessary prop patch for checkbox #11657

Merged
merged 8 commits into from
Sep 3, 2024

Conversation

Mini-ghost
Copy link
Contributor

Resolve: #11647

When the value is null or undefined, and el.type is checkbox, the newValue should be set as 'on' instead of an empty string.

I would be most grateful for any feedback on this approach. If there are any concerns or alternative suggestions, please do not hesitate to share them, and I will be more than happy to make the necessary adjustments.

Copy link

github-actions bot commented Aug 19, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB (+25 B) 37.7 kB (+9 B) 33.9 kB (+47 B)
vue.global.prod.js 159 kB (+25 B) 57.5 kB (+9 B) 51.2 kB (+7 B)

Usages

Name Size Gzip Brotli
createApp 55.1 kB (+25 B) 21.2 kB (+14 B) 19.4 kB (+78 B)
createSSRApp 59.1 kB (+25 B) 22.9 kB (+15 B) 20.8 kB (+33 B)
defineCustomElement 59.8 kB (+25 B) 22.7 kB (+21 B) 20.7 kB (+20 B)
overall 68.8 kB (+25 B) 26.3 kB (+15 B) 23.9 kB (+10 B)

Copy link

pkg-pr-new bot commented Aug 19, 2024

Open in Stackblitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/compiler-ssr

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

@vue/runtime-dom

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 77f4444

@edison1105
Copy link
Member

/ecosystem-ci run

@edison1105
Copy link
Member

Could you please add a test case for this?

@vue-bot
Copy link
Contributor

vue-bot commented Aug 19, 2024

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools failure failure
nuxt success success
pinia success success
primevue success success
quasar success success
radix-vue success success
router success success
test-utils success success
vant success success
vite-plugin-vue success success
vitepress success success
vue-i18n success success
vue-macros success success
vuetify success success
vueuse success success
vue-simple-compiler success success

@edison1105 edison1105 added ready to merge The PR is ready to be merged. scope: v-model 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. need test The PR has missing test cases. and removed ready to merge The PR is ready to be merged. labels Aug 19, 2024
@Mini-ghost
Copy link
Contributor Author

@edison1105 No problem, but I need to take some time to figure out how to write the tests for this. I'll need to wait until I finish my work today, so it might take a bit of time. I sincerely apologize for the delay.

@Mini-ghost Mini-ghost force-pushed the fix/prevent-unnecessary-patch branch from 38ac570 to 217dafc Compare August 19, 2024 10:39
@edison1105 edison1105 added ready to merge The PR is ready to be merged. and removed need test The PR has missing test cases. labels Aug 20, 2024
@yyx990803 yyx990803 merged commit c3ce9fe into vuejs:main Sep 3, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. ready to merge The PR is ready to be merged. scope: v-model
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected DOM Updates When Wrapping Checkbox in a Vue Component
4 participants