-
#253
46de5a7Thanks @ndisidore! - Fixed methods declared to returnPromise<RpcStub<T>>producing broken stub-of-stub result types; they now type the same asPromise<T>. If you annotated such a result asRpcPromise<RpcStub<T>>, writeRpcPromise<T>instead. -
#242
9751a4eThanks @ndisidore! -RpcPromisecan now be constructed from aPromise: pipelined calls queue in order until it settles, so you can publish a capability that doesn't exist yet.
-
#241
2de5871Thanks @ndisidore! - Fix RPC argument and capture leaks on failure paths: call arguments are now reliably disposed when a call is rejected, delivered to a broken or disposed stub, or fails to serialize. -
#251
7a6e5daThanks @ndisidore! - TheRpcPromiseconstructor now applies the same stub elision as method result types: wrapping aPromise<RpcStub<T>>produces the sameRpcPromise<T>a method declared to return that stub would, plain-interface stub payloads keep their stub type, and promises resolving to inline object literals with methods now infer correctly. -
#243
7e864a8Thanks @ndisidore! - Fix WritableStream stubs leaking call arguments when the stub was already disposed or the call path was invalid. All failure paths inWritableStreamStubHook.call()now dispose the copied arguments, matching ReadableStream behavior.
- #239
667958eThanks @Maximo-Guk! - Keep the published runtime bundles ASCII-only. A doc comment introduced in 0.11.0 carried a U+2212 into every dist bundle, which breaks consumers that inline the bundle through Latin-1-only APIs likebtoa(). The comment is fixed and the build now fails if any non-ASCII byte reaches a runtime bundle indist/.
-
#212
1cca1a2Thanks @codehz! - Support RpcTargets (and other RPC stubs) as ReadableStream/WritableStream chunks without disposing their capabilities whenwrite()returns. Stream chunk payloads now keep lifecycle tied to the chunk (viaSymbol.disposewhen needed) so methods on streamed stubs remain usable after the write resolves. -
#201
7325f9dThanks @ttmx! - Support exact ArrayBuffer, DataView, and typed array serialization over RPC. -
#224
064b0f3Thanks @dimitropoulos! - Support serializingURLobjects over RPC.
-
#220
43aa384Thanks @ndisidore! - Remove the ~1ms per-batch latency floor in the HTTP batch client on Node and Bun by flushing viasetImmediateinstead of the clampedsetTimeout(0). -
#214
2a02db9Thanks @ndisidore! - The RPCReadableStreamtype accepts any RPC-compatible chunk type, matchingWritableStream. -
#238
1a1f0d4Thanks @Maximo-Guk! - Share oneRpcPromisealias betweenResultand the public export. Deeply-nested RPC interfaces no longer blow the checker's depth budget: this fixes all "excessively deep" / "excessive stack depth" (TS2589/TS2321) errors under TypeScript 7 (tsgo) and reduces TypeScript 5.9 type instantiations by ~13%.RpcPromise<T>for primitiveTnow also carries the pipeliningProvider<T>surface, matching what stub calls already returned.
- #185
0b20ec6Thanks @ndisidore! - Add configurable receiver-side resource limits (RpcSessionOptions.limits) that cap bigint length, message nesting depth, and incoming message size to guard against untrusted-peer resource exhaustion (#184).
-
#190
6e5c562Thanks @taylorodell! - Several correctness and robustness fixes:- Error deserialization no longer resolves an attacker-supplied error type name to an inherited
Object.prototypemember.ERROR_TYPESnow has a null prototype, so a wire value such as["error","constructor",...]no longer resolves toObject(which produced aStringwrapper instead of anError, bypassinginstanceof Errorchecks), and a name like"toString"no longer resolves to a non-constructor and throws. Unknown names correctly fall back toError. - Error deserialization now filters inherited
Object.prototypekeys (andtoJSON) out of an error's own-property bag, matching the behavior already applied when deserializing plain objects. Keys such as__proto__,toString, andvalueOfare no longer copied onto deserialized errors. - Resolving an import that has already been resolved now disposes the redundant resolution instead of overwriting (and leaking) the previous one.
- The
abortmessage handler now hands error handlers the unwrapped abort reason rather than the internal payload wrapper, matching therejecthandler. - WebSocket close reasons longer than the 123-byte limit are now truncated on a UTF-8 character boundary, so aborting a session with a long reason no longer throws from
WebSocket.close().
- Error deserialization no longer resolves an attacker-supplied error type name to an inherited
- #195
78744caThanks @aleister1102! - Fix nodeHttpBatchRpcResponse leaving the connection open and crashing with ERR_HTTP_HEADERS_SENT on non-POST requests. It now returns 405 immediately.
-
#186
c70bbb7Thanks @ashkalor! - Add transport encoding levels so custom RPC transports can work withjsonCompatiblevalues,jsonCompatibleWithBytesvalues, orstructuredClonablemessages instead of always receiving JSON strings.Note:
MessagePortsessions now post structured-clonable objects over the port instead of JSON strings. This changes the wire format between the two ends of the port, so both ends of aMessagePortsession must upgrade to this version together.
- #155
48f4d49Thanks @G4brym! - AddBlobas a serializable type over RPC.Blobobjects can now be passed as call arguments and return values. The MIME type (blob.type) is preserved across the wire.
-
#166
7413e43Thanks @aron-cf! - Errors properties, usingObject.keys(), are now preserved across the wire. Attach fields likecodeordetailsto anErrorand they propagate to the other side. Thecauseanderrors(forAggregateError) properties will also be preserved. -
#168
25baebfThanks @kentonv! - Fix memory leak that kept all messages received in a session pinned in memory until the session ended, due to surprising implementation details of JavaScript Promises. -
#152
9e499e2Thanks @VastBlast! - Fix serialization for Invalid/NaN dates
- #148
189fa79Thanks @kentonv! - Fixed type overrides for Uint8Array's toBase64 and fromBase64 leaking into capnweb's public interface.
-
#145
5667226Thanks @kentonv! - When Node'sBufferis available, Cap'n Web will now serialize it the same asUint8Array, and will deserialize all byte arrays asBufferby default.Bufferis a subclass ofUint8Array, so this should be compatible while being convenient in Node apps. -
#142
60be60dThanks @VastBlast! - Major improvements to type definitions, fixing bugs and making them more accurate.
- #145
5667226Thanks @kentonv! - Fixed base64 encoding of very large byte arrays on platforms that don't support Uint8Array.toBase64().
- #132
c2bb17bThanks @kentonv! - Added support for sending ReadableStream and WritableStream over RPC, with automatic flow control.
- #129
10abaf3Thanks @dmmulroy! - Fix RpcCompatible type to filter out symbol keys instead of mapping them to never
- #121
32e362fThanks @kentonv! - Improved compatibility with Cloudflare Workers' built-in RPC, particularly when proxying from one to the other.
- #78
8a47045Thanks @itaylor! - The package now exports the typeRpcCompatible<T>(previously calledSerializable<T>, but not exported), which is needed when writing generic functions onRpcStub/RpcPromise.
-
#120
1c87560Thanks @kentonv! - Fixed serialization of async functions. -
#117
d21e4caThanks @codehz! - Enhance Stubify and Unstubify for tuple types
-
#105
f4275f5Thanks @kentonv! - Fixed incompatibility with bundlers that don't support top-level await. The top-level await was used for a conditional import; it has been replaced with an approach based on "exports" in package.json instead. -
#105
f4275f5Thanks @kentonv! - Support serializing Infinity, -Infinity, and NaN.
-
#105
f4275f5Thanks @kentonv! - Attempting to remotely access an instance property of an RpcTarget will now throw an exception rather than returningundefined, in order to help people understand what went wrong. -
#107
aa4fe30Thanks @threepointone! - chore: generate commonjs build -
#105
f4275f5Thanks @kentonv! - Polyfilled Promise.withResolvers() to improve compatibility with old Safari versions and Hermes (React Native).