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: component type missing for TS 5.1.3 #3274

Merged
merged 14 commits into from Jun 13, 2023

Conversation

so1ve
Copy link
Member

@so1ve so1ve commented Jun 13, 2023

close #3268, close #3265, close #3252
Ref: microsoft/TypeScript#54630

@so1ve
Copy link
Member Author

so1ve commented Jun 13, 2023

Not the right way to fix...?

@so1ve so1ve marked this pull request as draft June 13, 2023 09:45
@rchl
Copy link
Collaborator

rchl commented Jun 13, 2023

I'm fairly sure that if you declare those interfaces up-front then you will overwrite the original ones. For extending to work you'd need to first reference/import original types from those packages but you can't really do that since you don't know if those exist or not in the project.

@so1ve
Copy link
Member Author

so1ve commented Jun 13, 2023

Hi @rchl! I have pushed a new commit. Could you please check it out if it works?

@rchl
Copy link
Collaborator

rchl commented Jun 13, 2023

I don't know if it's the right approach. As I said, I don't think it's OK to import packages that might not exist but maybe TS is fine with it...

@so1ve
Copy link
Member Author

so1ve commented Jun 13, 2023

FYI the hack comes from Here

@so1ve
Copy link
Member Author

so1ve commented Jun 13, 2023

I don't know if it's the right approach. As I said, I don't think it's OK to import packages that might not exist but maybe TS is fine with it...

Yes, the original logic is to ignore errors through @ts-ignore. In this case the imported type will be any, but I don't know why in 5.1.3 the type is still any but the behavior changed.

@rchl
Copy link
Collaborator

rchl commented Jun 13, 2023

Oh, I see now that the original code also imported those so I guess this is not any worse.

@so1ve so1ve changed the title fix: declare GlobalComponents fix: component type missing Jun 13, 2023
@so1ve so1ve mentioned this pull request Jun 13, 2023
8 tasks
@so1ve so1ve marked this pull request as ready for review June 13, 2023 11:43
@johnsoncodehk johnsoncodehk changed the title fix: component type missing fix: component type missing for TS 5.1.3 Jun 13, 2023
@johnsoncodehk johnsoncodehk merged commit d1b985b into vuejs:master Jun 13, 2023
3 checks passed
@so1ve so1ve deleted the fix/component-type-missing branch June 14, 2023 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants