-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
support typescript #250
Comments
@BoostIO funded this issue with $50. See it on IssueHunt |
Hi, am trying to use |
OK, figured out the above issue: it's explained in this link: It seems to work, as the build size (with the demo which only uses the Button component), goes from around 1.1 mb unzipped to around 0.15 mb , ie: 7x smaller (again, only using the Button component). But that still leaves open the question of using Seems like this is the best place to post typescript-related magical incantations. |
@davidm-public has funded $50.00 to this issue. See it on IssueHunt |
Added $50 to bounty using my public github account |
@davidmoshal |
@tangjinzhou I am unable to parse your comment.
"You can temporarily remove the project from ts-loader." ?
|
@davidmoshal We will provide ts type files as soon as possible. |
@tangjinzhou thanks, btw, iView has Typescript support, you may want to look at how they did it: https://github.com/iview/iview/tree/2.0/types David |
I have tried to implement it since I am using vue-cli typescript setup, but I had no success, even if creating an file (shims-antd.d.ts) in src folder with this content: import Vue from 'vue';
import Form from 'ant-design-vue/lib/form';
declare module 'vue/types/vue' {
interface Vue {
$form: Form
}
} |
@calebeaires I'm not sure what you're trying to accomplish. I'm no expert here, but it looks like you're referencing a If you want to use types, the options would appear to be: a) write b) write a Take a look at how the iView project did it, is this link For me I just declare the 'antd-design-vue' namespace in a shim file, and then a declare the occasional class or function of interest. It's not ideal, obviously. I have to admit it's a bit of a mystery to me why folks don't just write their code in Typescript in the first place. I mean you get so much upside, and absolutely no downside. As you know Vue itself is being re-written in Typescript, and Ryan Dahl, the creator of Node.js is re-writing node to run Typescript natively: see Deno. |
@davidmoshal Like you sugest, the module I wrote above were put in a form.d.ts file be intrepreted as a referece in the For some reason, after closing VSCode and openning it again an the $form property starts to be showen on VSCode tooling. |
@tangjinzhou Can you give us some date or rodamap to the types feature. Maybe we can help buinding it. |
Some community developers have already developed it. If it goes well, it will be completed in the last week or two. |
@akki-jat has submitted a pull request. See it on IssueHunt |
@tangjinzhou has rewarded $70.00 to @akki-jat. See it on IssueHunt
|
@tangjinzhou thank you sir. |
How can I actually use the TypeScript definitions? If I write this: |
@ssssssander can you try with ES6 import syntax eg. |
@akki-jat That works, but I'd like to load only the components I need using TypeScript |
So @ssssssander, you can use babel-plugin-import as described in docs of library or if you still want to use Example (module declaration in shims-vue.d.ts file )
If you still have any query related to typescript feel free to ask. |
@akki-jat I did what you suggested, and when trying to edit a config and when calling Vue.use: |
@ssssssander I need more details on how you are using components. You can also add you use case and open pull request on given repo so, I can help you more on the same. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What problem does this feature solve?
support typescript
What does the proposed API look like?
no
The text was updated successfully, but these errors were encountered: