Skip to content

[niljs]: New openrpc client#850

Merged
ukorvl merged 2 commits intomainfrom
new-openrpc-client
May 8, 2025
Merged

[niljs]: New openrpc client#850
ukorvl merged 2 commits intomainfrom
new-openrpc-client

Conversation

@ukorvl
Copy link
Copy Markdown
Contributor

@ukorvl ukorvl commented Apr 23, 2025

This diff replaces @openrpc/client-js with custom implementation and json-rpc-2.0 for requests orchestration and requests' id management.

Errors are now distinguished between network errors and json-rpc errors, and we can control the error handling manually. IT can be useful for providing custom error messages for users.

All kinds of transport are removed for now except HTTPTransport. later we can add WebSockets support when needed.
The client creates request and passes it to the transport layer. Transport layer executes request, handles errors and passes the response back to the client.

Bundle size (gzipped) is decreased from 8.29 Kb to 8.17Kb and moreover expensive @openrpc/client-js (207 kB) is replaces with json-rpc-2.0 (134 kB) which is almost 2 times less.

closes #250

@ukorvl ukorvl added the niljs Related to niljs client library label Apr 23, 2025
@ukorvl ukorvl self-assigned this Apr 23, 2025
@ukorvl ukorvl requested a review from KlonD90 as a code owner April 23, 2025 11:21
@ukorvl ukorvl marked this pull request as draft April 23, 2025 11:21
@ukorvl ukorvl force-pushed the new-openrpc-client branch from 1c9677a to 78ce9ff Compare April 30, 2025 12:57
@ukorvl ukorvl force-pushed the new-openrpc-client branch from 78ce9ff to 970651a Compare May 6, 2025 18:41
@ukorvl ukorvl force-pushed the new-openrpc-client branch from 970651a to 61da76e Compare May 7, 2025 12:55
@ukorvl ukorvl marked this pull request as ready for review May 7, 2025 13:14
@ukorvl ukorvl force-pushed the new-openrpc-client branch from 61da76e to 6977bcf Compare May 7, 2025 13:26
@ukorvl ukorvl force-pushed the new-openrpc-client branch from 6977bcf to 2323834 Compare May 7, 2025 13:54
@ukorvl ukorvl added this pull request to the merge queue May 8, 2025
Merged via the queue into main with commit 86e8508 May 8, 2025
16 checks passed
@ukorvl ukorvl deleted the new-openrpc-client branch May 8, 2025 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

niljs Related to niljs client library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sub-Dependency in niljs is Deprecated

2 participants