Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1af3267

Browse files
chore(release): 3.0.0
Diff: 2.3.0...3.0.0
1 parent 02951c4 commit 1af3267

File tree

5 files changed

+119
-7
lines changed

5 files changed

+119
-7
lines changed

CHANGELOG.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,115 @@
1+
# [3.0.0](https://github.com/socketio/socket.io/compare/2.3.0...3.0.0) (2020-11-05)
2+
3+
### Bug Fixes
4+
5+
* close clients with no namespace ([91cd255](https://github.com/socketio/socket.io/commit/91cd255ba76ff6a780c62740f9f5cd3a76f5d7c7))
6+
7+
### Features
8+
9+
* emit an Error object upon middleware error ([54bf4a4](https://github.com/socketio/socket.io/commit/54bf4a44e9e896dfb64764ee7bd4e8823eb7dc7b))
10+
* serve msgpack bundle ([aa7574f](https://github.com/socketio/socket.io/commit/aa7574f88471aa30ae472a5cddf1000a8baa70fd))
11+
* add support for catch-all listeners ([5c73733](https://github.com/socketio/socket.io/commit/5c737339858d59eab4b5ee2dd6feff0e82c4fe5a))
12+
* make Socket#join() and Socket#leave() synchronous ([129c641](https://github.com/socketio/socket.io/commit/129c6417bd818bc8b4e1b831644323876e627c13))
13+
* remove prod dependency to socket.io-client ([7603da7](https://github.com/socketio/socket.io/commit/7603da71a535481e3fc60e38b013abf78516d322))
14+
* move binary detection back to the parser ([669592d](https://github.com/socketio/socket.io/commit/669592d120409a5cf00f128070dee6d22259ba4f))
15+
* add ES6 module export ([8b6b100](https://github.com/socketio/socket.io/commit/8b6b100c284ccce7d85e55659e3397f533916847))
16+
* do not reuse the Engine.IO id ([2875d2c](https://github.com/socketio/socket.io/commit/2875d2cfdfa463e64cb520099749f543bbc4eb15))
17+
* remove Server#set() method ([029f478](https://github.com/socketio/socket.io/commit/029f478992f59b1eb5226453db46363a570eea46))
18+
* remove Socket#rooms object ([1507b41](https://github.com/socketio/socket.io/commit/1507b416d584381554d1ed23c9aaf3b650540071))
19+
* remove the 'origins' option ([a8c0600](https://github.com/socketio/socket.io/commit/a8c06006098b512ba1b8b8df82777349db486f41))
20+
* remove the implicit connection to the default namespace ([3289f7e](https://github.com/socketio/socket.io/commit/3289f7ec376e9ec88c2f90e2735c8ca8d01c0e97))
21+
* throw upon reserved event names ([4bd5b23](https://github.com/socketio/socket.io/commit/4bd5b2339a66a5a675e20f689fff2e70ff12d236))
22+
23+
### BREAKING CHANGES
24+
25+
* the Socket#use() method is removed (see [5c73733](https://github.com/socketio/socket.io/commit/5c737339858d59eab4b5ee2dd6feff0e82c4fe5a))
26+
27+
* Socket#join() and Socket#leave() do not accept a callback argument anymore.
28+
29+
Before:
30+
31+
```js
32+
socket.join("room1", () => {
33+
io.to("room1").emit("hello");
34+
});
35+
```
36+
37+
After:
38+
39+
```js
40+
socket.join("room1");
41+
io.to("room1").emit("hello");
42+
// or await socket.join("room1"); for custom adapters
43+
```
44+
45+
* the "connected" map is renamed to "sockets"
46+
* the Socket#binary() method is removed, as this use case is now covered by the ability to provide your own parser.
47+
* the 'origins' option is removed
48+
49+
Before:
50+
51+
```js
52+
new Server(3000, {
53+
origins: ["https://example.com"]
54+
});
55+
```
56+
57+
The 'origins' option was used in the allowRequest method, in order to
58+
determine whether the request should pass or not. And the Engine.IO
59+
server would implicitly add the necessary Access-Control-Allow-xxx
60+
headers.
61+
62+
After:
63+
64+
```js
65+
new Server(3000, {
66+
cors: {
67+
origin: "https://example.com",
68+
methods: ["GET", "POST"],
69+
allowedHeaders: ["content-type"]
70+
}
71+
});
72+
```
73+
74+
The already existing 'allowRequest' option can be used for validation:
75+
76+
```js
77+
new Server(3000, {
78+
allowRequest: (req, callback) => {
79+
callback(null, req.headers.referer.startsWith("https://example.com"));
80+
}
81+
});
82+
```
83+
84+
* Socket#rooms is now a Set instead of an object
85+
86+
* Namespace#connected is now a Map instead of an object
87+
88+
* there is no more implicit connection to the default namespace:
89+
90+
```js
91+
// client-side
92+
const socket = io("/admin");
93+
94+
// server-side
95+
io.on("connect", socket => {
96+
// not triggered anymore
97+
})
98+
99+
io.use((socket, next) => {
100+
// not triggered anymore
101+
});
102+
103+
io.of("/admin").use((socket, next) => {
104+
// triggered
105+
});
106+
```
107+
108+
* the Server#set() method was removed
109+
110+
This method was kept for backward-compatibility with pre-1.0 versions.
111+
112+
1113
# [3.0.0-rc4](https://github.com/socketio/socket.io/compare/3.0.0-rc3...3.0.0-rc4) (2020-10-30)
2114

3115

client-dist/socket.io.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-dist/socket.io.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-dist/socket.io.msgpack.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "socket.io",
3-
"version": "3.0.0-rc4",
3+
"version": "3.0.0",
44
"description": "node.js realtime framework server",
55
"keywords": [
66
"realtime",
@@ -39,8 +39,8 @@
3939
"base64id": "~2.0.0",
4040
"debug": "~4.1.0",
4141
"engine.io": "~4.0.0",
42-
"socket.io-adapter": "2.0.3-rc2",
43-
"socket.io-parser": "4.0.1-rc3"
42+
"socket.io-adapter": "~2.0.3",
43+
"socket.io-parser": "~4.0.1"
4444
},
4545
"devDependencies": {
4646
"@types/cookie": "^0.4.0",
@@ -54,7 +54,7 @@
5454
"mocha": "^3.5.3",
5555
"nyc": "^11.2.1",
5656
"prettier": "^1.19.1",
57-
"socket.io-client": "3.0.0-rc4",
57+
"socket.io-client": "3.0.0",
5858
"superagent": "^3.8.2",
5959
"supertest": "^3.0.0",
6060
"ts-node": "^9.0.0",

0 commit comments

Comments
 (0)