Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Mar 30, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
socket.io (source) 4.7.5 -> 4.8.1 age adoption passing confidence

Release Notes

socketio/socket.io (socket.io)

v4.8.1

Compare Source

Bug Fixes
  • bundle: do not mangle the "_placeholder" attribute (ca9e994)
Dependencies

v4.8.0

Compare Source

Features
Custom transport implementations

The transports option now accepts an array of transport implementations:

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

const socket = io({
  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.

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 { io } from "socket.io-client";

const socket = io({
  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
  • accept string | undefined as init argument (bis) (60c757f)
  • allow to manually stop the reconnection loop (13c6d2e)
  • close the engine upon decoding exception (04c8dd9)
  • do not send a packet on an expired connection (#​5134) (8adcfbf)
Dependencies

Configuration

📅 Schedule: Branch creation - "* * * * 0,6" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the renovate label Mar 30, 2025
@renovate renovate bot force-pushed the renovate/socket.io-packages branch from 72f3c51 to 3dba6f7 Compare March 30, 2025 06:43
@socket-security
Copy link

socket-security bot commented Mar 30, 2025

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher

🚮 Removed packages: npm/socket.io@4.7.5

View full report↗︎

@renovate renovate bot force-pushed the renovate/socket.io-packages branch from 3dba6f7 to 645c0f3 Compare March 30, 2025 09:51
@renovate renovate bot merged commit 41de9d5 into main Mar 30, 2025
2 checks passed
@renovate renovate bot deleted the renovate/socket.io-packages branch March 30, 2025 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant