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): expose events to props for functional components #9234

Conversation

blake-newman
Copy link
Member

@blake-newman blake-newman commented Sep 16, 2023

Expose events to props for consumer of components to be correctly typed, onX handlers where not exposed as such the interface for functional components is incorrect for consuming FunctionalComponents in parent components.

Before:

const Foo: FunctionalComponent<{}, { change(): void }> = () => {}
// type error: Property 'onChange' does not exist on type '...'
<Foo onChange={() => {}} />

After:

const Foo: FunctionalComponent<{}, { change(): void }> = () => {}

// No type error:
<Foo onChange={() => {}} />

Expose events to props for consumer of components to be correctly typed,
`onX` handlers where not exposed as such the interface for functional components
is incorrect for consuming FunctionalComponents in parent components
@github-actions
Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 85.9 kB 32.6 kB 29.5 kB
vue.global.prod.js 132 kB 49.3 kB 44.4 kB

Usages

Name Size Gzip Brotli
createApp 47.9 kB 18.8 kB 17.2 kB
createSSRApp 50.6 kB 19.9 kB 18.2 kB
defineCustomElement 50.3 kB 19.6 kB 17.9 kB
overall 61.2 kB 23.7 kB 21.6 kB

@LinusBorg LinusBorg changed the title fix(runtime-core): expose events to props fix(runtime-core): expose events to props for functional components Oct 24, 2023
@pikax pikax added ready to merge The PR is ready to be merged. 🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. labels Nov 3, 2023
@yyx990803 yyx990803 merged commit 887e54c into vuejs:main Nov 30, 2023
12 checks passed
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. scope: types
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants