Skip to content

Commit c371414

Browse files
chore(release): 4.0.0
Diff: 3.2.0...4.0.0
1 parent 592883e commit c371414

File tree

3 files changed

+48
-2
lines changed

3 files changed

+48
-2
lines changed

CHANGELOG.md

+46
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
1+
# [4.0.0](https://github.com/socketio/socket.io-emitter/compare/3.2.0...4.0.0) (2021-03-17)
2+
3+
4+
### Features
5+
6+
* allow excluding all sockets in a room ([#92](https://github.com/socketio/socket.io-emitter/issues/92)) ([ad920e4](https://github.com/socketio/socket.io-emitter/commit/ad920e4ebe3cf616d5401944e2ba8b12b383d7ed))
7+
* include features from Socket.IO v4 ([a70db12](https://github.com/socketio/socket.io-emitter/commit/a70db12877d901dd0f7085def0a91145b7c83163))
8+
* rename the package to @socket/redis-emitter ([592883e](https://github.com/socketio/socket.io-emitter/commit/592883e9d85063411ffde760e0cdef10245e2573))
9+
10+
11+
### BREAKING CHANGES
12+
13+
* 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
14+
15+
Before:
16+
17+
```js
18+
const io = require("socket.io-emitter")({ host: "127.0.0.1", port: 6379 });
19+
```
20+
21+
After:
22+
23+
```js
24+
const { Emitter } = require("socket.io-emitter");
25+
const { createClient } = require("redis");
26+
27+
const redisClient = createClient();
28+
const io = new Emitter(redisClient);
29+
```
30+
31+
* `io.to()` is now immutable
32+
33+
Previously, broadcasting to a given room (by calling io.to()) would mutate the io instance, which could lead to surprising behaviors, like:
34+
35+
```js
36+
io.to("room1");
37+
io.to("room2").emit(/* ... */); // also sent to room1
38+
39+
// or with async/await
40+
io.to("room3").emit("details", await fetchDetails()); // random behavior: maybe in room3, maybe to all clients
41+
```
42+
43+
Calling `io.to()` (or any other broadcast modifier) will now return an immutable instance.
44+
45+
46+
147
## [3.1.2](https://github.com/socketio/socket.io-emitter/compare/3.1.1...3.1.2) (2020-12-29)
248

349

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@socket.io/redis-emitter",
3-
"version": "3.2.0",
3+
"version": "4.0.0",
44
"description": "The Socket.IO Redis emitter, allowing to communicate with a group of Socket.IO servers from another Node.js process",
55
"license": "MIT",
66
"repository": {

0 commit comments

Comments
 (0)