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): allow components defined via defineComponent #421

Merged
merged 6 commits into from
Aug 31, 2020

Conversation

posva
Copy link
Member

@posva posva commented Aug 14, 2020

Close #420
Close #361

I'm not sure about this one, specially the one way I extract PublicAPIComponent because If I don't add he cast to Component, h() yields a type error. @yyx990803 do you think it makes sense to expose PublicAPIComponent

Maybe you have a better idea @pikax, @cexbrayat ?

@github-actions
Copy link

github-actions bot commented Aug 14, 2020

size-limit report

Path Size
size-checks/webRouter.js 6.76 KB (0%)
size-checks/webRouterAndVue.js 25.75 KB (0%)

@cexbrayat
Copy link
Member

@posva I have no better idea 🤔 We also struggled in VTU to get it right (and we might still have some issues). If @yyx990803 agrees, I think it would be great if Vue exposed a directly usable type 👍 The shim and libs would be simplified

src/types/index.ts Outdated Show resolved Hide resolved
yyx990803 added a commit to vuejs/core that referenced this pull request Aug 19, 2020
returned from `defineComponent`

ref: vuejs/router#421
also close #1880

Previous `Component` type is now exported as `ConcreteComponent`.

This introduces a minor breaking change when calling `h(comp, { ... })`
will now fail if `comp` is a of generic `Component` type, since it does
not specify what props it expects.
@posva posva merged commit e47c84c into master Aug 31, 2020
@posva posva deleted the fix/component-type branch August 31, 2020 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Types error when component is defined via defineComponent
4 participants