Merge pull request #70 from lawl/master

Upgrade dependencies
This commit is contained in:
Jonas Herzig 2020-04-02 15:04:19 +02:00 committed by GitHub
commit 6e3e58415b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 278 additions and 98 deletions

View file

@ -4,8 +4,7 @@ import EventEmitter from 'events'
import { Writable, PassThrough } from 'stream' import { Writable, PassThrough } from 'stream'
import toArrayBuffer from 'to-arraybuffer' import toArrayBuffer from 'to-arraybuffer'
import ByteBuffer from 'bytebuffer' import ByteBuffer from 'bytebuffer'
import webworkify from 'webworkify' import Worker from './worker'
import worker from './worker'
/** /**
* Creates proxy MumbleClients to a real ones running on a web worker. * Creates proxy MumbleClients to a real ones running on a web worker.
@ -13,7 +12,7 @@ import worker from './worker'
*/ */
class WorkerBasedMumbleConnector { class WorkerBasedMumbleConnector {
constructor () { constructor () {
this._worker = webworkify(worker) this._worker = new Worker()
this._worker.addEventListener('message', this._onMessage.bind(this)) this._worker.addEventListener('message', this._onMessage.bind(this))
this._reqId = 1 this._reqId = 1
this._requests = {} this._requests = {}

View file

@ -3,18 +3,11 @@ import mumbleConnect from 'mumble-client-websocket'
import toArrayBuffer from 'to-arraybuffer' import toArrayBuffer from 'to-arraybuffer'
import chunker from 'stream-chunker' import chunker from 'stream-chunker'
import Resampler from 'libsamplerate.js' import Resampler from 'libsamplerate.js'
import CodecsBrowser from 'mumble-client-codecs-browser'
// Polyfill nested webworkers for https://bugs.chromium.org/p/chromium/issues/detail?id=31666 // Polyfill nested webworkers for https://bugs.chromium.org/p/chromium/issues/detail?id=31666
import 'subworkers' import 'subworkers'
// Monkey-patch to allow webworkify-webpack and codecs to work inside of web worker
/* global URL */
window.URL = URL
// Using require to ensure ordering relative to monkey-patch above
let CodecsBrowser = require('mumble-client-codecs-browser')
export default function (self) {
let sampleRate let sampleRate
let nextClientId = 1 let nextClientId = 1
let nextVoiceId = 1 let nextVoiceId = 1
@ -284,4 +277,5 @@ export default function (self) {
console.error('exception during message event', ev.data, ex) console.error('exception during message event', ev.data, ex)
} }
}) })
}
export default null

View file

