From 5556b05241eac2f768e7019fa53a01d338d7cb1a Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Sun, 12 Jan 2020 16:16:27 +0200 Subject: [PATCH] src: add deprecation warning related to removel of uws (#3648) * src: Add deprecation warning related to uws * lint: Fix lint * src: Simplify code --- src/client/websocket/WebSocketConnection.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/websocket/WebSocketConnection.js b/src/client/websocket/WebSocketConnection.js index 2937f62c1..4ea078b12 100644 --- a/src/client/websocket/WebSocketConnection.js +++ b/src/client/websocket/WebSocketConnection.js @@ -16,7 +16,10 @@ const erlpack = (function findErlpack() { const WebSocket = (function findWebSocket() { if (browser) return window.WebSocket; // eslint-disable-line no-undef try { - return require('@discordjs/uws'); + const uws = require('@discordjs/uws'); + process.emitWarning('uws support is being removed in the next version of discord.js', + 'DeprecationWarning', findWebSocket); + return uws; } catch (e) { return require('ws'); }