跳到主要内容

Socket.IO 4.0.0

· 1 分钟阅读
Damien Arrachequesne

Hello everyone!

We just published a new major version of Socket.IO: 4.0.0

Please see the associated migration guide.

TL;DR: this major bump is due to a few breaking changes at the API level.

Apart from this, the Socket.IO protocol was not updated, so a v3 client will be able to reach a v4 server and vice-versa. Besides, the compatibility mode (allowEIO3: true) is still available between a Socket.IO v2 client and a Socket.IO v4 server.

Bug Fixes (server)

  • make io.to(...) immutable (ac9e8ca)
  • set default protocol version to 3 (#616) (868d891) (Engine.IO)

Bug Fixes (client)

  • bundle: restore support for JS modules (43613d1)

Features (server)

  • add some utility methods (b25495c)
  • add support for typed events (#3822) (0107510)
  • allow to exclude specific rooms when broadcasting (#3789) (7de2e87)
  • allow to pass an array to io.to(...) (085d1de)
  • increase the default value of pingTimeout (5a7fa13) (Engine.IO)
  • remove dynamic require() with wsEngine (edb7343) (Engine.IO)

Features (client)

  • add autoUnref option (6abfa1f)
  • add support for typed events (5902365)
  • listen to the "offline" event (c361bc6) (Engine.IO client)