pladaria / reconnecting-websocket

Reconnecting WebSocket. For Web, React Native, cli (Node.js)
MIT License
1.22k stars 197 forks source link

fix: Resolve TS 3.7 errors #113

Closed ffflorian closed 4 years ago

ffflorian commented 4 years ago

When building reconnecting-websocket with TypeScript 3.7, there were two errors:

[!] (rpt2 plugin) Error: /[redacted]/reconnecting-websocket/reconnecting-websocket.ts(8,5):
semantic error TS2440: Import declaration conflicts with local declaration of 'CloseEvent'.
[!] (rpt2 plugin) Error: /[redacted]/reconnecting-websocket/reconnecting-websocket.ts(336,17):
semantic error TS2774: This condition will always return true since the function is always defined. Did you mean to call it instead?

Both of them appeared also when using the definition files in another project with TypeScript 3.7 breaking it's build.

This fixes both of them and re-building the project will create a 3.7-compatible .d.ts file.

EricCrosson commented 4 years ago

On my machine this branch fails to pass the provided tests

ffflorian commented 4 years ago

@EricCrosson thanks for the hint, I didn't notice that. It's fixed now and @pladaria can decide which PR to accept :)

EricCrosson commented 4 years ago

quick on the draw @ffflorian , nice work 👍

bennycode commented 4 years ago

@pladaria Have you had time to look into it?

bennycode commented 4 years ago

@pladaria Do you need support for your library?

bennycode commented 4 years ago

@pladaria We forked your library to make it work with TypeScript 3.7: https://github.com/wireapp/reconnecting-websocket/tree/fix-types

If anyone wants to benefit from the PR here, then please add the following to your package.json:

"reconnecting-websocket": "wireapp/reconnecting-websocket#96ac796ae8c7a7d9d857f46ed39dbedd7b9ad378"
bennycode commented 4 years ago

@pladaria Are you reading this?

bennycode commented 4 years ago

@pladaria I am back from Christmas holidays. How about you? 🎄

quentinus95 commented 4 years ago

Would someone be ready and have time to create, publish and maintain a separate fork of this lib? Most pull requests take about a year to be merged (for simple fixes), e.g. https://github.com/pladaria/reconnecting-websocket/pull/94. I believe it could be useful to create and maintain a separate repository.

pladaria commented 4 years ago

Thanks!

pladaria commented 4 years ago

published reconnecting-websocket@4.3.0