| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…cket extend Device; improvements overall on types
…ts), fix bug with masks on fragmented reads, and add mask decode to control messages
There was a problem hiding this comment.
I'm not sure about this change. It must fix a problem you see. But, it also would require the caller to set host, port, and path in the options object, which isn't what we want.
Sorry, something went wrong.
There was a problem hiding this comment.
Good catch - on review I see I misunderstood what it was doing. I'll fix...
Sorry, something went wrong.
|
Fixes are in place. Let me know what else you find.. |
Sorry, something went wrong.
- tls extends tcp instead of full definition - Add 'undefined' as possible `read` result
| set format(format: string); | ||
| get format(): string; | ||
| } | ||
| export default class TLSSocket extends TCP {} |
There was a problem hiding this comment.
I'm no TypeScript expert, but don't you need to define that the TLSSocket constructor uses TLSOptions instead of TCPOptions for the options object argument?
Sorry, something went wrong.
There was a problem hiding this comment.
Thank you for filling this in. The change is good. I don't want even more copies of the HTTP status code map in the repo. I'll make a module for those so it can be shared. But that doesn't need to hold this up.
Sorry, something went wrong.
There was a problem hiding this comment.
419 UDP only specifies udp.read() - no argument and returns ArrayBuffer augmented with port and address. It does not specify multicast (though that's definitely on the roadmap)
Sorry, something went wrong.
| socket: TCPDevice | TLSDevice; | ||
| port?: number; | ||
| host: string; | ||
| dns: DNSUDPDevice; |
There was a problem hiding this comment.
There's no requirement that this is a DNS using UDP. It could be another resolution transport. But, for the moment this is probably OK?
Sorry, something went wrong.
There was a problem hiding this comment.
I'd say we add a generic DNS type when we have more, and change ClientOptions to use that (or just DNSUDPDevice | DNSOtherDevice here). Either way, it won't be a breaking change as it is just expanding the type. But using 'any' (or 'undefined') isn't a good alternative as it isn't strongly typed.
Sorry, something went wrong.
…pstream changes), fix TLSSocket constructor type, remove paramaterized UDP.read
…ce is defined; remove udp.read(buffer); add TLSSocket.constructor with TLSOptions definition
|
Merged latest code and resolved conflicts. Reviewed io changes since initial PR and applied typing changes as needed. Removed some no-longer-needed code changes as they are now in base. Applied changes based on review comments from Peter. This has been working great for me for the last seven months (on an older version of Moddable) and compiles/passes all my tests with latest code. Ready for review and possible merging. |
Sorry, something went wrong.
|
Finally coming back around to this.... there's so much here that it is a little challenging to review. I'm not asking that you split it up, but it is a bit of an adventure to understand and review. That said, a lot of it looks good and we should get it merged. The *-device stuff is a bit confusing. I think I'm starting to understand it though. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This is the work I've done to date with io focused on making websocketclient to be reliable and strongly typed with TypeScript. It's a fairly substantial set of changes, mostly in the .d.ts files but some implementation (especially websocketclient).
Type changes:
Implementation changes:
I typed everything based on the current implementation and not ECMA-419 (many modules are inconsistent with the published 2nd edition of the spec).