Skip to content

Releases: socketio/socket.io-redis-emitter

5.1.0

12 Jan 05:48
bfefbde
Compare
Choose a tag to compare

Features

  • add option to allow usage of custom parser (#121) (48bdd87)
import { Emitter } from "@socket.io/redis-emitter";
import { createClient } from "redis";

const redisClient = createClient();

await redisClient.connect();

const io = new Emitter(redisClient, {
  parser: {
    encode(msg) {
      return JSON.stringify(msg);
    }
  }
});

Links

5.0.0

07 Sep 05:26
09ab567
Compare
Choose a tag to compare

Important note! There is a non backward-compatible change regarding Date objects, which means that the adapter may not be able to properly decode them.

Features

  • add support for the toJSON() method when encoding (#113) (3a6d94d)

Links

4.1.1

04 Jan 07:26
d62af2c
Compare
Choose a tag to compare

Bug Fixes

  • typings: fix namespace typed-events inheritance (#108) (53c73e1)

Links

4.1.0

11 May 23:09
875a50c
Compare
Choose a tag to compare

Features

  • implement the serverSideEmit functionality (5feabda)

Links

4.0.0

17 Mar 23:00
c371414
Compare
Choose a tag to compare

Features

  • allow excluding all sockets in a room (#92) (ad920e4)
  • include features from Socket.IO v4 (a70db12)
  • rename the package to @socket/redis-emitter (592883e)

BREAKING CHANGES

  • the name of the package was updated from socket.io-emitter to @socket.io/redis-emitter in order to better reflect the relationship with Redis

  • the "redis" package is not installed by default anymore, you'll now need to create your own redis client and pass it to the Emitter constructor

Before:

const io = require("socket.io-emitter")({ host: "127.0.0.1", port: 6379 });

After:

const { Emitter } = require("@socket.io/redis-emitter");
const { createClient } = require("redis");

const redisClient = createClient();
const io = new Emitter(redisClient);
  • io.to() is now immutable

Previously, broadcasting to a given room (by calling io.to()) would mutate the io instance, which could lead to surprising behaviors, like:

io.to("room1");
io.to("room2").emit(/* ... */); // also sent to room1

// or with async/await
io.to("room3").emit("details", await fetchDetails()); // random behavior: maybe in room3, maybe to all clients

Calling io.to() (or any other broadcast modifier) will now return an immutable instance.

Diff: 3.2.0...4.0.0

3.2.0

29 Dec 09:41
b38dfcf
Compare
Choose a tag to compare

Bug Fixes

  • handle missing namespace prefix (03efd37)

Diff: 3.1.1...3.2.0

3.1.2

29 Dec 10:03
001387a
Compare
Choose a tag to compare

Bug Fixes

  • binary: fix binary events being marked as regular events (#76) (52483f9)
  • handle missing namespace prefix (03efd37)

Diff: 3.1.1...3.1.2

3.1.1

12 Oct 06:05
Compare
Choose a tag to compare

Milestone: 3.1.1
Diff: 3.1.0...3.1.1

3.1.0

03 Aug 06:55
Compare
Choose a tag to compare

Features

  • add support for arraybuffer (#62)

Milestone: 3.1.0
Diff: 3.0.1...3.1.0

3.0.1

13 May 06:41
Compare
Choose a tag to compare

Milestone: 3.0.1
Diff: 3.0.0...3.0.1