Browse Source

Update dependencies

master
Eduard Kuzmenko 4 years ago
parent
commit
fe312d7493
  1. 1
      .gitignore
  2. 12662
      package-lock.json
  3. 57
      package.json
  4. 2
      src/components/chat/markupTooltip.ts
  5. 4
      src/lib/mtproto/apiManager.ts
  6. 5
      src/lib/mtproto/networker.ts
  7. 17
      webpack.common.js
  8. 13
      webpack.prod.js

1
.gitignore vendored

@ -9,7 +9,6 @@ src/rlottie.github.io
public2 public2
public3 public3
.vscode .vscode
package-lock.json
session_name.session session_name.session
tasks.txt tasks.txt
yarn.lock yarn.lock

12662
package-lock.json generated

File diff suppressed because it is too large Load Diff

57
package.json

@ -18,67 +18,58 @@
"author": "", "author": "",
"license": "GPL-3.0-only", "license": "GPL-3.0-only",
"dependencies": { "dependencies": {
"jsbn": "^1.1.0",
"webpack-dev-server": "^3.11.2" "webpack-dev-server": "^3.11.2"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.12.13", "@babel/cli": "^7.13.16",
"@babel/core": "^7.12.13", "@babel/core": "^7.14.2",
"@babel/plugin-proposal-class-properties": "^7.12.13", "@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-transform-typescript": "^7.12.13", "@babel/plugin-transform-typescript": "^7.13.0",
"@babel/polyfill": "^7.12.1", "@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.12.13", "@babel/preset-env": "^7.14.2",
"@babel/preset-es2015": "^7.0.0-beta.53", "@babel/preset-es2015": "^7.0.0-beta.53",
"@babel/preset-typescript": "^7.12.13", "@babel/preset-typescript": "^7.13.0",
"@cryptography/aes": "^0.1.1", "@cryptography/aes": "^0.1.1",
"@cryptography/sha1": "^0.1.0", "@cryptography/sha1": "^0.2.0",
"@cryptography/sha256": "^0.2.0", "@cryptography/sha256": "^0.2.0",
"@peculiar/webcrypto": "^1.1.6", "@peculiar/webcrypto": "^1.1.7",
"@types/aes-js": "^3.1.1", "@types/chrome": "0.0.139",
"@types/chrome": "0.0.91", "@types/jest": "^26.0.23",
"@types/jest": "^24.9.1", "@types/serviceworker-webpack-plugin": "^1.0.2",
"@types/serviceworker-webpack-plugin": "^1.0.1",
"aes-js": "^3.1.2",
"autoprefixer": "^9.8.6", "autoprefixer": "^9.8.6",
"babel-jest": "^24.9.0", "babel-jest": "^26.6.3",
"babel-loader": "^8.2.2", "babel-loader": "^8.2.2",
"babel-preset-es2015": "^6.24.1", "babel-preset-es2015": "^6.24.1",
"compression": "^1.7.4", "compression": "^1.7.4",
"compression-webpack-plugin": "^3.1.0",
"core-js": "^3.8.3",
"css-loader": "^3.6.0", "css-loader": "^3.6.0",
"express": "^4.17.1", "express": "^4.17.1",
"fast-png": "^5.0.3", "fast-png": "^5.0.4",
"handlebars": "^4.7.6", "handlebars": "^4.7.7",
"handlebars-loader": "^1.7.1", "handlebars-loader": "^1.7.1",
"html-webpack-plugin": "^3.2.0", "html-webpack-plugin": "^4.5.2",
"ifdef-loader": "^2.1.5", "ifdef-loader": "^2.3.0",
"install": "^0.13.0", "jest": "^26.6.3",
"jest": "^24.9.0",
"media-query-plugin": "^1.4.0", "media-query-plugin": "^1.4.0",
"mini-css-extract-plugin": "^0.9.0", "mini-css-extract-plugin": "^0.9.0",
"node-sass": "^4.14.1", "npm": "^7.12.1",
"npm": "^6.14.11",
"on-build-webpack": "^0.1.0", "on-build-webpack": "^0.1.0",
"optimize-css-assets-webpack-plugin": "^5.0.4", "optimize-css-assets-webpack-plugin": "^5.0.4",
"pako": "^1.0.11", "pako": "^2.0.3",
"postcss": "^8.2.10", "postcss": "^8.2.10",
"postcss-loader": "^3.0.0", "postcss-loader": "^3.0.0",
"postcss-preset-env": "^6.7.0", "postcss-preset-env": "^6.7.0",
"qr-code-styling": "^1.3.4", "qr-code-styling": "^1.3.4",
"resolve-url-loader": "^3.1.2", "sass": "^1.32.13",
"sass-loader": "^8.0.2", "sass-loader": "^8.0.2",
"serviceworker-webpack-plugin": "^1.0.1", "serviceworker-webpack-plugin": "^1.0.1",
"style-loader": "^1.3.0", "style-loader": "^1.3.0",
"terser-webpack-plugin": "^3.1.0",
"text-encoding": "^0.7.0", "text-encoding": "^0.7.0",
"ts-jest": "^24.3.0", "ts-jest": "^26.5.6",
"ts-loader": "^6.2.2", "ts-loader": "^8.2.0",
"typescript": "^3.9.7", "typescript": "^4.2.4",
"url-loader": "^2.3.0",
"webpack": "^4.46.0", "webpack": "^4.46.0",
"webpack-cli": "^3.3.12", "webpack-cli": "^3.3.12",
"webpack-merge": "^4.2.2", "webpack-merge": "^4.2.2",
"worker-loader": "^2.0.0" "worker-loader": "^3.0.8"
} }
} }

