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

Write the library in TypeScript #1623

Closed
ORESoftware opened this issue Aug 23, 2019 · 7 comments
Closed

Write the library in TypeScript #1623

ORESoftware opened this issue Aug 23, 2019 · 7 comments

Comments

@ORESoftware
Copy link

I am looking for a WebSockets library written in TypeScript

https://www.quora.com/unanswered/Is-there-a-Websocket-library-for-Node-js-written-in-TypeScript

it looks like @types/ws exists, but since it's packaged separately, often the types become out-of-sync.

@ORESoftware
Copy link
Author

case in point, latest version of the types is: @types/ws@6.0.3, latest version of the lib is 7.x.

@lpinca
Copy link
Member

lpinca commented Aug 23, 2019

No thanks. https://twitter.com/mikeal/status/1150791274053505024

@ORESoftware
Copy link
Author

ORESoftware commented Aug 23, 2019

@lpinca that twitter thread is about writing @types/ws which already exists. I am talking about writing the library itself in TS.

I looked at the codebase. All you have to do is transpile src to lib:

src -> lib

using TS, it's easy to do

@lpinca
Copy link
Member

lpinca commented Aug 24, 2019

I don't want to rewrite the lib in TypeScript, maintain type definitions, and add any additional transpile step, sorry.

@lpinca lpinca closed this as completed Aug 24, 2019
@shobhitg
Copy link

I respect the choice of not adding work to re-implement the library in typescript. But just wanted to correct that if the all the code is re-written in typescript, then there is no need to maintain type definitions separately.

@ORESoftware
Copy link
Author

its possible that TS can target WebAssembly, so it might be a good idea :-)

@beary
Copy link

beary commented May 7, 2020

I respect the choice of not adding work to re-implement the library in typescript. But just wanted to correct that if the all the code is re-written in typescript, then there is no need to maintain type definitions separately.

Yes, type definitions will be generated automatically at compile time. Just write ts and run tsc is enough. This library does not depend on other libraries, it should not be difficult to write using TypeScript, maybe I can have a try if I'm free.

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

No branches or pull requests

4 participants