Skip to content

Latest commit

 

History

History
686 lines (347 loc) · 30.6 KB

CHANGELOG.md

File metadata and controls

686 lines (347 loc) · 30.6 KB

History

Version Release date Bundle size (UMD min+gzip)
6.6.0 June 2024 8.6 KB
6.5.4 (from the 6.5.x branch) June 2024 8.8 KB
3.5.4 (from the 3.5.x branch) June 2024 -
6.5.3 November 2023 8.8 KB
6.5.2 August 2023 8.8 KB
6.5.1 June 2023 8.4 KB
6.5.0 June 2023 7.8 KB
6.4.0 February 2023 7.8 KB
6.3.1 February 2023 7.8 KB
6.3.0 January 2023 8.0 KB
6.2.3 October 2022 7.8 KB
3.5.3 September 2022 -
6.2.2 May 2022 7.8 KB
6.2.1 April 2022 7.8 KB
6.2.0 April 2022 7.8 KB
6.0.3 (from the 6.0.x branch) November 2021 7.4 KB
6.1.1 November 2021 7.4 KB
6.1.0 November 2021 7.4 KB
6.0.2 October 2021 7.4 KB
6.0.1 October 2021 7.4 KB
6.0.0 October 2021 7.5 KB
5.2.0 August 2021 9.4 KB
5.1.2 June 2021 9.3 KB
5.1.1 May 2021 9.2 KB
4.1.4 (from the 4.1.x branch) May 2021 9.1 KB
3.5.2 (from the 3.5.x branch) May 2021 -
5.1.0 May 2021 9.2 KB
5.0.1 March 2021 9.2 KB
5.0.0 March 2021 9.3 KB
3.5.1 (from the 3.5.x branch) March 2021 -
4.1.2 February 2021 9.2 KB
4.1.1 February 2021 9.1 KB
4.1.0 January 2021 9.1 KB

Release notes

6.6.0 (2024-06-21)

Features

Custom transport implementations

The transports option now accepts an array of transport implementations:

import { Socket, XHR, WebSocket } from "engine.io-client";

const socket = new Socket({
  transports: [XHR, WebSocket]
});

Here is the list of provided implementations:

Transport Description
Fetch HTTP long-polling based on the built-in fetch() method.
NodeXHR HTTP long-polling based on the XMLHttpRequest object provided by the xmlhttprequest-ssl package.
XHR HTTP long-polling based on the built-in XMLHttpRequest object.
NodeWebSocket WebSocket transport based on the WebSocket object provided by the ws package.
WebSocket WebSocket transport based on the built-in WebSocket object.
WebTransport WebTransport transport based on the built-in WebTransport object.

Usage:

Transport browser Node.js Deno Bun
Fetch ✅ (1)
NodeXHR
XHR
NodeWebSocket
WebSocket ✅ (2)
WebTransport

(1) since v18.0.0 (2) since v21.0.0

Added in f4d898e and b11763b.

Transport tree-shaking

The feature above also comes with the ability to exclude the code related to unused transports (a.k.a. "tree-shaking"):

import { SocketWithoutUpgrade, WebSocket } from "engine.io-client";

const socket = new SocketWithoutUpgrade({
  transports: [WebSocket]
});

In that case, the code related to HTTP long-polling and WebTransport will be excluded from the final bundle.

Added in f4d898e

Test each low-level transports

When setting the tryAllTransports option to true, if the first transport (usually, HTTP long-polling) fails, then the other transports will be tested too:

import { Socket } from "engine.io-client";

const socket = new Socket({
  tryAllTransports: true
});

This feature is useful in two cases:

  • when HTTP long-polling is disabled on the server, or if CORS fails
  • when WebSocket is tested first (with transports: ["websocket", "polling"])

