Skip to content

refactor to be JSON-RPC 2.0 compliant - #532

Merged
KATT merged 94 commits into
mainfrom
feature/refactor-rpc
Jun 20, 2021
Merged

KATT merged 94 commits into
mainfrom
feature/refactor-rpc

Conversation

@KATT

@KATT KATT commented Jun 15, 2021 •

Copy link
Copy Markdown
Member
  • make websocket client JSON-RPC 2.0 compliant (with batching)
  • refactor http responses to be JSON-RPC 2.0 compliant - we map jsonrpc error codes to http ones for proper status codes

πŸ™ For reviewers

You can ignore the internals if you'd like, I mainly care about input on the JSON-RPC-stuff, see the docs below

Breaking changes

A few breaking changes as we're change public interfaces and response shapes but as long as you you only call tRPC handlers through the TRPCClient the usage should be changed

  • transformers now only applied to result output and error output
  • now using JSON-RPC 2.0 for all response shapes and using jsonrpc error codes - mapping to http codes where needed
  • removed deprecated stuff like TRPCClient onError() callback
  • formatError() should now return an error that is compliant to the JSON-RPC spec

@vercel

vercel Bot commented Jun 15, 2021 •

Copy link
Copy Markdown

This branch was successfully deployed

3 active deployments
Preview – todomvc β€” e5c9a445 Deployed Jun 20, 2021 by vercel[bot]
Preview – chat β€” e5c9a445 Deployed Jun 20, 2021 by vercel[bot]
Preview – www β€” e5c9a445 Deployed Jun 20, 2021 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants