Skip to content

fix(devframe): add force? param to RpcFunctionsCollector register/update#91

Merged
antfu merged 1 commit into
mainfrom
brave-areas-hope
Jul 15, 2026
Merged

fix(devframe): add force? param to RpcFunctionsCollector register/update#91
antfu merged 1 commit into
mainfrom
brave-areas-hope

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

What

Add the optional force?: boolean parameter to register and update on the RpcFunctionsCollector interface so it matches its concrete implementation.

Why

RpcFunctionsCollectorBase.register() / .update() already accept a second force?: boolean argument, and the runtime honors it (force: true overwrites, skipping DF0021/DF0022). The server-side RpcFunctionsHost is typed off the concrete class, so it types force correctly.

The client-side host, however, is typed off the RpcFunctionsCollector interface (via DevframeClientRpcHost = RpcFunctionsCollector<…>), which declared register/update without force. As a result, calling client.register(fn, true) on the client was a type error ("Expected 1 arguments, but got 2.") and required a cast, even though it works at runtime.

Aligning the interface with the implementation lets client-side register(fn, true) / update(fn, true) type-check without a cast.

Verified with pnpm typecheck, pnpm test (652 passing, API snapshot unchanged).

This PR was created with the help of an agent.

The RpcFunctionsCollector interface omitted the force? argument that the
concrete RpcFunctionsCollectorBase class and its runtime already support.
Because the client-side host is typed off the interface (via
DevframeClientRpcHost), calling register(fn, true) / update(fn, true) on
the client was a type error and required a cast even though it works at
runtime. Align the interface with the implementation.
@netlify

netlify Bot commented Jul 15, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit d43f7d7
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a56dbe9a79ac90008f02637
😎 Deploy Preview https://deploy-preview-91--devfra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@antfu antfu merged commit 36e193c into main Jul 15, 2026
11 of 12 checks passed
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.

2 participants