Skip to content

Releases: centrifugal/centrifuge-js

5.0.0

12 Sep 09:01
cabda81
Compare
Choose a tag to compare

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

4.1.0

13 Aug 15:28
1b35e16
Compare
Choose a tag to compare

What's Changed

Full Changelog: 4.0.1...4.1.0

4.0.1

11 Jul 18:48
bba532c
Compare
Choose a tag to compare

What's Changed

  • Up dependencies by @FZambia in #239, in particular - update protobuf-js to the latest version (7.2.4).

Full Changelog: 4.0.0...4.0.1

v4.0.0

29 Jun 05:52
1434e28
Compare
Choose a tag to compare

What's changed

This release changes the semantics of working with connection tokens described in Centrifugo v5 release post.

Previously, returning an empty token string from getToken callback resulted in client disconnection with unauthorized reason.

Now returning an empty string from getToken is a valid scenario which won't result into disconnect on the client side. It's still possible to disconnect client by throwing a special UnauthorizedError() error from getToken function.

And we are putting back setToken method to the SDK – so it's now possible to reset the token to be empty upon user logout.

Other changes

  • Add missing curly braces to node js README.md example by @MaximZemskov in #230
  • Schedule reconnect from disconnect function instead of transport onClose by @FZambia in #234

New Contributors

Full Changelog: 3.1.2...4.0.0

3.1.2

13 May 15:12
220e603
Compare
Choose a tag to compare

What's Changed

This release contains important connection stability improvements. If you experience disconnections due to bad request or stale reasons – this release may fix if not all but most of them.

  • Fix connection leak due to transport close race, #225.
  • Use network events in connecting state, #227. This allows immediately close transport upon offline event while SDK is in connecting state. Previously we only started handling these events after successful connect. Also fixes setting duplicate onlne/offline event handlers.
  • Update README: actual way to override WebSocket to pass headers in non-browser environment, #226

Full Changelog: 3.1.1...3.1.2

3.1.1

01 Apr 11:08
0b25e68
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 3.1.0...3.1.1

3.1.0

14 Dec 11:28
57964db
Compare
Choose a tag to compare

What's Changed

  • Fixed 'Subscription methods and events' link by @ArmanJR in #197
  • Bump undici from 5.8.1 to 5.8.2 by @dependabot in #198
  • React on network online/offline events by @FZambia in #204
  • Fix non-working HTTP-streaming in browser build due to esbuild minification issue

New Contributors

Full Changelog: 3.0.1...3.1.0

3.0.1

21 Jul 11:35
038fb82
Compare
Choose a tag to compare

3.0.0

20 Jul 08:03
13a4b9a
Compare
Choose a tag to compare

Breaking changes

This release adopts a new iteration of Centrifugal protocol and a new iteration of API. Client now behaves according to the client SDK API specification. The work has been done according to Centrifugo v4 roadmap.

Check out Centrifugo v4 release post that covers the reasoning behind changes here.

New release only works with Centrifugo >= v4.0.0 and Centrifuge >= 0.25.0. See Centrifugo v4 migration guide for details about the changes in the ecosystem.

Note, that Centrifugo v4 supports clients working over the previous protocol iteration, so you can update Centrifugo to v4 without any changes on the client side (but you need to turn on use_client_protocol_v1_by_default option in the configuration of Centrifugo, see Centrifugo v4 migration guide for details).

Release notes:

  • new API according to the new SDK API specification
  • client migrated to Typescript, all public API is strictly typed, including EventEmitter callbacks
  • SockJS is now DEPRECATED in Centrifugal ecosystem and requires explicit configuration, see the library readme
  • introducing our own WebSocket emulation layer - based on HTTP-streaming and SSE (Eventsource) fallbacks
  • experimental WebTransport support (only works with Centrifugo v4 experimental HTTP/3 support)
  • optimistic subscriptions to reduce connect latency
  • redesigned PING-PONG (pings are only sent from server to client now)
  • resilient subscriptions which handle temporary server errors and re-subscribe (with full jitter backoff)

3.0.0-beta.0

08 Jul 12:01
5ee5aea
Compare
Choose a tag to compare
3.0.0-beta.0 Pre-release
Pre-release

This is a pre-release of centrifuge-js v3, which is compatible with Centrifugo v4. See Centrifugo v4 roadmap. The source code is still in v3_dev branch - see the open PR