Commit Graph

33 Commits

Author SHA1 Message Date
Damien Arrachequesne
e9e5bed4f2 chore(release): socket.io-client@4.8.3
Diff: https://github.com/socketio/socket.io/compare/socket.io-client@4.8.2...socket.io-client@4.8.3
2025-12-23 17:36:53 +01:00
Damien Arrachequesne
fd9d4cab5e chore(release): socket.io-client@4.8.2
Diff: https://github.com/socketio/socket.io/compare/socket.io-client@4.8.1...socket.io-client@4.8.2
2025-12-22 16:52:21 +01:00
Damien Arrachequesne
30ec4a136a test(sio-client): reactivate all tests 2025-12-22 13:46:15 +01:00
Damien Arrachequesne
118ef41b94 test: use tsx instead of ts-node 2025-12-22 10:39:57 +01:00
Suraj Rana
d19928e8d8 fix(sio-client): drain queue before emitting "connect" (#5259)
When the `retries` option was enabled, an event emitted in the "connect" handler would be sent twice.

Related: https://github.com/socketio/socket.io/issues/5258
2025-12-22 10:39:39 +01:00
Damien Arrachequesne
cdae01983a fix(sio-client): do not mangle the "_placeholder" attribute (bis)
The "_placeholder" attribute is used when sending binary data, and was
incorrectly mangled (converted to a random short property, like "it",
to reduce the bundle size).

Related:

- ca9e994815
- https://github.com/socketio/socket.io/issues/5215

[skip ci]
2025-12-19 15:48:28 +01:00
Damien Arrachequesne
39bb72039d docs: add release steps
[skip ci]
2025-12-19 15:43:14 +01:00
Valentin Rault
98741e15e9 refactor(sio-client): export DisconnectDescription type (#5392)
Related: https://github.com/socketio/socket.io/issues/4556
2025-12-19 14:51:39 +01:00
Damien Arrachequesne
e97549259e ci(browser): use Windows 8 for IE tests 2025-09-30 11:44:50 +02:00
Avi Vahl
6f9b198bc8 chore(deps): ws@8.18.3, debug@4.4.1 (#5335)
Release notes:

- https://github.com/websockets/ws/releases/tag/8.18.3
- https://github.com/debug-js/debug/releases/tag/4.4.1
2025-09-11 07:51:07 +02:00
Damien Arrachequesne
8d5528aa2a chore(release): socket.io-client@4.8.1
Diff: https://github.com/socketio/socket.io/compare/socket.io-client@4.8.0...socket.io-client@4.8.1
2024-10-25 08:00:26 +02:00
Damien Arrachequesne
71387e5294 refactor(sio-client): reexport transports from the engine 2024-10-25 07:54:35 +02:00
Damien Arrachequesne
ca9e994815 fix(sio-client): do not mangle the "_placeholder" attribute
The "_placeholder" attribute is used when sending binary data, and was
incorrectly mangled (converted to a random short property, like "it",
to reduce the bundle size).

This bug was introduced in [1], included in `socket.io-client@4.8.0`.

[1]: 7085f0e3e4

Related: https://github.com/socketio/socket.io/issues/5215
2024-10-22 11:41:08 +02:00
Damien Arrachequesne
4a0555c671 chore(release): socket.io-client@4.8.0
Diff: https://github.com/socketio/socket.io/compare/socket.io-client@4.7.5...socket.io-client@4.8.0
2024-09-21 09:45:51 +02:00
Damien Arrachequesne
7085f0e3e4 refactor(sio-client): mangle private attributes
|          | before  | after   |
|----------|---------|---------|
| min+gzip | 14.6 KB | 14.3 KB |
| min+br   | 13.1 KB | 12.9 KB |

Reference: https://terser.org/docs/options/#mangle-properties-options
2024-09-21 07:48:50 +02:00
Damien Arrachequesne
4f66708210 chore(sio-client): use babel loose mode when transpiling classes
By default, Babel uses `Object.defineProperty()` when transpiling
classes. We'll now use the loose mode which creates a more terse
output.

|          | before  | after   |
|----------|---------|---------|
| min+gzip | 14.9 KB | 14.6 KB |
| min+br   | 13.4 KB | 13.1 KB |

Reference: https://babeljs.io/docs/babel-plugin-transform-classes
2024-09-21 07:44:15 +02:00
Damien Arrachequesne
1a95db2145 chore(sio-client): add a script to compute the bundle size 2024-09-21 07:34:49 +02:00
Damien Arrachequesne
282ae922a4 chore(sio-client): restore the debug package in the dev bundle
The debug package was not included anymore in the dev bundle since the
migration from webpack to rollup ([1]) in version 4.3.0.

[1]: 0661564dc2

Related: https://github.com/socketio/socket.io/issues/5108
2024-09-21 07:33:53 +02:00
Damien Arrachequesne
13c6d2e89d fix(sio-client): allow to manually stop the reconnection loop
```js
socket.io.on("reconnect_attempt", () => {
  socket.io.reconnection(false); // will now work properly
});
```

Related: https://github.com/socketio/socket.io/issues/5126
2024-09-18 11:19:28 +02:00
Tom Jenkinson
8adcfbfde5 fix(sio-client): do not send a packet on an expired connection (#5134)
When a laptop is suspended or a phone is locked, the timer that is used
to check the liveness of the connection is paused and is not able to
detect that the heartbeat has failed.

Previously, emitting a message after resuming the page would lose the
message. The status of the timer will now be checked before sending the
message, so that it gets buffered and sent upon reconnection.

Note: we could also have used the Page Visibility API or a custom
setTimeout() method based on setInterval(), but this would not be as
reliable as the current solution.

Reference: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API

Related: https://github.com/socketio/socket.io/issues/5135
2024-09-18 11:11:22 +02:00
Damien Arrachequesne
60c757f718 fix(sio-client): accept string | undefined as init argument (bis)
Following: 5a3eafed1c

Related: https://github.com/socketio/socket.io/issues/4873
2024-09-18 08:09:47 +02:00
Damien Arrachequesne
04c8dd979c fix(sio-client): close the engine upon decoding exception
Related: https://github.com/socketio/socket.io/issues/5128
2024-09-18 07:52:37 +02:00
Damien Arrachequesne
09f573cad8 test(sio-client): reduce test suite duration 2024-09-18 07:52:12 +02:00
Wang Guan
a1ccba3a77 chore: use prettier v3 everywhere (#5169) 2024-09-16 08:43:08 +02:00
Wang Guan
5d9a2d5544 chore(socket.io-client): bump engine.io-client to version 6.6.0 2024-08-23 23:19:45 +02:00
Damien Arrachequesne
b7da542890 chore: normalize repository URLs
In order to address the following warning when publishing:

> npm warn publish npm auto-corrected some errors in your package.json when publishing.  Please run "npm pkg fix" to address these errors.
> npm warn publish errors corrected:
> npm warn publish "repository.url" was normalized to "git+https://github.com/socketio/socket.io.git"
2024-07-11 14:59:00 +02:00
Damien Arrachequesne
2a29c4c30e chore: move dev dependencies in the parent package.json file
Notes:

- TypeScript is updated from v4 to v5
- WebDriverIO is updated from v7 to v8
- prettier is kept in v2, in order to reduce style changes
2024-07-10 10:42:22 +02:00
Damien Arrachequesne
d3761e3e9e docs(security): add the list of CVE for the socket.io-client package 2024-07-09 12:32:14 +02:00
Damien Arrachequesne
5fae41a0d5 chore: align all MIT licenses text
Note: the owner of the `socket.io` repository was updated to Automattic
in [1], though it was never applied to the other repositories nor
mentioned in the client bundles.

[1]: 340281152f
2024-07-09 10:44:20 +02:00
Damien Arrachequesne
34137d39a9 chore: add new npm workspaces
The following repositories were merged:

- https://github.com/socketio/engine.io-parser
- https://github.com/socketio/engine.io-client
- https://github.com/socketio/engine.io-parser
- https://github.com/socketio/socket.io-adapter
- https://github.com/socketio/emitter
2024-07-08 12:10:24 +02:00
Damien Arrachequesne
4cac3724ad chore: update the repository URLs
Reference: https://docs.npmjs.com/cli/v10/configuring-npm/package-json
2024-07-04 18:16:51 +02:00
Damien Arrachequesne
d9b4c3cb03 ci: create npm workspaces and sort out dependencies
This requires at least npm v7.

Reference: https://docs.npmjs.com/cli/v10/using-npm/workspaces

Note: @types/node is pinned at `18.15.3` because it's the last version
which supports TypeScript v4.2.
2024-07-04 17:48:46 +02:00
Damien Arrachequesne
273093ceae refactor: prepare the migration to a monorepo 2024-07-04 17:35:42 +02:00