Skip to content

Use type information of rpcHandlers for worker.call#379

Open
mrxz wants to merge 1 commit into
sparkjsdev:mainfrom
mrxz:worker-rpc-typing
Open

Use type information of rpcHandlers for worker.call#379
mrxz wants to merge 1 commit into
sparkjsdev:mainfrom
mrxz:worker-rpc-typing

Conversation

@mrxz

@mrxz mrxz commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Calling worker.call was mostly untyped with args: unknown and a return type of Promise<unknown> which required all callers to perform type assertions. Generally this meant that both sides needed to be in sync in terms of the expected types. This PR exports the type information of rpcHandlers and uses it instead.

Since only the type is exported and imported, this has no impact on the resulting bundle. There were a handful of places that needed minor changes to get the TypeScript compiler to be agree.

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