Skip to content

feat(workers): add createWorkerRPC for type-safe module worker communication - #1036

Open
deny-dz wants to merge 1 commit into
solidjs-community:mainfrom
deny-dz:feat/workers-typed-rpc
Open

feat(workers): add createWorkerRPC for type-safe module worker communication#1036
deny-dz wants to merge 1 commit into
solidjs-community:mainfrom
deny-dz:feat/workers-typed-rpc

Conversation

@deny-dz

@deny-dz deny-dz commented Aug 22, 2026

Copy link
Copy Markdown

Summary

This PR introduces createWorkerRPC to @solid-primitives/workers:

  • Modern Module Web Worker Support: Unlike existing string-blob inline workers, createWorkerRPC seamlessly works with external TypeScript/ESM module workers created via bundlers (new URL('./worker.ts', import.meta.url) in Vite, Webpack, and SolidStart).
  • Type-Safe RPC Proxy: Wraps workers in a typed TypeScript proxy that converts worker method signatures into Promise-returning RPC calls (mathWorker.compute(...)).
  • Correlation IDs & Timeouts: Generates unique request IDs to safely match async responses, with customizable call timeouts (default 30s).
  • Automatic Transferables: Automatically detects ArrayBuffer and ArrayBufferView arguments to transfer ownership without cloning.
  • Lifecycle Cleanup: Automatically terminates the worker and rejects in-flight promises upon Solid owner cleanup.

Changes

  • packages/workers/src/rpc.ts: Core createWorkerRPC proxy implementation.
  • packages/workers/src/index.ts: Re-export createWorkerRPC and Promisify types.
  • packages/workers/test/rpc.test.ts: Vitest test suite.
  • .changeset/workers-typed-rpc.md: Minor changeset.

@changeset-bot

changeset-bot Bot commented Aug 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: bbbdf55

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solid-primitives/workers Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@deny-dz, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Limit details: You’ve used all 4 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2ac5a662-6c2a-4dd5-bc21-7543a89fef55

📥 Commits

Reviewing files that changed from the base of the PR and between c7b608c and bbbdf55.

📒 Files selected for processing (4)
  • .changeset/workers-typed-rpc.md
  • packages/workers/src/index.ts
  • packages/workers/src/rpc.ts
  • packages/workers/test/rpc.test.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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