feat(rpc): expose native shared state for custom channels - #410
Draft
dvcolomban wants to merge 1 commit into
Draft
dvcolomban wants to merge 1 commit into
dvcolomban wants to merge 1 commit into
Conversation
|
@dvcolomban is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
This was referenced Sep 28, 2026
dvcolomban
force-pushed
the
dvcol/browser-rpc-primitives
branch
from
September 28, 2026 15:01
85ea1e6 to
fb8cf6a
Compare
This was referenced Sep 28, 2026
This branch has not been deployed
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.
Background (Why)
Custom RPC channels can already use
createRpcClient()andcreateRpcServer(), but the native shared-state implementations are not public. Channel bindings otherwise have to copy that synchronization logic or construct a full node context.Changes (What)
Export the existing implementations through
devframe/rpc/shared-state, accepting the native RPC members they use. Subscription handlers read the calling connection's birpc metadata, so custom channels and the existing node context share the same subscription behavior. A failed initial snapshot now rejects instead of leaving its promise pending.Build the RPC entry points with the browser-safe graph and include them in the browser-import guard. Existing implementation files stay in place. The channel binding still owns peer authentication, serialization and disconnection.
This draft is now limited to RPC and shared state. JSON rendering is in #411 and baseline diagnostic snapshot repairs are in #412.
Verification (Testing)
Six focused tests pass, including two real MessageChannel peers through both custom channels and the native node context. They cover subscription isolation, writes, disconnection and rejected initial snapshots. The devframe build, package type check, scoped lint and Knip pass. The browser-import guard finds no forbidden imports across 31 reachable chunks and 20 entry points.
The new and changed API snapshots were generated from fresh artifacts. The unchanged baseline has three stale diagnostic snapshots, confirmed in base CI; their repair is separate from this feature. Full-repository validation runs in CI.