The only potential downside is that the connection attempt could take more time in case of failure, as there have been reports of WebSocket connection errors taking several seconds before being detected (that's one reason for using HTTP long-polling first). That's why the option defaults to false for now.

Added in 579b243.

Bug Fixes

  • add some randomness to the cache busting string generator (b624c50)
  • fix cookie management with WebSocket (Node.js only) (e105551)

Dependencies

6.5.4 (2024-06-18)

This release contains a bump of the ws dependency, which includes an important security fix.

Advisory: https://github.com/advisories/GHSA-3h5v-q93c-6h6q

Dependencies

3.5.4 (2024-06-18)

This release contains a bump of the ws dependency, which includes an important security fix.

Advisory: https://github.com/advisories/GHSA-3h5v-q93c-6h6q

Dependencies

6.5.3 (2023-11-09)

Bug Fixes

  • add a maximum length for the URL (707597d)
  • improve compatibility with node16 module resolution (#711) (46ef851)

Dependencies

6.5.2 (2023-08-01)

Bug Fixes

  • webtransport: add proper framing (d55c39e)
  • webtransport: honor the binaryType attribute (8270e00)

Dependencies

6.5.1 (2023-06-28)

Bug Fixes

  • make closeOnBeforeunload default to false (a63066b)
  • webtransport: properly handle abruptly closed connections (cf6aa1f)

Dependencies

6.5.0 (2023-06-16)

Features

Support for WebTransport

The Engine.IO client can now use WebTransport as the underlying transport.

WebTransport is a web API that uses the HTTP/3 protocol as a bidirectional transport. It's intended for two-way communications between a web client and an HTTP/3 server.

References:

For Node.js clients: until WebTransport support lands in Node.js, you can use the @fails-components/webtransport package:

import { WebTransport } from "@fails-components/webtransport";

global.WebTransport = WebTransport;

Added in 7195c0f.

Cookie management for the Node.js client

When setting the withCredentials option to true, the Node.js client will now include the cookies in the HTTP requests, making it easier to use it with cookie-based sticky sessions.

import { Socket } from "engine.io-client";

const socket = new Socket("https://example.com", {
  withCredentials: true
});

Added in 5fc88a6.

Dependencies

6.4.0 (2023-02-06)

The minor bump is due to changes on the server side.

Dependencies

6.3.1 (2023-02-04)

Bug Fixes

  • typings: do not expose browser-specific types (37d7a0a)

Dependencies

6.3.0 (2023-01-10)

Bug Fixes

  • properly parse relative URL with a "@" character (12b7d78)
  • use explicit context for setTimeout function (#699) (047f420)

Features

The trailing slash which was added by default can now be disabled:

import { Socket } from "engine.io-client";

const socket = new Socket("https://example.com", {
  addTrailingSlash: false
});

In the example above, the request URL will be https://example.com/engine.io instead of https://example.com/engine.io/.

Dependencies

6.2.3 (2022-10-13)

Bug Fixes

  • properly clear "beforeunload" event listener (99925a4)

Dependencies

3.5.3 (2022-09-07)

Bug Fixes

Dependencies

6.2.2 (2022-05-02)

Bug Fixes

  • simplify the check for WebSocket availability (f158c8e)

This check was added for the flashsocket transport, which has been deprecated for a while now ([1]). But it fails with latest webpack versions, as the expression "__initialize" in WebSocket gets evaluated to true.

  • use named export for globalThis shim (#688) (32878ea)

Default export of globalThis seems to have a problem in the "browser" field when the library is loaded asynchronously with webpack.

6.2.1 (2022-04-17)

6.2.0 (2022-04-17)

Features

  • add details to the "close" event (b9252e2)

The close 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("close", (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); // ""
});

Note: the error object was already included before this commit and is kept for backward compatibility.

  • 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.

6.0.3 (2021-11-14)

Some bug fixes were backported from master, to be included by the latest socket.io-client version.

Bug Fixes

  • add package name in nested package.json (32511ee)
  • fix vite build for CommonJS users (9fcaf58)

6.1.1 (2021-11-14)

Bug Fixes

  • add package name in nested package.json (6e798fb)
  • fix vite build for CommonJS users (c557707)

6.1.0 (2021-11-08)

The minor bump is due to changes on the server side.

Bug Fixes

  • typings: allow any value in the query option (018e1af)
  • typings: allow port to be a number (#680) (8f68f77)

6.0.2 (2021-10-15)

Bug Fixes

6.0.1 (2021-10-14)

Bug Fixes

6.0.0 (2021-10-08)

This major release contains three important changes:

  • the codebase was migrated to TypeScript (7245b80)
  • rollup is now used instead of webpack to create the bundles (27de300)
  • code that provided support for ancient browsers (think IE8) was removed (c656192 and b2c7381)

There is now three distinct builds (in the build/ directory):

  • CommonJS
  • ESM with debug
  • ESM without debug (rationale here: 00d7e7d)

And three bundles (in the dist/ directory) :

  • engine.io.js: unminified UMD bundle
  • engine.io.min.js: minified UMD bundle
  • engine.io.esm.min.js: ESM bundle

Please note that the communication protocol was not updated, so a v5 client will be able to reach a v6 server (and vice-versa).

Reference: https://github.com/socketio/engine.io-protocol

Features

  • provide an ESM build without debug (00d7e7d)

BREAKING CHANGES

  • the enableXDR option is removed (c656192)
  • the jsonp and forceJSONP options are removed (b2c7381)

ws version: ~8.2.3

5.2.0 (2021-08-29)

Features

  • add an option to use native timer functions (#672) (5d1d5be)

5.1.2 (2021-06-24)

Bug Fixes

  • emit ping when receiving a ping from the server (589d3ad)
  • websocket: fix timer blocking writes (#670) (f30a10b)

5.1.1 (2021-05-11)

Bug Fixes

  • fix JSONP transport on IE9 (bddd992)

4.1.4 (2021-05-05)

This release only contains a bump of xmlhttprequest-ssl, in order to fix the following vulnerability: https://www.npmjs.com/advisories/1665.

Please note that engine.io-client was not directly impacted by this vulnerability, since we are always using async: true.

3.5.2 (2021-05-05)

This release only contains a bump of xmlhttprequest-ssl, in order to fix the following vulnerability: https://www.npmjs.com/advisories/1665.

Please note that engine.io-client was not directly impacted by this vulnerability, since we are always using async: true.

5.1.0 (2021-05-04)

Features

  • add the "closeOnBeforeunload" option (dcb85e9)

5.0.1 (2021-03-31)

Bug Fixes

  • ignore packets when the transport is silently closed (d291a4c)

5.0.0 (2021-03-10)

The major bump is due to a breaking change on the server side.

Features

  • add autoUnref option (6551683)
  • listen to the "offline" event (c361bc6)

3.5.1 (2021-03-02)

Bug Fixes

  • replace default nulls in SSL options with undefineds (d0c551c)

4.1.2 (2021-02-25)

Bug Fixes

  • silently close the transport in the beforeunload hook (ed48b5d)

4.1.1 (2021-02-02)

Bug Fixes

  • remove polyfill for process in the bundle (c95fdea)

4.1.0 (2021-01-14)

Features

4.0.6 (2021-01-04)

3.5.0 (2020-12-30)

Bug Fixes

  • check the type of the initial packet (8750356)

4.0.5 (2020-12-07)

4.0.4 (2020-11-17)

Bug Fixes

  • check the type of the initial packet (1c8cba8)
  • restore the cherry-picking of the WebSocket options (4873a23)

4.0.3 (2020-11-17)

Bug Fixes

  • react-native: add a default value for the withCredentials option (ccb99e3)
  • react-native: exclude the localAddress option (177b95f)

4.0.2 (2020-11-09)

4.0.1 (2020-10-21)

3.4.4 (2020-09-30)

4.0.0 (2020-09-10)

More details about this release in the blog post: https://socket.io/blog/engine-io-4-release/

Bug Fixes

  • react-native: restrict the list of options for the WebSocket object (2f5c948)
  • use globalThis polyfill instead of self/global (#634) (3f3a6f9)

Features

  • strip debug from the browser bundle (f7ba966)

Links

3.4.1 (2020-04-17)

Bug Fixes

  • use globalThis polyfill instead of self/global (357f01d)

Links

4.0.0-alpha.1 (2020-02-12)

Bug Fixes

  • properly assign options when creating the transport (7c7f1a9)

Links

4.0.0-alpha.0 (2020-02-12)

chore

Features

  • reverse the ping-pong mechanism (81d7171)

BREAKING CHANGES

  • v3.x clients will not be able to connect anymore (they will send a ping packet and timeout while waiting for a pong packet).

  • the output bundle will now be found in the dist/ folder.

Links