core
core copied to clipboard
types(defineProps): remove optional properties from type
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.
Deploy Preview for vuejs-coverage failed.
| Name | Link |
|---|---|
| Latest commit | 43065b51032cf22c6cd4c9c274113a42ba561b9c |
| Latest deploy log | https://app.netlify.com/sites/vuejs-coverage/deploys/62efd0f4eb1fea0009152167 |
Maybe related: https://github.com/vuejs/core/pull/6244
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 |