Skip to content

Releases: shogowada/json-rpc-2.0

v1.1.0

17 Feb 09:34
Compare
Choose a tag to compare
  • Fix the bug where middleware cannot catch errors thrown from async non-advanced method
  • Support injecting custom error loggers to JSONRPCServer and JSONRPCServerAndClient

v1.0.0

22 Nov 10:13
Compare
Choose a tag to compare
  • Support batch requests

Breaking changes:

  • JSONRPCClient.receiveJSON now returns PromiseLike<JSONRPCResponse | JSONRPCResponse[] | null>.
    • It used to return PromiseLike<JSONRPCResponse | null>.
  • It drops support for using higher-order function to access client params and server params.
  • It uses async/await.
  • It depends on TypeScript v4.
    • It used to depend on v3.
    • I don't think we introduced anything new yet, but we will start using new features (e.g., unknown) as we see fit.

v0.2.19

25 Sep 22:17
Compare
Choose a tag to compare
  • Add server middleware: #24

v0.2.18

23 Jul 21:11
Compare
Choose a tag to compare

v0.2.17

23 Jul 11:52
Compare
Choose a tag to compare

v0.2.14

28 Dec 11:54
Compare
Choose a tag to compare
  • Exposed addMethodAdvanced and requestAdvanced from JSONRPCServerAndClient
    const serverAndClient = new JSONRPCServerAndClient(/* ... */);
    // Old way (still works)
    serverAndClient.server.addMethodAdvanced(/* ... */);
    serverAndClient.client.requestAdvanced(/* ... */);
    // New way (recommended)
    serverAndClient.addMethodAdvanced(/* ... */);
    serverAndClient.requestAdvanced(/* ... */);

v0.2.13

28 Dec 11:52
Compare
Choose a tag to compare
  • Deprecated using a higher-order function to receive client params
    // Old way (still works, but deprecated)
    new JSONRPCClient((jsonRPCRequest) => (clientParams) => /* send the request to server */);
    // New way
    new JSONRPCClient((jsonRPCRequest, clientParams) => /* send the request to server */)
  • Deprecated using a higher-order function to receive server params
    const server = new JSONRPCServer();
    // Old way (still works, but deprecated)
    server.addMethod("doSomething", (params) => (serverParams) => /* do something */);
    // New way
    server.addMethod("doSomething", (params, serverParams) => /* do something */);