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.

@dmarcos

dmarcos commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

This needs rebase

@mrxz
mrxz force-pushed the worker-rpc-typing branch from 17a7c38 to 8597918 Compare August 25, 2026 10:50
@mrxz

mrxz commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

@dmarcos Rebased

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