github centrifugal/centrifuge-js 5.0.0

latest releases: 5.2.2, 5.2.1, 5.2.0...
12 months ago

What's Changed

In v5 release we are moving to Rollup to build the library. For centrifuge-js this means both ESM and CommonJS support and thus solving some issues when users could not use SDK with their existing toolchains (ex. #232, #245). The migration includes changes in how we provide Protobuf version of Centrifuge client. That's why we've made a new major v5 release.

For users which work with JSON-based Centrifuge client (default behaviour) the migration to v5 should be smooth and require no code changes.

Users of Protobuf version of the client need to change how they import Centrifuge when using the library. Also, we removed protocol option of Centrifuge instance config object. Imported Protobuf client now automatically uses Protobuf protocol under the hood.

For example, previously, when using Protobuf version of Centrifuge client, you have to import Protobuf client and then provide an option to constructor:

import Centrifuge from 'centrifuge/build/protobuf';

const centrifuge = new Centrifuge('wss://centrifuge.example.com/connection/websocket', {
    protocol: 'protobuf'
});

Now this simplifies to:

import { Centrifuge } from 'centrifuge/build/protobuf';

const centrifuge = new Centrifuge('wss://centrifuge.example.com/connection/websocket', {});

Note - changed import and no need to pass protocol: 'protobuf'. See readme for more information about using Protobuf client and constructing binary payloads.

Full Changelog: 4.1.0...5.0.0

Don't miss a new centrifuge-js release

NewReleases is sending notifications on new releases.