Skip to content

Commit

Permalink
remove websocket experimental warning (#3311)
Browse files Browse the repository at this point in the history
* remove websocket experimental warning

* ??

* fixup
  • Loading branch information
KhafraDev authored Jun 6, 2024
1 parent c36c3e8 commit f9d18b3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
9 changes: 0 additions & 9 deletions lib/web/websocket/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ const { types } = require('node:util')
const { ErrorEvent, CloseEvent } = require('./events')
const { SendQueue } = require('./sender')

let experimentalWarned = false

// https://websockets.spec.whatwg.org/#interface-definition
class WebSocket extends EventTarget {
#events = {
Expand All @@ -56,13 +54,6 @@ class WebSocket extends EventTarget {
const prefix = 'WebSocket constructor'
webidl.argumentLengthCheck(arguments, 1, prefix)

if (!experimentalWarned) {
experimentalWarned = true
process.emitWarning('WebSockets are experimental, expect them to change at any time.', {
code: 'UNDICI-WS'
})
}

const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols, prefix, 'options')

url = webidl.converters.USVString(url, prefix, 'url')
Expand Down
5 changes: 1 addition & 4 deletions test/node-test/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const { tspl } = require('@matteo.collina/tspl')
const removeEscapeColorsRE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g

test('debug#websocket', { skip: !process.versions.icu }, async t => {
const assert = tspl(t, { plan: 8 })
const assert = tspl(t, { plan: 6 })
const child = spawn(
process.execPath,
[join(__dirname, '../fixtures/websocket.js')],
Expand All @@ -22,9 +22,6 @@ test('debug#websocket', { skip: !process.versions.icu }, async t => {
const chunks = []
const assertions = [
/(WEBSOCKET [0-9]+:) (connecting to)/,
// Skip the chunk that comes with the experimental warning
/(\[UNDICI-WS\])/,
/\(Use `node --trace-warnings \.\.\.` to show where the warning was created\)/,
/(WEBSOCKET [0-9]+:) (connected to)/,
/(WEBSOCKET [0-9]+:) (sending request)/,
/(WEBSOCKET [0-9]+:) (connection opened)/,
Expand Down

0 comments on commit f9d18b3

Please sign in to comment.