-
Notifications
You must be signed in to change notification settings - Fork 0
feature: isomorphic WebSocket support
#32
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
Conversation
|
How i got perf_hooks working ^ |
| }; | ||
|
|
||
| protected handleSocketError = (err: Error) => { | ||
| protected handleSocketError = (err: any) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the cause can either be an Error or an event. It doesn't rlly matter what this value is, as it's just set as the cause of the thrown error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using any type tends to be pretty hacky. Generally if the type isn't well defined and it doesn't really matter then unknown can be used instead of any.
While any can be anything and assigned to anything. unknown could be anything but can't be assigned to anything else. So it's safer to use. https://stackoverflow.com/questions/51439843/unknown-vs-any
That's a downstream thing right? Not something this repo would do. Because it produces an npm package. However you can update the readme to explain too. |
|
@CMCDragonkai yes, it would be something that downstream would have to do. Although, we can automatically apply the polyfill in js-timer directly if we want to. |
No we shouldn't preemptively polyfill. So readme it is. Did you read my review? |
Description
Allows
WebSocketClientandWebSocketConnectionto work with the browserWebSocketimplementation.To note some discoveries:
Bufferperf_hookswith the browserperformanceAPI to work with browsers.Issues Fixed
Tasks
WebSocketClientwork with browserWebSocketsWebSocketConnectionwork with browserWebSocketsWebSocketusingwslibrary.Final checklist