From 21c752f24afa857403dda4713bcb1d27994e81ed Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Thu, 7 Nov 2019 18:10:20 +0000 Subject: [PATCH] [core] Update reconnecting-websocket to latest version Signed-off-by: Sven Efftinge --- packages/core/package.json | 2 +- .../core/src/browser/messaging/ws-connection-provider.ts | 6 +++--- yarn.lock | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index dfb350c154669..03ed5acae678e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -37,7 +37,7 @@ "react": "^16.4.1", "react-dom": "^16.4.1", "react-virtualized": "^9.20.0", - "reconnecting-websocket": "^3.0.7", + "reconnecting-websocket": "^4.2.0", "reflect-metadata": "^0.1.10", "route-parser": "^0.0.5", "vscode-languageserver-types": "^3.15.0-next", diff --git a/packages/core/src/browser/messaging/ws-connection-provider.ts b/packages/core/src/browser/messaging/ws-connection-provider.ts index e6e4f2ab4e522..d2a9b8a881444 100644 --- a/packages/core/src/browser/messaging/ws-connection-provider.ts +++ b/packages/core/src/browser/messaging/ws-connection-provider.ts @@ -19,7 +19,7 @@ import { createWebSocketConnection, Logger, ConsoleLogger } from 'vscode-ws-json import { ConnectionHandler, JsonRpcProxyFactory, JsonRpcProxy, Emitter, Event } from '../../common'; import { WebSocketChannel } from '../../common/messaging/web-socket-channel'; import { Endpoint } from '../endpoint'; -const ReconnectingWebSocket = require('reconnecting-websocket'); +import ReconnectingWebSocket from 'reconnecting-websocket'; decorate(injectable(), JsonRpcProxyFactory); decorate(unmanaged(), JsonRpcProxyFactory, 0); @@ -52,7 +52,7 @@ export class WebSocketConnectionProvider { } protected channelIdSeq = 0; - protected readonly socket: WebSocket; + protected readonly socket: ReconnectingWebSocket; protected readonly channels = new Map(); protected readonly onIncomingMessageActivityEmitter: Emitter = new Emitter(); @@ -166,7 +166,7 @@ export class WebSocketConnectionProvider { /** * Creates a web socket for the given url */ - protected createWebSocket(url: string): WebSocket { + protected createWebSocket(url: string): ReconnectingWebSocket { return new ReconnectingWebSocket(url, undefined, { maxReconnectionDelay: 10000, minReconnectionDelay: 1000, diff --git a/yarn.lock b/yarn.lock index fa11a6b98c0bb..db4e933765a4a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9209,9 +9209,10 @@ rechoir@^0.6.2: dependencies: resolve "^1.1.6" -reconnecting-websocket@^3.0.7: - version "3.2.2" - resolved "https://registry.yarnpkg.com/reconnecting-websocket/-/reconnecting-websocket-3.2.2.tgz#8097514e926e9855e03c39e76efa2e3d1f371bee" +reconnecting-websocket@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/reconnecting-websocket/-/reconnecting-websocket-4.2.0.tgz#2395f84b5d0acee439ff5df34c3fd0853d11be7c" + integrity sha512-HMD8A0sv40xhkHf/T4qxktyOvHx7K3d2A9i1QG2wRIYdMecxQJMhTIBH4aQ8KfQLfQW4UOqNSfxTgv0C+MbPIA== redent@^1.0.0: version "1.0.0"