@ -4,7 +4,7 @@
"description": "An HTML5 Mumble client.", "description": "An HTML5 Mumble client.",
"scripts": { "scripts": {
"build": "webpack && [ -f dist/config.local.js ] || cp app/config.local.js dist/", "build": "webpack && [ -f dist/config.local.js ] || cp app/config.local.js dist/",
"prepublish": "rm -rf dist && npm run build", "prepare": "rm -rf dist && npm run build",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"author": "Jonas Herzig <me@johni0702.de>", "author": "Jonas Herzig <me@johni0702.de>",
@ -15,43 +15,46 @@
"dist" "dist"
], ],
"devDependencies": { "devDependencies": {
"audio-buffer-utils": "^3.1.2", "@babel/core": "^7.9.0",
"@babel/plugin-transform-runtime": "^7.9.0",
"@babel/preset-env": "^7.9.0",
"@babel/runtime": "^7.9.2",
"audio-buffer-utils": "^5.1.2",
"audio-context": "^1.0.3", "audio-context": "^1.0.3",
"babel-core": "^6.18.2", "babel-loader": "^8.1.0",
"babel-loader": "^6.2.8", "brfs": "^2.0.2",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-es2015": "^6.14.0",
"babel-runtime": "^6.18.0",
"brfs": "^1.4.3",
"bytebuffer": "^5.0.1", "bytebuffer": "^5.0.1",
"css-loader": "^0.26.0", "css-loader": "^3.4.2",
"dompurify": "^0.8.9", "dompurify": "^2.0.8",
"drop-stream": "^1.0.0", "drop-stream": "^1.0.0",
"duplex-maker": "^1.0.0", "duplex-maker": "^1.0.0",
"extract-loader": "^0.1.0", "extract-loader": "^5.0.1",
"file-loader": "^0.9.0", "file-loader": "^4.3.0",
"getusermedia": "^2.0.0", "fs": "0.0.1-security",
"html-loader": "^0.4.4", "getusermedia": "^2.0.1",
"json-loader": "^0.5.4", "html-loader": "^0.5.5",
"keyboardjs": "^2.3.4", "json-loader": "^0.5.7",
"knockout": "^3.4.0", "keyboardjs": "^2.5.1",
"knockout": "^3.5.1",
"libsamplerate.js": "^1.0.0",
"lodash.assign": "^4.2.0", "lodash.assign": "^4.2.0",
"microphone-stream": "^3.0.5", "microphone-stream": "^5.0.1",
"node-sass": "^4.9.3", "mumble-client": "^1.3.0",
"raw-loader": "^0.5.1", "mumble-client-codecs-browser": "^1.2.0",
"regexp-replace-loader": "0.0.1", "mumble-client-websocket": "^1.0.0",
"sass-loader": "^4.1.1", "node-sass": "^4.13.1",
"raw-loader": "^4.0.0",
"regexp-replace-loader": "1.0.1",
"sass-loader": "^8.0.2",
"stream-chunker": "^1.2.8", "stream-chunker": "^1.2.8",
"subworkers": "^1.0.1", "subworkers": "^1.0.1",
"to-arraybuffer": "^1.0.1", "to-arraybuffer": "^1.0.1",
"transform-loader": "^0.2.3", "transform-loader": "^0.2.4",
"voice-activity-detection": "johni0702/voice-activity-detection#9f8bd90", "voice-activity-detection": "johni0702/voice-activity-detection#9f8bd90",
"webpack": "^1.13.3", "web-audio-buffer-queue": "^1.1.0",
"webworkify-webpack": "^1.1.8", "webpack": "^4.42.1",
"libsamplerate.js": "^1.0.0", "webpack-cli": "^3.3.11",
"mumble-client-codecs-browser": "^1.2.0", "worker-loader": "^2.0.0"
"mumble-client-websocket": "^1.0.0", },
"mumble-client": "^1.3.0", "optionalDependencies": {}
"web-audio-buffer-queue": "^1.1.0"
}
} }

View file

