Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #871 +/- ##
==========================================
- Coverage 98.96% 95.32% -3.64%
==========================================
Files 9 10 +1
Lines 289 428 +139
Branches 43 79 +36
==========================================
+ Hits 286 408 +122
- Misses 3 20 +17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bd58428 to
a498ceb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add support for the OpenRPC
x-implemented-byextension toserver-js, enabling basic bidirectional APIs.The server will no longer require handlers for methods declared as client-implemented and can optionally call those methods over WebSocket connections.
This introduces a minimal ownership model:
No transport semantics or lifecycle rules are introduced — this strictly enables ownership-aware routing and outbound calls.
What this changes
Routing behavior
x-implemented-by: ["client"]are excluded from server handler registrationWebSocket outbound support
When using the WebSocket transport:
clientinterface for calling peer methodsNew usage patterns enabled
Inside a handler:
Server-level outbound usage:
Examples added
These demonstrate callback-style JSON-RPC usage without introducing pubsub semantics.
Motivation
OpenRPC historically models a server-handled API surface, but real JSON-RPC systems are commonly bidirectional:
Without an ownership signal, tooling cannot deterministically:
x-implemented-byenables this while remaining transport-agnostic and minimal.Scope
This PR intentionally does not introduce:
It only adds ownership-aware dispatch and optional outbound peer calls for WebSocket connections.
Backwards compatibility
Existing APIs continue to behave exactly the same:
x-implemented-by⇒ treated as server-implemented