Upgrading all dependencies in front

Upgrading to Webpack 5, Typescript 4, ...
This commit is contained in:
David Négrier 2021-05-12 10:35:14 +02:00
parent b56e4b5674
commit 8c1e01566a
6 changed files with 616 additions and 1371 deletions

View File

@ -9,20 +9,20 @@
"@types/quill": "^1.3.7", "@types/quill": "^1.3.7",
"@typescript-eslint/eslint-plugin": "^2.26.0", "@typescript-eslint/eslint-plugin": "^2.26.0",
"@typescript-eslint/parser": "^2.26.0", "@typescript-eslint/parser": "^2.26.0",
"css-loader": "^5.1.3", "css-loader": "^5.2.4",
"eslint": "^6.8.0", "eslint": "^6.8.0",
"html-webpack-plugin": "^4.3.0", "html-webpack-plugin": "^5.3.1",
"jasmine": "^3.5.0", "jasmine": "^3.5.0",
"mini-css-extract-plugin": "^1.3.9", "mini-css-extract-plugin": "^1.6.0",
"sass": "^1.32.8", "sass": "^1.32.12",
"sass-loader": "10.1.1", "sass-loader": "^11.1.0",
"ts-loader": "^6.2.2", "ts-loader": "^9.1.2",
"ts-node": "^8.10.2", "ts-node": "^9.1.1",
"typescript": "^3.8.3", "typescript": "^4.2.4",
"webpack": "^4.42.1", "webpack": "^5.37.0",
"webpack-cli": "^3.3.11", "webpack-cli": "^4.7.0",
"webpack-dev-server": "^3.10.3", "webpack-dev-server": "^3.11.2",
"webpack-merge": "^4.2.2" "webpack-merge": "^5.7.3"
}, },
"dependencies": { "dependencies": {
"@types/simple-peer": "^9.6.0", "@types/simple-peer": "^9.6.0",
@ -36,11 +36,10 @@
"quill": "1.3.6", "quill": "1.3.6",
"rxjs": "^6.6.3", "rxjs": "^6.6.3",
"simple-peer": "^9.6.2", "simple-peer": "^9.6.2",
"socket.io-client": "^2.3.0", "socket.io-client": "^2.3.0"
"webpack-require-http": "^0.4.3"
}, },
"scripts": { "scripts": {
"start": "webpack-dev-server --open", "start": "webpack serve --open",
"build": "webpack --config webpack.prod.js", "build": "webpack --config webpack.prod.js",
"test": "ts-node node_modules/jasmine/bin/jasmine --config=jasmine.json", "test": "ts-node node_modules/jasmine/bin/jasmine --config=jasmine.json",
"lint": "node_modules/.bin/eslint src/ . --ext .ts", "lint": "node_modules/.bin/eslint src/ . --ext .ts",

View File

@ -1,6 +1,5 @@
import { Subject } from "rxjs"; import { Subject } from "rxjs";
import { ChatEvent, isChatEvent } from "./Events/ChatEvent"; import { ChatEvent, isChatEvent } from "./Events/ChatEvent";
import * as crypto from "crypto";
import { HtmlUtils } from "../WebRtc/HtmlUtils"; import { HtmlUtils } from "../WebRtc/HtmlUtils";
import { EnterLeaveEvent } from "./Events/EnterLeaveEvent"; import { EnterLeaveEvent } from "./Events/EnterLeaveEvent";
import { isOpenPopupEvent, OpenPopupEvent } from "./Events/OpenPopupEvent"; import { isOpenPopupEvent, OpenPopupEvent } from "./Events/OpenPopupEvent";
@ -176,7 +175,7 @@ class IframeListener {
} }
private getIFrameId(scriptUrl: string): string { private getIFrameId(scriptUrl: string): string {
return 'script' + crypto.createHash('md5').update(scriptUrl).digest("hex"); return 'script' + btoa(scriptUrl);
} }
unregisterScript(scriptUrl: string): void { unregisterScript(scriptUrl: string): void {

View File

@ -151,7 +151,7 @@ export class GameScene extends DirtyScene implements CenterListener {
private GlobalMessageManager!: GlobalMessageManager; private GlobalMessageManager!: GlobalMessageManager;
public ConsoleGlobalMessageManager!: ConsoleGlobalMessageManager; public ConsoleGlobalMessageManager!: ConsoleGlobalMessageManager;
private connectionAnswerPromise: Promise<RoomJoinedMessageInterface>; private connectionAnswerPromise: Promise<RoomJoinedMessageInterface>;
private connectionAnswerPromiseResolve!: (value?: RoomJoinedMessageInterface | PromiseLike<RoomJoinedMessageInterface>) => void; private connectionAnswerPromiseResolve!: (value: RoomJoinedMessageInterface | PromiseLike<RoomJoinedMessageInterface>) => void;
// A promise that will resolve when the "create" method is called (signaling loading is ended) // A promise that will resolve when the "create" method is called (signaling loading is ended)
private createPromise: Promise<void>; private createPromise: Promise<void>;
private createPromiseResolve!: (value?: void | PromiseLike<void>) => void; private createPromiseResolve!: (value?: void | PromiseLike<void>) => void;

View File

@ -137,14 +137,14 @@ class CoWebsiteManager {
if (allowPolicy) { if (allowPolicy) {
iframe.allow = allowPolicy; iframe.allow = allowPolicy;
} }
const onloadPromise = new Promise((resolve) => { const onloadPromise = new Promise<void>((resolve) => {
iframe.onload = () => resolve(); iframe.onload = () => resolve();
}); });
if (allowApi) { if (allowApi) {
iframeListener.registerIframe(iframe); iframeListener.registerIframe(iframe);
} }
this.cowebsiteMainDom.appendChild(iframe); this.cowebsiteMainDom.appendChild(iframe);
const onTimeoutPromise = new Promise((resolve) => { const onTimeoutPromise = new Promise<void>((resolve) => {
setTimeout(() => resolve(), 2000); setTimeout(() => resolve(), 2000);
}); });
this.currentOperationPromise = this.currentOperationPromise.then(() =>Promise.race([onloadPromise, onTimeoutPromise])).then(() => { this.currentOperationPromise = this.currentOperationPromise.then(() =>Promise.race([onloadPromise, onTimeoutPromise])).then(() => {

View File

@ -46,9 +46,9 @@ module.exports = {
path: path.resolve(__dirname, 'dist'), path: path.resolve(__dirname, 'dist'),
publicPath: '/' publicPath: '/'
}, },
externals:[ /*externals:[
require('webpack-require-http') require('webpack-require-http')
], ],*/
plugins: [ plugins: [
new MiniCssExtractPlugin({filename: 'style.[contenthash].css'}), new MiniCssExtractPlugin({filename: 'style.[contenthash].css'}),
new HtmlWebpackPlugin( new HtmlWebpackPlugin(
@ -81,7 +81,9 @@ module.exports = {
'TURN_PASSWORD': null, 'TURN_PASSWORD': null,
'JITSI_URL': null, 'JITSI_URL': null,
'JITSI_PRIVATE_MODE': null, 'JITSI_PRIVATE_MODE': null,
'START_ROOM_URL': null 'START_ROOM_URL': null,
'MAX_USERNAME_LENGTH': 8,
'MAX_PER_GROUP': 4
}) })
], ],

File diff suppressed because it is too large Load Diff