Socket.io Client Versions Save

Realtime application framework (client)

4.5.3

1 year ago

Bug Fixes

  • do not swallow user exceptions (2403b88)

Size of the bundles:

min min+gzip
socket.io.min.js 42.6 KB (-) 13.6 KB (-)
socket.io.msgpack.min.js 47.7 KB (-) 14.6 KB (-)
socket.io.esm.min.js 34.5 KB (-) 11.5 KB (-)

4.5.2

1 year ago

Bug Fixes

  • handle ill-formatted packet from server (c597023)

Size of the bundles:

min min+gzip
socket.io.min.js 42.6 KB (-) 13.6 KB (-)
socket.io.msgpack.min.js 47.7 KB (-) 14.6 KB (-)
socket.io.esm.min.js 34.5 KB (-) 11.5 KB (-)

2.5.0

1 year ago

Bug Fixes

  • ensure buffered events are sent in order (991eb0b)

4.5.1

2 years ago

There were some minor bug fixes on the server side, which mandate a client bump.

Size of the bundles:

min min+gzip
socket.io.min.js 42.6 KB (-) 13.6 KB (-)
socket.io.msgpack.min.js 47.7 KB (-) 14.6 KB (-)
socket.io.esm.min.js 34.5 KB (-) 11.5 KB (-)

4.5.0

2 years ago

Features

  • add details to the disconnect event (b862924)

The "disconnect" event will now include additional details to help debugging if anything has gone wrong.

Example when a payload is over the maxHttpBufferSize value in HTTP long-polling mode:

socket.on("disconnect", (reason, details) => {
  console.log(reason); // "transport error"

  // in that case, details is an error object
  console.log(details.message); "xhr post error"
  console.log(details.description); // 413 (the HTTP status of the response)

  // details.context refers to the XMLHttpRequest object
  console.log(details.context.status); // 413
  console.log(details.context.responseText); // ""
});
  • add support for catch-all listeners for outgoing packets (74e3e60)

This is similar to onAny(), but for outgoing packets.

Syntax:

socket.onAnyOutgoing((event, ...args) => {
  console.log(event);
});
  • slice write buffer according to the maxPayload value (46fdc2f)

The server will now include a "maxPayload" field in the handshake details, allowing the clients to decide how many packets they have to send to stay under the maxHttpBufferSize value.

Size of the bundles:

min min+gzip
socket.io.min.js 42.6 KB (+ 2.2 KB :arrow_up:) 13.6 KB (+ 0.5 KB :arrow_up:)
socket.io.msgpack.min.js 47.7 KB (+ 2.1 KB :arrow_up:) 14.6 KB (+ 0.4 KB :arrow_up:)
socket.io.esm.min.js 34.5 KB (+ 1.4 KB :arrow_up:) 11.5 KB (+ 0.2 KB :arrow_up:)

4.4.1

2 years ago

This release only contains minor changes. Please see the diff for more details.

Size of the bundles:

min min+gzip
socket.io.min.js 40.4 KB (-) 13.1 KB (-)
socket.io.msgpack.min.js 45.6 KB (-) 14.2 KB (-)
socket.io.esm.min.js 33.1 KB (-) 11.3 KB (-)

4.4.0

2 years ago

Bug Fixes

Features

socket.timeout(5000).emit("my-event", (err) => {
  if (err) {
    // the server did not acknowledge the event in the given delay
  }
});

Size of the bundles:

min min+gzip
socket.io.min.js 40.4 KB (+ 0.4 KB :arrow_up:) 13.1 KB (+ 0.1 KB :arrow_up:)
socket.io.msgpack.min.js 45.6 KB (+ 0.4 KB :arrow_up:) 14.2 KB (-)
socket.io.esm.min.js 33.1 KB (+ 0.3 KB :arrow_up:) 11.3 KB (+ 0.2 KB :arrow_up:)

4.3.2

2 years ago

Bug Fixes

  • restore the default export (bis) (6780f29)

Size of the bundles:

min min+gzip
socket.io.min.js 40.0 KB (-) 13.0 KB (-)
socket.io.msgpack.min.js 45.2 KB (-) 14.2 KB (-)
socket.io.esm.min.js 32.8 KB (-) 11.1 KB (-)

4.3.1

2 years ago

Bug Fixes

  • restore the default export (f0aae84)
  • restore the namespace export (8737d0a)

Size of the bundles:

min min+gzip
socket.io.min.js 40.0 KB (+ 0.1 KB :arrow_up:) 13.0 KB (+ 0.1 KB :arrow_up:)
socket.io.msgpack.min.js 45.2 KB (+ 0.1 KB :arrow_up:) 14.2 KB (+ 0.1 KB :arrow_up:)
socket.io.esm.min.js 32.8 KB (+ 0.1 KB :arrow_up:) 11.1 KB (-)

4.3.0

2 years ago

An ESM bundle is now provided:

<script type="module">
  import { io } from "https://cdn.socket.io/4.3.0/socket.io.esm.min.js";

  const socket = io();

  socket.emit("hello", "world");
</script>

The bundle size has also been greatly reduced, from 16.0 KB to 12.9 KB (min+gzip).

Features

  • typings: add missing types for some emitter methods (#1502) (a9e5b85)
  • provide an ESM build with and without debug (16b6569)
  • migrate to rollup (0661564)

Size of the bundles:

min  min+gzip
socket.io.min.js 39.9 KB (-24.6 KB :arrow_down:) 12.9 KB (-3.1 KB :arrow_down:)
socket.io.msgpack.min.js 45.1 KB (-25.6 KB :arrow_down:) 14 KB (-2.6 KB :arrow_down:)
socket.io.esm.min.js 32.7 KB 11.1 KB