-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Collaboration #1
Comments
Hi @hediet, thanks for your comment! I briefly skimmed through your code. I find in interesting and well-written.
Me neither. I had the need to implement a small websocket server to synchronize a multiplayer game, so I decided to give Deno a shot. My JSON-RPC implementation closely mirrors this need: to have something compatible up and running, working both in Deno and Browser as well (this turned out to be more complex than I initially thought).
I do not have runtime type checks at all -- I did not have this need, I am not familiar with io-ts and also my TS skills are not that great. Your contracts implementation, for instance, is currently far beyond my mental comprehension :-) On the other hand, I believe that this contract-based io-ts checking can be actually added as an additional layer to my impl, completely unrelated to the underlying JSON-RPC serialization and semantics.
Yeah, I see that your code is rich. In particular, your https://github.com/hediet/typed-json-rpc/blob/master/typed-json-rpc/src/StreamBasedChannel.ts happens to be very similar to what I have :) However, I focused only on the protocol itself, while you also have extensions that automatically do WebSockets, WebWorkers etc. I noted that you are missing the batching JSON-RPC feature -- my impl is also not fully doing that. Do you think this feature is worthy of implementation?
Definitely! 👍 |
Thanks for your quick reply ;)
Why? What has been your experience with Deno? Do you use webpack for the client to bundle your Deno code?
I think runtime type checks are very important for servers working with untrusted clients. I've seen a lot of server code that iterated over untrusted input using a for loop and the While I really love seperation of concerns, I think in this case, bundling JSON RPC with runtime type checks leads to better user code.
Good catch! I don't know what the performance gains of batching are. I think I'll add rudimentary support so that my library really is json rpc compatible. Besides compatibility reasons, I don't think batching has that much value, but implementing it shouldn't be much work either. |
My Deno experience is mostly fine. The problem is related to
Agreed! I currently have the comfort of a server being accessed only by my very own client.
I still believe that it should be possible to operate JSON-RPC without using these and add them incrementally when necessary/feasible. Incremental adoption is one of TypeScript's main goals, after all.
Agreed. At least on the server side. The client-side API is going to be slightly more complex in order to make a batched call. |
Hi Ondřej ;) Your library seems to be the first JSON RPC implementation for Deno!
Recently, I developed a fully typed JSON RPC library for TypeScript (NodeJS).
You might want to have a look at it (
hediet/typed-json-rpc
, in future it will just behediet/json-rpc
). You can find an architecture overview at the end of the readme. What do you think?I still don't know whether Deno is worth the hype, but if it is, it would be great to ensure that its ecosystem is awesome too!
The text was updated successfully, but these errors were encountered: