Problem
The API documentation claims that the Client constructor supports a dataPack parameter, but the exported Client classes (Browser and Node.js) do not expose or forward it.
Although the internal CommonClient already accepts and uses dataPack, both public wrappers omit this parameter, making the documented feature unusable.
Impact / Motivation
Custom DataPack implementations are required for:
- Binary protocols (e.g. MessagePack)
- Alternative serialization formats (e.g. Protobuf)
- Efficient binary data transmission
While the DataPack interface supports these use cases, users currently cannot pass a custom implementation.
Proposed Solution
Expose dataPack in both Client constructors and forward it to CommonClient:
export class Client extends CommonClient {
constructor(
address = "ws://localhost:8080",
options = {},
generate_request_id?: (method: string, params: object | any[]) => number | string,
dataPack?: DataPack<any, any>
) {
super(WebSocket, address, options, generate_request_id, dataPack)
}
}
Problem
The API documentation claims that the
Clientconstructor supports adataPackparameter, but the exportedClientclasses (Browser and Node.js) do not expose or forward it.Although the internal
CommonClientalready accepts and usesdataPack, both public wrappers omit this parameter, making the documented feature unusable.Impact / Motivation
Custom
DataPackimplementations are required for:While the
DataPackinterface supports these use cases, users currently cannot pass a custom implementation.Proposed Solution
Expose
dataPackin bothClientconstructors and forward it toCommonClient: