-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Adding typescript definition file #1689
Adding typescript definition file #1689
Conversation
I'll make this as "in progress" for now. Please do let me know when you have a question or need a code review. |
Related #1688. |
Some Core options added
CLAassistant was complaining
If you check the fine-uploader.spec.ts fle, If I use the 'new' keyword to instantiate FineUploader, TypeScript is complaining. |
http://docs.fineuploader.com/branch/master/api/options-ui.html#thumbnails.placeholders |
Thanks for finding that issue in the docs. I'll push a fix for that next. Regarding Not sure if Typescript provides some magic that makes |
http://docs.fineuploader.com/branch/master/api/options-azure.html#signature.endpoint |
Thanks for catching that. Fixed! |
S3 and Azure UI options interface needs some refactoring and is not working yet.
Note that your branch should be based off of Fine Uploader develop |
I see that you have changed the base branch from master to develop. |
it probably doesn't matter much since, at the time you forked, master and develop were identical. |
http://docs.fineuploader.com/branch/master/api/qq.html#qq.each |
I'd suggest leaving any of the |
Okay, well so far I've written about 80% of util functions already. I'll take them out then. |
Sorry. If you're almost done with util functions, you are free to proceed. I can just remove them once 6.0 is released, which may not be for a while anyway. I'll fix the docs for |
Just started to look at this again. Sorry for the delay, but I'm only able to pick up a few minutes here and there for the foreseeable future. What exactly is |
Just started to look at the definition file. I can safely say that I'll never have enough time to review all of that, nor will I be able to verify since I don't use TS in any projects. So I'm included to just merge this through since no existing code was updated and this this is localized to a particular integration point that did not previously exist. But I'm wondering - how do projects pick up this definition file? How does TS locate this? Where does it have to reside inside of the package retrieved from npm? |
The I'm currently using it as if installed using third option. |
Fine with the first approach. To complete this:
I think it would be nice if a feature page was created or something somewhere in the docs was updated to reflect TS support. Related: Are you interested in becoming a contributor for this project? Seems you now have a better understanding of the API than most at this point. |
As of TS v2.1, the first approach seems to be working properly (Wasn't working before, that's why I was using @types approach). And yes I have no issues with becoming a contributor. What do I have to do in order to be so? |
My bad, I can get it working only by using @types approach. |
@SinghSukhdeep Was wondering if you have any updates on your progress, or if you need anything from me? |
@rnicholus sorry didn't get any time during the holidays and had some tight deadlines before that, will have some time this week to look at it. |
No rush at all. Just checking in. |
@SinghSukhdeep Just wanted to bring to your attention DefinitelyTyped/DefinitelyTyped#13768. It just came onto my radar a few days ago. It's not clear to me how this affects your efforts here. Was wondering if you had some comments. In particular, regarding this area of the DefinitelyTyped readme - https://github.com/DefinitelyTyped/DefinitelyTyped#removing-a-package. |
I looked at it, they are also preparing a similar definitions file as we are. About removing a package, once we publish fine-uploader with the definitions included, then they can deprecate that package, we don't have to do it. In this pull I need to set the |
Hi @SinghSukhdeep, I'd be willing to help, but could you explain to me the way this library is used? On the DefinitelyTyped tests, everything uses a |
The library can be used as a module. Examples/details at http://docs.fineuploader.com/branch/master/features/modules.html. |
After looking at this closer, could it be that the definition file is not included with the packaged library, and that is the cause of this issue? The entire source tree is not published to npm. There is a build step that only includes the bundled code and a subset of the project root. This is something I mentioned in a comment a while back. |
@andy-ms okay got it, I also came to this resolution because I'm not using the library as a module and I was missing that triple slash directive. Any chance someone can review our code before we publish the package? |
@SinghSukhdeep I think you did some really nice thorough work here. @rnicholus I think we need to set up CI for this TypeScript component. Treating the TypeScript definitions as first class is much better than having it maintained in the DefinitelyTyped repository, and I'd be happy to contribute. Would it be possible to have a feature branch that both @SinghSukhdeep and I could work out of? |
I'd be happy to add you both as contributors to fine-uploader. Then, this PR could be merged into a local feature branch where work could continue. How does that sound? |
Sounds great to me |
I've sent both of you invitations. In order to bring this into the repo without merging it into develop (since it's not complete yet), I think the next steps should be:
|
Everything done. New PR #1719 |
Brief description of the changes [REQUIRED]
Adding TypeScript definitions allows integration with TypeScript based projects
What browsers and operating systems have you tested these changes on? [REQUIRED]
N/A
Are all automated tests passing? [REQUIRED]
I haven't written tests for this yet
Is this pull request against develop or some other non-master branch? [REQUIRED]
yes