From bc3d210d371b6887753914aab6c9cb5999f51505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp?= Date: Sun, 12 Sep 2021 13:45:12 +0100 Subject: [PATCH] Upgrade frontend dependencies (#71) * Prevent Angular FOUC because bundle may be included with defer. * Add fake startup * Don't downgrade Node, use latest. --- .github/workflows/Heroku.yml | 9 +- Heroku/frontend/package.json | 57 +++++------ Heroku/frontend/src/planner/pages/index.html | 31 +++++- Heroku/frontend/webpack.common.js | 90 ----------------- Heroku/frontend/webpack.config.js | 100 +++++++++++++++++++ Heroku/frontend/webpack.dev.js | 7 -- Heroku/frontend/webpack.prod.js | 12 --- Heroku/package.json | 2 + 8 files changed, 159 insertions(+), 149 deletions(-) delete mode 100644 Heroku/frontend/webpack.common.js create mode 100644 Heroku/frontend/webpack.config.js delete mode 100644 Heroku/frontend/webpack.dev.js delete mode 100644 Heroku/frontend/webpack.prod.js diff --git a/.github/workflows/Heroku.yml b/.github/workflows/Heroku.yml index 4be707f7c..b7b499fc2 100644 --- a/.github/workflows/Heroku.yml +++ b/.github/workflows/Heroku.yml @@ -135,11 +135,6 @@ jobs: - name: Checkout ${{ github.ref }} branch in ${{ github.repository }} repository. uses: actions/checkout@v2 - - name: Downgrade node from v14.17.6/6.14.15 to v8.17.0/6.13.4. - uses: actions/setup-node@v2 - with: - node-version: '8' - # Set the time zone, otherwise 5 Performances display > shows performances tests fail # > - Expected By(css selector, .performance) to have text 12:00 but was 11:00 - uses: szenius/set-timezone@v1.0 @@ -177,12 +172,12 @@ jobs: working-directory: Heroku run: | npm run test - cd frontend && npm run build-prod + cd frontend && npm run build:prod # Pre-build artifacts for more immediate and deterministic startup. - name: Build Frontend working-directory: Heroku/frontend - run: npm run build-dev + run: npm run build:dev - name: Build Sync & Backend working-directory: Heroku diff --git a/Heroku/frontend/package.json b/Heroku/frontend/package.json index b1e2ad4e3..c5bc52cca 100644 --- a/Heroku/frontend/package.json +++ b/Heroku/frontend/package.json @@ -6,42 +6,39 @@ "scripts": { "preinstall": "echo Installing Frontend dependencies", "postinstall": "echo Installed Frontend dependencies", - "build": "npm run build-prod", - "build-prod": "webpack --config webpack.prod.js --progress", - "build-dev": "webpack --config webpack.dev.js --progress", - "start": "webpack --config webpack.dev.js --watch", - "dev-server": "webpack-dev-server --config webpack.dev.js --progress --colors --port 2992 --inline --content-base ../deploy/static", + "build": "npm run build:prod", + "build:prod": "webpack --config webpack.config.js --mode=production --progress", + "build:dev": "webpack --config webpack.config.js --mode=development --progress", + "start": "webpack --config webpack.config.js --mode=development --watch", + "dev-server": "webpack-dev-server --config webpack.config.js --mode=development --progress --colors --port 2992 --inline --content-base ../deploy/static", "test": "npm run test:jshint", "test:jshint": "jshint --verbose --show-non-errors src/planner/scripts" }, "dependencies": { - "lodash": "4.17.4", - "bootstrap": "3.3.7", - "jquery": "1.12.4", - "angular": "1.6.6", - "angular-resource": "1.6.6", - "angular-animate": "1.6.6", + "lodash": "4.17.21", + "bootstrap": "3.4.1", + "angular": "1.8.2", + "angular-resource": "1.8.2", + "angular-animate": "1.8.2", "angular-ui-bootstrap": "2.5.6", - "moment": "2.19.3", - "moment-timezone": "0.5.14", - "moment-range": "3.0.3" + "moment": "2.29.1", + "moment-timezone": "0.5.33", + "moment-range": "4.0.2" }, "devDependencies": { - "webpack": "3.10.0", - "webpack-dev-server": "2.9.7", - "webpack-merge": "4.1.1", - "uglifyjs-webpack-plugin": "1.1.4", - "html-webpack-plugin": "2.30.1", - "copy-webpack-plugin": "4.3.1", - "extract-text-webpack-plugin": "3.0.2", - "raw-loader": "0.5.1", - "css-loader": "0.28.7", - "sass-loader": "6.0.6", - "style-loader": "0.19.1", - "url-loader": "0.6.2", - "file-loader": "1.1.6", - - "jshint": "2.9.5", - "node-sass": "4.7.2" + "webpack": "5.52.1", + "webpack-cli": "4.8.0", + "webpack-dev-server": "4.2.0", + "html-webpack-plugin": "5.3.2", + "copy-webpack-plugin": "9.0.1", + "mini-css-extract-plugin": "2.3.0", + "raw-loader": "4.0.2", + "css-loader": "6.2.0", + "sass-loader": "12.1.0", + "style-loader": "3.2.1", + "url-loader": "4.1.1", + "file-loader": "6.2.0", + "jshint": "2.13.1", + "node-sass": "6.0.1" } } diff --git a/Heroku/frontend/src/planner/pages/index.html b/Heroku/frontend/src/planner/pages/index.html index fcf81763f..907f830c0 100644 --- a/Heroku/frontend/src/planner/pages/index.html +++ b/Heroku/frontend/src/planner/pages/index.html @@ -17,14 +17,39 @@ }; + + + - +
diff --git a/Heroku/frontend/webpack.common.js b/Heroku/frontend/webpack.common.js deleted file mode 100644 index a7fc16913..000000000 --- a/Heroku/frontend/webpack.common.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict'; -const Webpack = require('webpack'); // https://github.com/webpack/webpack -const HtmlWebpackPlugin = require('html-webpack-plugin'); // https://github.com/jantimon/html-webpack-plugin#configuration -const CopyWebpackPlugin = require('copy-webpack-plugin'); // https://github.com/kevlened/copy-webpack-plugin -const ExtractTextPlugin = require("extract-text-webpack-plugin"); -const Path = require('path'); - -const dist = Path.resolve(__dirname, '..', 'deploy'); -module.exports = { - entry: { - 'planner/index': './src/planner/scripts/index.js' - }, - output: { - path: Path.join(dist, 'static'), - // don't set publicPath to an absolute path because it emits a