From 7dc45afa4c2c8cc51215d476edc4f55f1a02389a Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Thu, 13 Oct 2022 14:21:01 +0000 Subject: [PATCH 1/5] chore: incrementing version number - v2.5.6 --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index a5ee0c35ff..4c0aeb6d30 100644 --- a/install/package.json +++ b/install/package.json @@ -2,7 +2,7 @@ "name": "nodebb", "license": "GPL-3.0", "description": "NodeBB Forum", - "version": "2.5.5", + "version": "2.5.6", "homepage": "http://www.nodebb.org", "repository": { "type": "git", From e92238d09a4419a58e67c1e41c34d967942ed2a8 Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Thu, 13 Oct 2022 14:21:02 +0000 Subject: [PATCH 2/5] chore: update changelog for v2.5.6 --- CHANGELOG.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c361fc2c3..04a3ab3471 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,28 @@ +#### v2.5.6 (2022-10-13) + +##### Chores + +* incrementing version number - v2.5.5 (3509ed94) +* update changelog for v2.5.5 (e7d0040d) +* incrementing version number - v2.5.4 (e83260ca) +* incrementing version number - v2.5.3 (7e922936) +* incrementing version number - v2.5.2 (babcd17e) +* incrementing version number - v2.5.1 (ce3aa950) +* incrementing version number - v2.5.0 (01d276cb) +* incrementing version number - v2.4.5 (dd3e1a28) +* incrementing version number - v2.4.4 (d5525c87) +* incrementing version number - v2.4.3 (9c647c6c) +* incrementing version number - v2.4.2 (3aa7b855) +* incrementing version number - v2.4.1 (60cbd148) +* incrementing version number - v2.4.0 (4834cde3) +* incrementing version number - v2.3.1 (d2425942) +* incrementing version number - v2.3.0 (046ea120) + +##### Bug Fixes + +* use admin:groups priv for groups (#10960) (b879b6a0) +* https://github.com/NodeBB/NodeBB/issues/10525 (e35b0a86) + #### v2.5.5 (2022-10-11) ##### Chores From dd4e9cce094048dcd5119f968e921c5d3187c962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 5 Oct 2022 22:46:42 -0400 Subject: [PATCH 3/5] perf: speed up build run webpack as soon as js targets are done this allows building js/css in parallel --- Gruntfile.js | 3 +-- src/meta/build.js | 30 +++++++++++++++++++++--------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index ea8c518ec7..3f635ac9a0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -138,10 +138,9 @@ module.exports = function (grunt) { }); const build = require('./src/meta/build'); if (!grunt.option('skip')) { - await build.build(true, { webpack: false }); + await build.build(true, { watch: true }); } run(); - await build.webpack({ watch: true }); done(); }); diff --git a/src/meta/build.js b/src/meta/build.js index 5f272387b3..1941291020 100644 --- a/src/meta/build.js +++ b/src/meta/build.js @@ -77,20 +77,36 @@ async function beforeBuild(targets) { const allTargets = Object.keys(targetHandlers).filter(name => typeof targetHandlers[name] === 'function'); -async function buildTargets(targets, parallel) { +async function buildTargets(targets, parallel, options) { const length = Math.max(...targets.map(name => name.length)); - - if (parallel) { + const jsTargets = targets.filter(target => targetHandlers.javascript.includes(target)); + const otherTargets = targets.filter(target => !targetHandlers.javascript.includes(target)); + async function buildJSTargets() { await Promise.all( - targets.map( + jsTargets.map( target => step(target, parallel, `${_.padStart(target, length)} `) ) ); + // run webpack after jstargets are done, no need to wait for css/templates etc. + if (options.webpack || options.watch) { + await exports.webpack(options); + } + } + if (parallel) { + await Promise.all([ + buildJSTargets(), + ...otherTargets.map( + target => step(target, parallel, `${_.padStart(target, length)} `) + ), + ]); } else { for (const target of targets) { // eslint-disable-next-line no-await-in-loop await step(target, parallel, `${_.padStart(target, length)} `); } + if (options.webpack || options.watch) { + await exports.webpack(options); + } } } @@ -175,11 +191,7 @@ exports.build = async function (targets, options) { } const startTime = Date.now(); - await buildTargets(targets, !series); - - if (options.webpack) { - await exports.webpack(options); - } + await buildTargets(targets, !series, options); const totalTime = (Date.now() - startTime) / 1000; await cacheBuster.write(); From ba484d5478ec6af9f28f9339116ea19ef6bba969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 6 Oct 2022 07:51:13 -0400 Subject: [PATCH 4/5] Esbuild (#10940) * ci: add minimum GitHub token permissions for workflows Signed-off-by: Ashish Kurmi * feat: use esbuild for minification Co-authored-by: Ashish Kurmi --- install/package.json | 2 ++ webpack.prod.js | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/install/package.json b/install/package.json index 4c0aeb6d30..1824a75876 100644 --- a/install/package.json +++ b/install/package.json @@ -58,6 +58,7 @@ "csurf": "1.11.0", "daemon": "1.1.0", "diff": "5.1.0", + "esbuild": "0.15.10", "express": "4.18.1", "express-session": "1.17.3", "express-useragent": "1.0.15", @@ -129,6 +130,7 @@ "sortablejs": "1.15.0", "spdx-license-list": "6.6.0", "spider-detector": "2.0.0", + "terser-webpack-plugin": "5.3.6", "textcomplete": "0.18.2", "textcomplete.contenteditable": "0.1.1", "timeago": "1.6.7", diff --git a/webpack.prod.js b/webpack.prod.js index 523e011f3d..4cecee7d9c 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -1,8 +1,19 @@ 'use strict'; const { merge } = require('webpack-merge'); +const TerserPlugin = require('terser-webpack-plugin'); + const common = require('./webpack.common'); module.exports = merge(common, { mode: 'production', + optimization: { + minimize: true, + minimizer: [ + new TerserPlugin({ + minify: TerserPlugin.esbuildMinify, + terserOptions: {}, + }), + ], + }, }); From dc4a850cacecb8c57923803363dac9bb61221bba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 6 Oct 2022 07:52:32 -0400 Subject: [PATCH 5/5] show progress --- install/package.json | 1 + webpack.prod.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/install/package.json b/install/package.json index 1824a75876..d2f62a4076 100644 --- a/install/package.json +++ b/install/package.json @@ -112,6 +112,7 @@ "pg-cursor": "2.7.3", "postcss": "8.4.14", "postcss-clean": "1.2.0", + "progress-webpack-plugin": "1.0.16", "prompt": "1.3.0", "ioredis": "5.2.2", "request": "2.88.2", diff --git a/webpack.prod.js b/webpack.prod.js index 4cecee7d9c..d5d5c8a1fe 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -2,11 +2,15 @@ const { merge } = require('webpack-merge'); const TerserPlugin = require('terser-webpack-plugin'); +const ProgressPlugin = require('progress-webpack-plugin'); const common = require('./webpack.common'); module.exports = merge(common, { mode: 'production', + plugins: [ + new ProgressPlugin(true), + ], optimization: { minimize: true, minimizer: [