From 20ef16ad0064c8006fc91e047f6fd1fd7c851044 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 9 Oct 2018 17:28:24 +0200 Subject: [PATCH 1/5] Update webpack dependencies used for karma --- package.json | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index dbb034c593..ebed90801f 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "test-multi": "karma start" }, "dependencies": { - "babel-runtime": "^6.11.6", + "babel-runtime": "^6.26.0", "bluebird": "^3.5.0", "blueimp-canvas-to-blob": "^3.5.0", "browser-encrypt-attachment": "^0.3.0", @@ -98,25 +98,25 @@ "whatwg-fetch": "^1.1.1" }, "devDependencies": { - "babel-cli": "^6.5.2", - "babel-core": "^6.14.0", + "babel-cli": "^6.26.0", + "babel-core": "^6.26.3", "babel-eslint": "^6.1.2", - "babel-loader": "^6.2.5", + "babel-loader": "^7.1.5", "babel-plugin-add-module-exports": "^0.2.1", "babel-plugin-transform-async-to-bluebird": "^1.1.1", - "babel-plugin-transform-class-properties": "^6.16.0", - "babel-plugin-transform-object-rest-spread": "^6.16.0", - "babel-plugin-transform-runtime": "^6.15.0", - "babel-polyfill": "^6.5.0", - "babel-preset-es2015": "^6.14.0", - "babel-preset-es2016": "^6.11.3", - "babel-preset-es2017": "^6.14.0", - "babel-preset-react": "^6.11.1", + "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-transform-object-rest-spread": "^6.26.0", + "babel-plugin-transform-runtime": "^6.23.0", + "babel-polyfill": "^6.26.0", + "babel-preset-es2015": "^6.24.1", + "babel-preset-es2016": "^6.24.1", + "babel-preset-es2017": "^6.24.1", + "babel-preset-react": "^6.24.1", "chokidar": "^1.6.1", "concurrently": "^4.0.1", "eslint": "^3.13.1", "eslint-config-google": "^0.7.1", - "eslint-plugin-babel": "^4.0.1", + "eslint-plugin-babel": "^4.1.2", "eslint-plugin-flowtype": "^2.30.0", "eslint-plugin-react": "^7.7.0", "estree-walker": "^0.5.0", @@ -125,14 +125,14 @@ "json-loader": "^0.5.3", "karma": "^3.0.0", "karma-chrome-launcher": "^0.2.3", - "karma-cli": "^0.1.2", - "karma-junit-reporter": "^1.2.0", + "karma-cli": "^1.0.1", + "karma-junit-reporter": "^0.4.2", "karma-logcapture-reporter": "0.0.1", - "karma-mocha": "^0.2.2", + "karma-mocha": "^1.3.0", "karma-sourcemap-loader": "^0.3.7", "karma-spec-reporter": "^0.0.31", - "karma-summary-reporter": "^1.3.3", - "karma-webpack": "^3.0.5", + "karma-summary-reporter": "^1.5.1", + "karma-webpack": "^4.0.0-beta.0", "matrix-mock-request": "^1.2.1", "matrix-react-test-utils": "^0.1.1", "mocha": "^5.0.5", @@ -142,6 +142,7 @@ "sinon": "^5.0.7", "source-map-loader": "^0.2.3", "walk": "^2.3.9", - "webpack": "^1.12.14" + "webpack": "^4.20.2", + "webpack-cli": "^3.1.1" } } From 10a3f08ee207ba21a9961dce8d6a72e901a86dc0 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 9 Oct 2018 17:32:39 +0200 Subject: [PATCH 2/5] Update karma config for webpack 4 --- karma.conf.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 164cd9ce59..7e9dfb1560 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -23,6 +23,9 @@ var fs = require('fs'); // var testFile = process.env.KARMA_TEST_FILE || 'test/all-tests.js'; +// make sure we're flagged as development to avoid wasting time optimising +webpack_config.mode = 'development'; + process.env.PHANTOMJS_BIN = 'node_modules/.bin/phantomjs'; function fileExists(name) { @@ -160,10 +163,9 @@ module.exports = function (config) { webpack: { module: { - loaders: [ - { test: /\.json$/, loader: "json" }, + rules: [ { - test: /\.js$/, loader: "babel", + test: /\.js$/, loader: "babel-loader", include: [path.resolve('./src'), path.resolve('./test'), ] @@ -203,6 +205,7 @@ module.exports = function (config) { root: [ path.resolve('./test'), ], + modules: "node_modules", }, devtool: 'inline-source-map', externals: { From f5012d87cf0fb635ba62d4d926c098f7fcaba6a4 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 9 Oct 2018 17:40:25 +0200 Subject: [PATCH 3/5] Fix karma webpack config --- karma.conf.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 7e9dfb1560..73d0f87303 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -23,8 +23,6 @@ var fs = require('fs'); // var testFile = process.env.KARMA_TEST_FILE || 'test/all-tests.js'; -// make sure we're flagged as development to avoid wasting time optimising -webpack_config.mode = 'development'; process.env.PHANTOMJS_BIN = 'node_modules/.bin/phantomjs'; @@ -205,7 +203,10 @@ module.exports = function (config) { root: [ path.resolve('./test'), ], - modules: "node_modules", + modules: [ + path.resolve('./test'), + "node_modules" + ], }, devtool: 'inline-source-map', externals: { @@ -213,6 +214,8 @@ module.exports = function (config) { // (the 'commonjs' here means it will output a 'require') "electron": "commonjs electron", }, + // make sure we're flagged as development to avoid wasting time optimising + mode: 'development', }, webpackMiddleware: { From b143060b8c33a05dae992ec2d0e7fb36e4ac80b7 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 9 Oct 2018 17:44:00 +0200 Subject: [PATCH 4/5] Remove json-loader json-loader is now included in webpack4 --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index ebed90801f..370ed541dd 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,6 @@ "estree-walker": "^0.5.0", "expect": "^1.16.0", "flow-parser": "^0.57.3", - "json-loader": "^0.5.3", "karma": "^3.0.0", "karma-chrome-launcher": "^0.2.3", "karma-cli": "^1.0.1", From a1dfc6bd25173d893c8571af52b5bf68227d1ef2 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 9 Oct 2018 17:45:21 +0200 Subject: [PATCH 5/5] Remove invalid object in karma webpack config root is replaced with modules in webpack 4 --- karma.conf.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 73d0f87303..4d699599cb 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -200,9 +200,6 @@ module.exports = function (config) { 'matrix-react-sdk': path.resolve('test/skinned-sdk.js'), 'sinon': 'sinon/pkg/sinon.js', }, - root: [ - path.resolve('./test'), - ], modules: [ path.resolve('./test'), "node_modules"