@ -0,0 +1,183 @@
diff --git a/node_modules/mumble-client-codecs-browser/lib/decode-worker.js b/node_modules/mumble-client-codecs-browser/lib/decode-worker.js
index 3925f29..be9af92 100644
--- a/node_modules/mumble-client-codecs-browser/lib/decode-worker.js
+++ b/node_modules/mumble-client-codecs-browser/lib/decode-worker.js
@@ -1,10 +1,6 @@
'use strict';
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = function (self) {
var opusDecoder, celt7Decoder;
self.addEventListener('message', function (e) {
var data = e.data;
@@ -55,10 +51,12 @@ exports.default = function (self) {
}, [_decoded.buffer]);
}
});
-};
+
var _libopus = require('libopus.js');
var _libcelt = require('libcelt7.js');
var MUMBLE_SAMPLE_RATE = 48000;
+
+export default null
\ No newline at end of file
diff --git a/node_modules/mumble-client-codecs-browser/lib/decoder-stream.js b/node_modules/mumble-client-codecs-browser/lib/decoder-stream.js
index 6cfda8b..28a9549 100644
--- a/node_modules/mumble-client-codecs-browser/lib/decoder-stream.js
+++ b/node_modules/mumble-client-codecs-browser/lib/decoder-stream.js
@@ -1,9 +1,5 @@
'use strict';
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _stream = require('stream');
@@ -12,17 +8,11 @@ var _reusePool = require('reuse-pool');
var _reusePool2 = _interopRequireDefault(_reusePool);
-var _webworkify = require('webworkify');
-
-var _webworkify2 = _interopRequireDefault(_webworkify);
-
var _toArraybuffer = require('to-arraybuffer');
var _toArraybuffer2 = _interopRequireDefault(_toArraybuffer);
-var _decodeWorker = require('./decode-worker');
-
-var _decodeWorker2 = _interopRequireDefault(_decodeWorker);
+import DecodeWorker from './decode-worker';
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -33,7 +23,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var pool = (0, _reusePool2.default)(function () {
- return (0, _webworkify2.default)(_decodeWorker2.default);
+ return new DecodeWorker();
});
// Prepare first worker
pool.recycle(pool.get());
@@ -48,11 +38,6 @@ var DecoderStream = function (_Transform) {
_this._worker = pool.get();
_this._worker.onmessage = function (msg) {
- if (_this._worker.objectURL) {
- // The object URL can now be revoked as the worker has been loaded
- window.URL.revokeObjectURL(_this._worker.objectURL);
- _this._worker.objectURL = null;
- }
_this._onMessage(msg.data);
};
return _this;
@@ -112,4 +97,5 @@ var DecoderStream = function (_Transform) {
return DecoderStream;
}(_stream.Transform);
-exports.default = DecoderStream;
\ No newline at end of file
+//exports.default = DecoderStream;
+export default DecoderStream
\ No newline at end of file
diff --git a/node_modules/mumble-client-codecs-browser/lib/encode-worker.js b/node_modules/mumble-client-codecs-browser/lib/encode-worker.js
index f7187ab..c2ebaa3 100644
--- a/node_modules/mumble-client-codecs-browser/lib/encode-worker.js
+++ b/node_modules/mumble-client-codecs-browser/lib/encode-worker.js
@@ -1,10 +1,6 @@
'use strict';
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = function (self) {
var opusEncoder, celt7Encoder;
var bitrate;
self.addEventListener('message', function (e) {
@@ -70,7 +66,7 @@ exports.default = function (self) {
}, [_buffer]);
}
});
-};
+
var _libopus = require('libopus.js');
@@ -83,3 +79,5 @@ var _toArraybuffer2 = _interopRequireDefault(_toArraybuffer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var MUMBLE_SAMPLE_RATE = 48000;
+
+export default null
\ No newline at end of file
diff --git a/node_modules/mumble-client-codecs-browser/lib/encoder-stream.js b/node_modules/mumble-client-codecs-browser/lib/encoder-stream.js
index 021f131..eeb9189 100644
--- a/node_modules/mumble-client-codecs-browser/lib/encoder-stream.js
+++ b/node_modules/mumble-client-codecs-browser/lib/encoder-stream.js
@@ -1,9 +1,5 @@
'use strict';
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _stream = require('stream');
@@ -12,13 +8,7 @@ var _reusePool = require('reuse-pool');
var _reusePool2 = _interopRequireDefault(_reusePool);
-var _webworkify = require('webworkify');
-
-var _webworkify2 = _interopRequireDefault(_webworkify);
-
-var _encodeWorker = require('./encode-worker');
-
-var _encodeWorker2 = _interopRequireDefault(_encodeWorker);
+import EncodeWorker from './encode-worker'
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -29,7 +19,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var pool = (0, _reusePool2.default)(function () {
- return (0, _webworkify2.default)(_encodeWorker2.default);
+ return new EncodeWorker();
});
// Prepare first worker
pool.recycle(pool.get());
@@ -46,11 +36,6 @@ var EncoderStream = function (_Transform) {
_this._worker = pool.get();
_this._worker.onmessage = function (msg) {
- if (_this._worker.objectURL) {
- // The object URL can now be revoked as the worker has been loaded
- window.URL.revokeObjectURL(_this._worker.objectURL);
- _this._worker.objectURL = null;
- }
_this._onMessage(msg.data);
};
return _this;
@@ -96,4 +81,5 @@ var EncoderStream = function (_Transform) {
return EncoderStream;
}(_stream.Transform);
-exports.default = EncoderStream;
\ No newline at end of file
+//exports.default = EncoderStream;
+export default EncoderStream
\ No newline at end of file

View file

@ -1,8 +1,8 @@
var theme = 'MetroMumbleLight' var theme = '../themes/MetroMumbleLight'
var path = require('path');
var path = require('path')
module.exports = { module.exports = {
mode: 'development',
entry: { entry: {
index: [ index: [
'./app/index.js', './app/index.js',
@ -12,42 +12,46 @@ module.exports = {
theme: './app/theme.js', theme: './app/theme.js',
matrix: './app/matrix.js' matrix: './app/matrix.js'
}, },
devtool: "cheap-source-map",
output: { output: {
filename: '[name].js', path: path.join(__dirname, 'dist'),
path: './dist' filename: '[name].js'
}, },
module: { module: {
postLoaders: [ rules: [
{
include: /mumble-streams\/lib\/data.js/,
loader: 'transform-loader?brfs'
}
],
loaders: [
{ {
test: /\.js$/, test: /\.js$/,
exclude: /node_modules/, exclude: /node_modules/,
loader: 'babel-loader', use: {
query: { loader: 'babel-loader',
presets: ['es2015'], options: {
plugins: ['transform-runtime'] presets: ['@babel/preset-env'],
plugins: ['@babel/plugin-transform-runtime']
}
} }
}, },
{ {
test: /\.html$/, test: /\.html$/,
loaders: [ use: [
'file-loader?name=[name].[ext]', {
'extract-loader', loader: 'file-loader',
'html-loader?' + JSON.stringify({ options: { 'name': '[name].[ext]' }
attrs: ['img:src', 'link:href'], },
interpolate: 'require', {
root: theme loader: "extract-loader"
}) },
{
loader: 'html-loader',
options: {
attrs: ['img:src', 'link:href'],
root: theme
}
}
] ]
}, },
{ {
test: /\.css$/, test: /\.css$/,
loaders: [ use: [
'file-loader', 'file-loader',
'extract-loader', 'extract-loader',
'css-loader' 'css-loader'
@ -55,7 +59,7 @@ module.exports = {
}, },
{ {
test: /\.scss$/, test: /\.scss$/,
loaders: [ use: [
'file-loader?name=[hash].css', 'file-loader?name=[hash].css',
'extract-loader', 'extract-loader',
'css-loader', 'css-loader',
@ -63,45 +67,42 @@ module.exports = {
] ]
}, },
{ {
type: 'javascript/auto',
test: /manifest\.json$|\.xml$/, test: /manifest\.json$|\.xml$/,
loaders: [ use: [
'file-loader', 'file-loader',
'extract-loader', 'extract-loader',
'regexp-replace-loader?' + JSON.stringify({ {
match: { loader: 'regexp-replace-loader',
pattern: "#require\\('([^']*)'\\)", options: {
flags: 'g' match: {
}, pattern: "#require\\('([^']*)'\\)",
replaceWith: '"+require("$1")+"' flags: 'g'
}), },
replaceWith: '"+require("$1")+"'
}
},
'raw-loader' 'raw-loader'
] ]
}, },
{ {
test: /\.json$/, test: /\.(svg|png|ico)$/,
exclude: /manifest\.json$/, use: [
loader: 'json-loader' 'file-loader'
]
}, },
{ {
test: /\.(svg|png|ico)$/, test: /worker\.js$/,
loader: 'file-loader' use: { loader: 'worker-loader' }
},
{
enforce: 'post',
test: /mumble-streams\/lib\/data.js/,
use: [
'transform-loader?brfs'
]
} }
] ]
}, },
resolve: { target: 'web'
alias: {
webworkify: 'webworkify-webpack'
},
root: [
path.resolve('./themes/')
]
},
includes: {
pattern: function (filepath) {
return {
re: /#require\((.+)\)/,
index: 1
}
}
}
} }