Releases: socketio/socket.io-redis-emitter
5.1.0
Features
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
- Diff: 5.0.0...5.1.0
5.0.0
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.
- Reference: https://github.com/darrachequesne/notepack/releases/tag/3.0.0
- Diff: darrachequesne/notepack@2.3.0...3.0.1
Features
Links
- Diff: 4.1.1...5.0.0
4.1.1
4.1.0
4.0.0
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
3.1.2
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
Milestone: 3.1.1
Diff: 3.1.0...3.1.1
3.1.0
3.0.1
Milestone: 3.0.1
Diff: 3.0.0...3.0.1