-
Notifications
You must be signed in to change notification settings - Fork 3k
Comparing changes
Open a pull request
base repository: socketio/socket.io-client
base: 4.5.4
head repository: socketio/socket.io-client
compare: 4.6.0
- 16 commits
- 21 files changed
- 2 contributors
Commits on Dec 14, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 18c6e0a - Browse repository at this point
Copy the full SHA 18c6e0aView commit details
Commits on Jan 16, 2023
-
fix(typings): properly type emits with timeout (#1570)
When emitting with a timeout (added in version 4.4.0), the "err" argument was not properly typed and would require to split the client and server typings. It will now be automatically inferred as an Error object. Workaround for previous versions: ```ts type WithTimeoutAck<isEmitter extends boolean, args extends any[]> = isEmitter extends true ? [Error, ...args] : args; interface ClientToServerEvents<isEmitter extends boolean = false> { withAck: (data: { argName: boolean }, callback: (...args: WithTimeoutAck<isEmitter, [string]>) => void) => void; } interface ServerToClientEvents<isEmitter extends boolean = false> { } const io = new Server<ClientToServerEvents, ServerToClientEvents<true>>(3000); io.on("connection", (socket) => { socket.on("withAck", (val, cb) => { cb("123"); }); }); const socket: Socket<ServerToClientEvents, ClientToServerEvents<true>> = ioc("http://localhost:3000"); socket.timeout(100).emit("withAck", { argName: true }, (err, val) => { // ... }); ``` Related: #1555
Configuration menu - View commit details
-
Copy full SHA for 33e4172 - Browse repository at this point
Copy the full SHA 33e4172View commit details
Commits on Jan 17, 2023
-
fix(typings): properly type emits with timeout (2)
This follows [1], in order to keep the label of each argument. [1]: 33e4172 Related: - #1570 (comment) - microsoft/TypeScript#39941 - microsoft/TypeScript#48049
Configuration menu - View commit details
-
Copy full SHA for a1c528b - Browse repository at this point
Copy the full SHA a1c528bView commit details
Commits on Jan 25, 2023
-
feat: implement connection state recovery
Connection state recovery allows a client to reconnect after a temporary disconnection and restore its state: - id - rooms - data - missed packets See also: socketio/socket.io@54d5ee0
Configuration menu - View commit details
-
Copy full SHA for b4e20c5 - Browse repository at this point
Copy the full SHA b4e20c5View commit details
Commits on Jan 30, 2023
-
feat: add promise-based acknowledgements
This commit adds some syntactic sugar around acknowledgements: ```js // without timeout const response = await socket.emitWithAck("hello", "world"); // with a specific timeout try { const response = await socket.timeout(1000).emitWithAck("hello", "world"); } catch (err) { // the server did not acknowledge the event in the given delay } ``` Note: enviroments that do not support Promises ([1]) will need to add a polyfill in order to use this feature See also: socketio/socket.io@184f3cf [1]: https://caniuse.com/promises
Configuration menu - View commit details
-
Copy full SHA for 47b979d - Browse repository at this point
Copy the full SHA 47b979dView commit details -
Configuration menu - View commit details
-
Copy full SHA for f27cba5 - Browse repository at this point
Copy the full SHA f27cba5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9f32925 - Browse repository at this point
Copy the full SHA 9f32925View commit details
Commits on Feb 1, 2023
-
feat: implement retry mechanism
Syntax: ```js const socket = io({ retries: 3, ackTimeout: 10000 }); // "my-event" will be sent up to 4 times (1 + 3), until the server sends an acknowledgement socket.emit("my-event", (err) => {}); ``` Notes: - the order of the packets is guaranteed, as we send packets one by one - the same packet id is reused for consecutive retries, in order to allow deduplication on the server side
Configuration menu - View commit details
-
Copy full SHA for 655dce9 - Browse repository at this point
Copy the full SHA 655dce9View commit details
Commits on Feb 3, 2023
-
Configuration menu - View commit details
-
Copy full SHA for b7dd891 - Browse repository at this point
Copy the full SHA b7dd891View commit details -
Configuration menu - View commit details
-
Copy full SHA for b1eed5f - Browse repository at this point
Copy the full SHA b1eed5fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ba0d49 - Browse repository at this point
Copy the full SHA 5ba0d49View commit details
Commits on Feb 4, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 0110e46 - Browse repository at this point
Copy the full SHA 0110e46View commit details -
Configuration menu - View commit details
-
Copy full SHA for c54e09d - Browse repository at this point
Copy the full SHA c54e09dView commit details -
fix(typings): do not expose browser-specific types
Related: - #1561 - b862924 - socketio/engine.io-client@37d7a0a
Configuration menu - View commit details
-
Copy full SHA for 4d6d95e - Browse repository at this point
Copy the full SHA 4d6d95eView commit details
Commits on Feb 6, 2023
-
chore: bump engine.io-client to version 6.4.0
The minor bump is due to changes on the server side, but we'll keep the versions in sync. Diff: socketio/engine.io-client@6.3.1...6.4.0 Release notes: https://github.com/socketio/engine.io-client/releases/tag/6.4.0
Configuration menu - View commit details
-
Copy full SHA for dff34a3 - Browse repository at this point
Copy the full SHA dff34a3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5980918 - Browse repository at this point
Copy the full SHA 5980918View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 4.5.4...4.6.0