capnweb 0.0.0-99ecb6b → 0.0.0-a64e425
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/dist/index-workers.cjs +2661 -0
- package/dist/index-workers.cjs.map +1 -0
- package/dist/index-workers.d.cts +2 -0
- package/dist/index-workers.d.ts +1 -1
- package/dist/index-workers.js +50 -6
- package/dist/index-workers.js.map +1 -1
- package/dist/index.cjs +2638 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +372 -0
- package/dist/index.d.ts +29 -21
- package/dist/index.js +50 -6
- package/dist/index.js.map +1 -1
- package/package.json +16 -12
package/README.md
CHANGED
|
@@ -528,6 +528,14 @@ export default {
|
|
|
528
528
|
}
|
|
529
529
|
```
|
|
530
530
|
|
|
531
|
+
#### Compatibility with Workers' built-in RPC
|
|
532
|
+
|
|
533
|
+
Cloudflare Workers has long featured [a built-in RPC system with semantics similar to Cap'n Web](https://developers.cloudflare.com/workers/runtime-apis/rpc/).
|
|
534
|
+
|
|
535
|
+
Cap'n Web is designed to be compatible with Workers RPC, meaning you can pass Cap'n Web RPC stubs over Workers RPC and vice versa. The system will automatically wrap one stub type in the other and arrange to proxy calls.
|
|
536
|
+
|
|
537
|
+
For best compatibility, make sure to set your [Workers compatibilty date](https://developers.cloudflare.com/workers/configuration/compatibility-dates/) to at least `2026-01-20`, or enable the [compatibility flag](https://developers.cloudflare.com/workers/configuration/compatibility-flags/) `rpc_params_dup_stubs`. (As of this writing, `2026-01-20` is in the future, so you will need to use the flag for now.)
|
|
538
|
+
|
|
531
539
|
### HTTP server on Node.js
|
|
532
540
|
|
|
533
541
|
A server on Node.js is a bit more involved, due to the awkward handling of WebSockets in Node's HTTP library.
|
|
@@ -642,6 +650,10 @@ function newWebSocketRpcSession(
|
|
|
642
650
|
: Disposable;
|
|
643
651
|
```
|
|
644
652
|
|
|
653
|
+
### HTTP server using Hono
|
|
654
|
+
|
|
655
|
+
If your app is built on [Hono](https://hono.dev/) (on any runtime it supports), check out [`@hono/capnweb`](https://github.com/honojs/middleware/tree/main/packages/capnweb).
|
|
656
|
+
|
|
645
657
|
### MessagePort
|
|
646
658
|
|
|
647
659
|
Cap'n Web can also talk over MessagePorts. This can be used in a browser to talk to Web Workers, iframes, etc.
|