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

Migrate to Typescript #112

Open
imcvampire opened this issue Sep 30, 2021 · 6 comments
Open

Migrate to Typescript #112

imcvampire opened this issue Sep 30, 2021 · 6 comments

Comments

@imcvampire
Copy link
Owner

Convert the current code to Typescript could help to solve some problems with type definition

@callmehiphop
Copy link

👋 I'd be happy to help with this. I'm curious about what kind of type problems you have currently?

@imcvampire
Copy link
Owner Author

@callmehiphop This package has some problem with typing on TS: it isn't correct and enough for some people.

@callmehiphop
Copy link

So I've been having a go at this today. I think I understand the issues now - I'm not sure its possible to support both version 2 and version 3 in the same package since it involves augmenting 2 modules where 1 of them is most certainly going to be absent. Seems like we want to export these separately. Thoughts on that?

@imcvampire
Copy link
Owner Author

So as I understand, it means we will have a breaking change because of 2 different entry points?

@dapug
Copy link

dapug commented Oct 24, 2021

I'm unclear on the OP, but this might be similar to the issue I was going to raise. Are you saying you are not getting type safety and IntelliSense? That is certainly true here:
const axios: any = inject('axios') // inject axios

... and VS Code is not going to be helpful in using axios at all, no IntelliSense. I was looking at a solution like using InjectionKey:
https://logaretm.com/blog/2020-12-23-type-safe-provide-inject

@imcvampire
Copy link
Owner Author

@dapug I think your problem is related too. As I am not an expert on both TS and Vue3, I just raise it here to get some helps/suggestions on resolving all TS-related problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants