Skip to content

feat(rpc): expose native shared state for custom channels - #410

Draft
dvcolomban wants to merge 1 commit into
devframes:mainfrom
dvcolomban:dvcol/browser-rpc-primitives
Draft

dvcolomban wants to merge 1 commit into
devframes:mainfrom
dvcolomban:dvcol/browser-rpc-primitives

Conversation

@dvcolomban

@dvcolomban dvcolomban commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Background (Why)

Custom RPC channels can already use createRpcClient() and createRpcServer(), 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.

@vercel

vercel Bot commented Sep 28, 2026

Copy link
Copy Markdown

@dvcolomban is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@dvcolomban
dvcolomban force-pushed the dvcol/browser-rpc-primitives branch from 85ea1e6 to fb8cf6a Compare September 28, 2026 15:01
@dvcolomban dvcolomban changed the title feat: expose shared state and JSON rendering for custom RPC channels feat(rpc): expose native shared state for custom channels Sep 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant