Skip to content

Commit abdba07

Browse files
chore(release): 4.5.0
Diff: 4.4.1...4.5.0
1 parent faf68a5 commit abdba07

11 files changed

+963
-730
lines changed

CHANGELOG.md

+43
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,46 @@
1+
# [4.5.0](https://github.com/socketio/socket.io-client/compare/4.4.1...4.5.0) (2022-04-23)
2+
3+
4+
### Features
5+
6+
* add details to the disconnect event ([b862924](https://github.com/socketio/socket.io-client/commit/b862924b7f1720979e5db2f0154906b305d420e3))
7+
8+
The "disconnect" event will now include additional details to help debugging if anything has gone wrong.
9+
10+
Example when a payload is over the maxHttpBufferSize value in HTTP long-polling mode:
11+
12+
```js
13+
socket.on("disconnect", (reason, details) => {
14+
console.log(reason); // "transport error"
15+
16+
// in that case, details is an error object
17+
console.log(details.message); "xhr post error"
18+
console.log(details.description); // 413 (the HTTP status of the response)
19+
20+
// details.context refers to the XMLHttpRequest object
21+
console.log(details.context.status); // 413
22+
console.log(details.context.responseText); // ""
23+
});
24+
```
25+
26+
* add support for catch-all listeners for outgoing packets ([74e3e60](https://github.com/socketio/socket.io-client/commit/74e3e601a43133b2c0ea43c3de2764cc55b57b5a))
27+
28+
This is similar to `onAny()`, but for outgoing packets.
29+
30+
Syntax:
31+
32+
```js
33+
socket.onAnyOutgoing((event, ...args) => {
34+
console.log(event);
35+
});
36+
```
37+
38+
* slice write buffer according to the maxPayload value ([46fdc2f](https://github.com/socketio/engine.io-client/commit/46fdc2f0ed352b454614247406689edc9d908927))
39+
40+
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.
41+
42+
43+
144
## [4.4.1](https://github.com/socketio/socket.io-client/compare/4.4.0...4.4.1) (2022-01-06)
245

346

dist/socket.io.esm.min.js

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

dist/socket.io.esm.min.js.map

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

0 commit comments

Comments
 (0)