Skip to content

6.0.0

Compare
Choose a tag to compare
@darrachequesne darrachequesne released this 12 Nov 15:27
· 38 commits to master since this release
2cab2e3

⚠️ This release is only compatible with Socket.IO v3. For Socket.IO v2, please use previous versions.

See also: https://github.com/socketio/socket.io-redis#compatibility-table

Features

  • add support for Socket.IO v3 (d9bcb19)

BREAKING CHANGES:

  • all the requests (for inter-node communication) now return a Promise instead of accepting a callback

Before:

io.of('/').adapter.allRooms((err, rooms) => {
  console.log(rooms); // an array containing all rooms (across every node)
});

After:

const rooms = await io.of('/').adapter.allRooms();
console.log(rooms); // a Set containing all rooms (across every node)
  • RedisAdapter.clients() is renamed to RedisAdapter.sockets()

See socketio/socket.io-adapter@130f28a

  • RedisAdapter.clientRooms() is removed

It has been replaced by the fetchSockets() method in Socket.IO v4:

const sockets = await io.in(theSocketId).fetchSockets();
if (sockets.length) {
  console.log(sockets[0].rooms);
}
  • RedisAdapter.customHook() and RedisAdapter.customRequest() are removed

Those methods will be replaced by a more intuitive API in a future iteration.

  • support for Node.js 8 is dropped

See https://github.com/nodejs/Release

Links