Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Add TypeScript definition tests #15

Open
wtrocki opened this issue Jun 12, 2017 · 5 comments
Open

Add TypeScript definition tests #15

wtrocki opened this issue Jun 12, 2017 · 5 comments

Comments

@wtrocki
Copy link
Member

wtrocki commented Jun 12, 2017

I was thinking about the idea of testing/maintaining compatibility of the declaration file with the JavaScript implementation in the longer term.

Perhaps the best way to ensure the TypeScript declaration file is always in sync with the JavaScript implementation would be to write the tests for this repo in TypeScript. This would ensure that they are always aligned (interface-wise) as the tests would fail if they weren't.

I think this would result in the RainCatcher team not having to be so attentive to the declaration file (leaving other contributors to forget about the TypeScript part), instead the maintenance of it would be shared among anyone who makes a PR.

@aidenkeating

@aidenkeating
Copy link
Contributor

aidenkeating commented Jun 12, 2017

@wtrocki 👍 Following on from Wei's comment, perhaps we could roadmap rewriting this repo in TypeScipt? This could be the first (or one of the first) tasks in that milestone (GitHub milestone 😜 ). WDYT?

@wtrocki
Copy link
Member Author

wtrocki commented Jun 12, 2017

From my point of view we may just need to improve our api to be little bit more object oriented and hide some more internal options from regular users. TypeScript source code may be good but only when we will consider more work on this - this may involve a lots of testing etc.

@wei-lee
Copy link
Contributor

wei-lee commented Jun 12, 2017

@aidenkeating @wtrocki yeah, I don't think we need a complete rewrite - I think majority of the changes will be adding new interfaces and types defs for many of the options, callbacks etc, and add TSDOC. Then we can generate the type definitions automatically.

We might just need some initial setup done first - e.g. adding the tasks to compile the TS and generate the definition file. Then the rest of the work can be done step by step - e.g. one file at a time, or even just one function at a time.

@evanshortiss
Copy link
Member

evanshortiss commented Jun 12, 2017

Would be nice to move it to TS given the relative complexity of the codebase. I find the most frequent issues with sync are caused not by sync, but rather misuse due to misunderstood docs/examples. TS could really improve developer experience so starting with .d.ts files would be great, and even porting piece by piece to TS might make maintainability and readability much better for the sync source code.

👍 for the suggestions in here

@wtrocki
Copy link
Member Author

wtrocki commented Jul 13, 2017

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

No branches or pull requests

4 participants