core icon indicating copy to clipboard operation
core copied to clipboard

types(defineProps): remove optional properties from type

Open pikax opened this issue 3 years ago • 2 comments

fixes #6420

I haven't tested this on an actual repo.

When we use defineProps<{ a?:string}> it will create a type { a?: string } which is not correct for the vue props context, since if a property is declared the key will always be present, a more accurate representation of the type is { a: string | undefined }, this PR does that.

pikax avatar Aug 07 '22 14:08 pikax

Deploy Preview for vuejs-coverage failed.

Name Link
Latest commit 43065b51032cf22c6cd4c9c274113a42ba561b9c
Latest deploy log https://app.netlify.com/sites/vuejs-coverage/deploys/62efd0f4eb1fea0009152167

netlify[bot] avatar Aug 07 '22 14:08 netlify[bot]

Maybe related: https://github.com/vuejs/core/pull/6244

Justineo avatar Aug 07 '22 17:08 Justineo

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 86.4 kB 32.9 kB 29.6 kB
vue.global.prod.js 132 kB 49.6 kB 44.5 kB

Usages

Name Size Gzip Brotli
createApp 48 kB 18.9 kB 17.3 kB
createSSRApp 51.1 kB 20.1 kB 18.4 kB
defineCustomElement 50.3 kB 19.7 kB 17.9 kB
overall 61.3 kB 23.7 kB 21.6 kB

github-actions[bot] avatar Oct 06 '23 13:10 github-actions[bot]