nicolas-van / modern-async

A modern JavaScript tooling library for asynchronous operations using async/await, promises and async generators
https://nicolas-van.github.io/modern-async/
MIT License
200 stars 8 forks source link

TypeScript Support #2

Closed VeryCrazyDog closed 2 years ago

VeryCrazyDog commented 3 years ago

Please explain the feature or improvement you would like: TypeScript type support, mainly the type declaration.

Please describe the use case where you would need that feature (the general situation or type of program where that would be helpful): For projects that use TypeScript, type declaration is needed for type checking and autocomplete.

Please explain why you think that feature would be helpful to other people: A lot of projects are using and migrating to TypeScript. For example, Visual Studio Code is using TypeScript.

If you know another library similar to this one that already propose that feature please provide a link:

nicolas-van commented 3 years ago

Hello.

I was already considering this feature in a "not too far future". So yes, it will be done eventually.

On the other hand, if you are already skillful in writing type declarations, proposing them in a pull request will probably get it done quicker than if we have to wait I have some time to make them ^^

VeryCrazyDog commented 3 years ago

The library is actually quite new, just curious, why not write in TypeScript in the first place?

On the other hand, will you consider to migrate to TypeScript rather than only adding type declaration on top?

nicolas-van commented 3 years ago

Yeah... You're aware that not everyone thinks that Typescript is the language of the future right ? (Or a better language,... or a good language,... or ... a language) 😆

But enough with programming language trolling 😀. No, it won't rewritten in Typescript. Just adding type definitions would be good enough.

VeryCrazyDog commented 3 years ago

Understood. But with deno supporting TypeScript it won't be that worse I think.

Anyway, I will see what I can do on this issue when I got some time.

kigster commented 3 years ago

I couldn't resist interject into this lovely debate.

I have written my first line of JavaScript in 1996. I am currently learning "advanced topics" in typescript, as I work on a large legacy app.

It's been a quarter of a century and I am still forced to do stupid shit like _.isObject or even worse for validating an object implements an interface.

Too many times typescript is all red, yet the app compiles and runs.

What TypeScript did is give us a brain twisting type system nobody needs, which is all but gone by the time your code is running.

The Web needs a new language.

I've fallen in love with Ruby in 2007. Oh how I wish Ruby interpreter was built into the browser.

CSS is unrecognizable compared to 25 years ago. But JS? Eh? Not that much.

nicolas-van commented 3 years ago

@kigster : I don't think this specific project is the right place to have debates about programming languages, there is reddit for that 😃 .

nicolas-van commented 3 years ago

Has been published in version 1.1.0 .

homerjam commented 2 years ago

I think the types are excluded in the files when published!

And just to join in with the thread! FWIW I hated typescript, I thought it wasted a lot of time, depending on the project that can still be the case. But as soon as you have a larger more complex project I can honestly say it saves time.

It's hard to justify a rewrite but if I were starting anything new I would certainly use Typescript. There's really no argument against it in modern development, when was the last time you worked on anything without some sort of compilation or build step.

nicolas-van commented 2 years ago

It's fixed in 1.1.1 .

homerjam commented 2 years ago

👏