Replies: 1 comment
-
|
Closing as i’ve made progress on types (#1429) so the original reason for this discussion is resolved. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
(several edits since I first posted, all before any feedback)
I'm working on the typings for
embedded:network/websocket/client, but it quickly devolved into needing to flush out other types. I have a few questions and likely will have more later, so it seemed appropriate to start a discussion.For
websocket/client:onControlinterface is inconsistent with the ECMA-419 specification, as the implementation returns aUint8Arraybut the specification says it should beArrayBuffer. I would preferUint8Arrayas the data is more immediately accessible but it's inconsistent with ECMA-419. Should this be changed toArrayBufferor should the spec change?network.ws.clientandnetwork.wss.clientwith options on the "Host provider instance" (device) but they are currently missing, instead being used asnetwork.wsandnetwork.wss. I've left it for now as implemented, but either the spec or the implementation should be updated.constdefinitions and types for the codes themselves. Let me know if I can help.I've noticed that some
ioimplementations do not use theembedded:xxxnamespace, and at least some do not conform to the 2nd ECMA-419 spec. For example,sntp, which I was going to use but fell back on the legacy version for now since it didn't seem current. Am I correct in assuming I should ignore them if they are not part ofembedded:and await updates? Or do you have advice on whichiotypes are correct/current?I find error handling difficult to work with in
io. MostonErrorimplementations have no error argument, making it difficult to diagnose failures. For example, I have a web socket getting an error during connection. I have no idea why or what module causing the error (since they cascade the error). The few places that implement an error argument use a string, rather than anErrorobject, which means there is no stack or attachments. Additionally, the strings themselves don't identify which module caused the error, are short, and are not necessarily unique. Not only does this make debugging difficult, it means I can't present any meaningful error to my users as to why something failed.I find the directory structure of
ioconfusing. Thetypingsare fairly clean, but the implementations and examples are difficult to navigate. Some are inmodules, some are inexamples; some directory namespaces are significantly different than module namespace; it's not obvious which files in theexamplesset are test code vs. actual implementations. It would be great to clean up and unify the directory to be consistent with the namespace, and move core implementations into modules and out of examples.I'll be doing a PR soon for further discussion and review. I've adjusted
udp,tcp,tls,dns,websocket, andbuiltin- those thatwebsocketdepends upon - to be more comprehensive and usability. Similar work likely should be done on the other implemented types (I may do some of this before the PR). Some of the things I've done so far include:Deviceinto the global namespace, to pair withdevicebeing global.Devicetype when extended by modules, such aswebsocket/clientthat addsnetworkxxxDevicetype for several of the types that are the type used indevice, to avoid the redundancy currently used to define these types. For example, you now import fromdnsaDNSUDPDevicetype, and can use it for any place wherednsis used within theDevicetype (or when augmenting types)Beta Was this translation helpful? Give feedback.
All reactions