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(types): defineCustomElement props inference with array emits #11384

Merged
merged 3 commits into from
Aug 5, 2024

Conversation

andylizi
Copy link
Contributor

@andylizi andylizi commented Jul 17, 2024

Fixes #11353

defineCustomElement using components with emits: ["array"] currently resolves to // overload 2: object format with no props instead of // overload 5: the returned value of defineComponent, so the resulting prop type is readonly.

This PR is the only successful result out of my many attempts to fix this. Frankly, I still don't understand why this works but the old code doesn't.

@edison1105
Copy link
Member

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Jul 18, 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 failure failure
vue-macros success success
vuetify success failure
vueuse success success
vue-simple-compiler success success

@yyx990803 yyx990803 changed the base branch from main to minor August 5, 2024 02:47
Copy link

github-actions bot commented Aug 5, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 97.3 kB (+7.2 kB) 37 kB (+2.41 kB) 33.3 kB (+2.13 kB)
vue.global.prod.js 155 kB (+8.16 kB) 56.7 kB (+2.7 kB) 50.5 kB (+2.43 kB)

Usages

Name Size Gzip Brotli
createApp 53.8 kB (+4.19 kB) 20.9 kB (+1.38 kB) 19 kB (+1.21 kB)
createSSRApp 57.8 kB (+4.57 kB) 22.5 kB (+1.52 kB) 20.4 kB (+1.34 kB)
defineCustomElement 57.2 kB (+5.26 kB) 22 kB (+1.73 kB) 20 kB (+1.52 kB)
overall 67.4 kB (+4.25 kB) 25.9 kB (+1.39 kB) 23.5 kB (+1.25 kB)

@yyx990803 yyx990803 merged commit e94b01b into vuejs:minor Aug 5, 2024
7 checks passed
@andylizi andylizi deleted the fix/11353 branch August 5, 2024 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

defineCustomElement props become readonly when component defines array emits
4 participants