2
src/components/chat/markupTooltip.ts

@ -345,7 +345,7 @@ export default class MarkupTooltip {
this.show(); this.show();
//!isTouchSupported && document.addEventListener('mouseup', this.onMouseUp); /* !isTouchSupported && document.addEventListener('mouseup', this.onMouseUp); */
}; };
public setMouseUpEvent() { public setMouseUpEvent() {

4
src/lib/mtproto/apiManager.ts

@ -194,7 +194,9 @@ export class ApiManager {
} }
const networkers = cache[dcId]; const networkers = cache[dcId];
if(networkers.length >= /* 1 */(connectionType === 'client' || transportType === 'https' ? 1 : (connectionType === 'download' ? 3 : 3))) { // @ts-ignore
const maxNetworkers = connectionType === 'client' || transportType === 'https' ? 1 : (connectionType === 'download' ? 3 : 3);
if(networkers.length >= maxNetworkers) {
let i = networkers.length - 1, found = false; let i = networkers.length - 1, found = false;
for(; i >= 0; --i) { for(; i >= 0; --i) {
if(networkers[i].isOnline) { if(networkers[i].isOnline) {

5
src/lib/mtproto/networker.ts

@ -94,11 +94,12 @@ export default class MTPNetworker {
private pendingResends: Array<string> = []; private pendingResends: Array<string> = [];
private connectionInited = false; private connectionInited = false;
private nextReqTimeout: number;
private nextReq: number = 0;
/// #if MTPROTO_HTTP || MTPROTO_HTTP_UPLOAD /// #if MTPROTO_HTTP || MTPROTO_HTTP_UPLOAD
//private longPollInt: number; //private longPollInt: number;
private longPollPending = 0; private longPollPending = 0;
private nextReqTimeout: number;
private nextReq: number = 0;
private checkConnectionTimeout: number; private checkConnectionTimeout: number;
private checkConnectionPeriod = 0; private checkConnectionPeriod = 0;
private sleepAfter = 0; private sleepAfter = 0;

17
webpack.common.js

@ -9,7 +9,7 @@ const fs = require('fs');
const allowedIPs = ['127.0.0.1']; const allowedIPs = ['127.0.0.1'];
const devMode = process.env.NODE_ENV !== 'production'; const devMode = process.env.NODE_ENV !== 'production';
const useLocal = true; const useLocal = true;
const useLocalNotLocal = true; const useLocalNotLocal = false;
if(devMode) { if(devMode) {
console.log('DEVMODE IS ON!'); console.log('DEVMODE IS ON!');
@ -22,8 +22,9 @@ const opts = {
MTPROTO_HTTP_UPLOAD: false, MTPROTO_HTTP_UPLOAD: false,
DEBUG: devMode, DEBUG: devMode,
version: 3, version: 3,
"ifdef-verbose": devMode, // add this for verbose output 'ifdef-verbose': devMode, // add this for verbose output
"ifdef-triple-slash": true // add this to use double slash comment instead of default triple slash 'ifdef-triple-slash': true, // add this to use double slash comment instead of default triple slash
'ifdef-fill-with-blanks': true // add this to remove code with blank spaces instead of "//" comments
}; };
const domain = 'yourdomain.com'; const domain = 'yourdomain.com';
@ -66,7 +67,7 @@ module.exports = {
use: [ use: [
//{ loader: 'babel-loader', options: require('./babel.config') }, //{ loader: 'babel-loader', options: require('./babel.config') },
'ts-loader', 'ts-loader',
{ loader: "ifdef-loader", options: opts } { loader: 'ifdef-loader', options: opts }
], ],
exclude: /node_modules/, exclude: /node_modules/,
}, },
@ -91,10 +92,10 @@ module.exports = {
//devtool: 'inline-source-map', //devtool: 'inline-source-map',
output: { output: {
globalObject: "this", globalObject: 'this',
path: path.resolve(__dirname, 'public'), path: path.resolve(__dirname, 'public'),
filename: "[name].[chunkhash].bundle.js", filename: '[name].[chunkhash].bundle.js',
chunkFilename: "[name].[chunkhash].chunk.js" chunkFilename: '[name].[chunkhash].chunk.js'
}, },
devServer: { devServer: {
@ -162,7 +163,7 @@ module.exports = {
minifyCSS: true, minifyCSS: true,
minifyURLs: true minifyURLs: true
}, },
chunks: "all", chunks: 'all',
excludeChunks: [] excludeChunks: []
}), }),

13
webpack.prod.js

@ -4,10 +4,10 @@ const path = require('path');
const merge = require('webpack-merge'); const merge = require('webpack-merge');
const common = require('./webpack.common.js'); const common = require('./webpack.common.js');
const CompressionPlugin = require("compression-webpack-plugin"); //const CompressionPlugin = require("compression-webpack-plugin");
const WebpackOnBuildPlugin = require('on-build-webpack'); const WebpackOnBuildPlugin = require('on-build-webpack');
const TerserJSPlugin = require('terser-webpack-plugin'); //const TerserJSPlugin = require('terser-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); //const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const fs = require('fs'); const fs = require('fs');
const buildDir = __dirname + '/public/'; const buildDir = __dirname + '/public/';
@ -41,13 +41,13 @@ module.exports = merge(common, {
}, },
plugins: [ plugins: [
new CompressionPlugin({ /* new CompressionPlugin({
filename: '[path].gz[query]', filename: '[path].gz[query]',
algorithm: 'gzip', algorithm: 'gzip',
test: /\.(js|css|html|svg)$/, test: /\.(js|css|html|svg)$/,
threshold: 10240, threshold: 10240,
minRatio: 0.8, minRatio: 0.8,
}), }), */
/* new CompressionPlugin({ /* new CompressionPlugin({
filename: '[path].br[query]', filename: '[path].br[query]',
algorithm: 'brotliCompress', algorithm: 'brotliCompress',
@ -70,13 +70,12 @@ module.exports = merge(common, {
|| file.includes('.webmanifest') || file.includes('.webmanifest')
|| file.includes('.wasm') || file.includes('.wasm')
|| file.includes('rlottie') || file.includes('rlottie')
|| file.includes('pako')
|| file.includes('Worker.min.js') || file.includes('Worker.min.js')
|| file.includes('recorder.min.js') || file.includes('recorder.min.js')
|| file.includes('.hbs')) return; || file.includes('.hbs')) return;
let p = path.resolve(buildDir + file); let p = path.resolve(buildDir + file);
if(!newlyCreatedAssets[file] && ['.gz', '.js'].find(ext => file.endsWith(ext)) !== undefined) { if(!newlyCreatedAssets[file] && ['.gz', '.js', '.ts', '.map', '.css', '.txt'].find(ext => file.endsWith(ext)) !== undefined) {
//console.log('to unlink 2:', file); //console.log('to unlink 2:', file);

Loading…
Cancel
Save