Skip to content

Client constructor missing dataPack parameter despite documentation claiming support #183

@NeroBlackstone

Description

@NeroBlackstone

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)
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions