Skip to content

Latest commit

 

History

History
189 lines (95 loc) · 6.26 KB

CHANGELOG.md

File metadata and controls

189 lines (95 loc) · 6.26 KB

History

Release notes

5.1.0 (2023-01-12)

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

5.0.0 (2022-09-07)

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)

4.1.1 (2022-01-04)

Bug Fixes

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

4.1.0 (2021-05-11)

Features

  • implement the serverSideEmit functionality (5feabda)

4.0.0 (2021-03-17)

Important note: 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.

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 "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.

3.1.2 (2020-12-29)

Bug Fixes

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

3.2.0 (2020-12-29)

Bug Fixes

  • handle missing namespace prefix (03efd37)

3.1.1 (2017-10-12)

3.1.0 (2017-08-03)

Features

  • add support for arraybuffer (2672758)

3.0.1 (2017-05-13)

3.0.0 (2017-05-13)

Features

  • make of return a new Emitter instance (a3cbc84)
  • make the module compatible with socket.io-redis 5.x (119b3e6) (by @v4l3r10)

2.0.0 (2017-01-12)

1.1.0 (2017-01-12)

1.0.0 (2015-12-10)

0.3.0 (2015-12-09)

0.2.0 (2014-06-07)