diff --git a/CHANGELOG.md b/CHANGELOG.md index 3125b086c..c234bc0d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [3.4.2](https://github.com/socketio/engine.io/compare/3.4.1...3.4.2) (2020-06-04) + + +### Bug Fixes + +* remove explicit require of uws ([85e544a](https://github.com/socketio/engine.io/commit/85e544afd95a5890761a613263a5eba0c9a18a93)) + + + ## [3.4.1](https://github.com/socketio/engine.io/compare/3.4.0...3.4.1) (2020-04-17) diff --git a/lib/server.js b/lib/server.js index 3fbee3e07..6d998e8fb 100644 --- a/lib/server.js +++ b/lib/server.js @@ -102,12 +102,8 @@ Server.prototype.init = function () { if (this.ws) this.ws.close(); - var wsModule; - switch (this.wsEngine) { - case 'uws': wsModule = require('uws'); break; - case 'ws': wsModule = require('ws'); break; - default: throw new Error('unknown wsEngine'); - } + // add explicit require for bundlers like webpack + var wsModule = this.wsEngine === 'ws' ? require('ws') : require(this.wsEngine); this.ws = new wsModule.Server({ noServer: true, clientTracking: false, diff --git a/package-lock.json b/package-lock.json index 7685be4f1..3feabf0e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "engine.io", - "version": "3.4.1", + "version": "3.4.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1052,12 +1052,12 @@ } }, "engine.io-client": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.4.1.tgz", - "integrity": "sha512-RJNmA+A9Js+8Aoq815xpGAsgWH1VoSYM//2VgIiu9lNOaHFfLpTjH4tOzktBpjIs5lvOfiNY1dwf+NuU6D38Mw==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.4.2.tgz", + "integrity": "sha512-AWjc1Xg06a6UPFOBAzJf48W1UR/qKYmv/ubgSCumo9GXgvL/xGIvo05dXoBL+2NTLMipDI7in8xK61C17L25xg==", "dev": true, "requires": { - "component-emitter": "1.2.1", + "component-emitter": "~1.3.0", "component-inherit": "0.0.3", "debug": "~4.1.0", "engine.io-parser": "~2.2.0", @@ -1070,6 +1070,12 @@ "yeast": "0.1.2" }, "dependencies": { + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, "ws": { "version": "6.1.4", "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz", diff --git a/package.json b/package.json index 3129b7ca5..b106ec79f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "engine.io", - "version": "3.4.1", + "version": "3.4.2", "description": "The realtime engine behind Socket.IO. Provides the foundation of a bidirectional connection between client and server", "main": "lib/engine.io", "author": "Guillermo Rauch ", @@ -35,7 +35,7 @@ "devDependencies": { "babel-eslint": "^8.0.2", "babel-preset-es2015": "^6.24.0", - "engine.io-client": "3.4.1", + "engine.io-client": "3.4.2", "eslint": "^4.5.0", "eslint-config-standard": "^10.2.1", "eslint-plugin-import": "^2.7.0",