Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node.js Upgrade #1062

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Node.js Upgrade #1062

wants to merge 8 commits into from

Conversation

engineervix
Copy link
Member

@engineervix engineervix commented Nov 21, 2024

Overview

When applied this MR will upgrade Node.js from v16 to v20. The upgrade was done incrementally (v16 → v18 → v20) to ensure stability and catch any compatibility issues early.

🎫 Support ticket

Deploy this: #1063 at the same time to all environments.

Node.js 16 was released on 20 Apr 2021, active support ended on 18 Oct 2022, and security support ended on 11 Sep 2023. Source: https://endoflife.date/nodejs

Node.js Updates

  • Upgraded Node.js from v16 to v18, then to v20
  • Updated nvm from 0.39.5 to 0.40.1

Security Updates

  • Applied security fixes via npm audit fix

Webpack Ecosystem Update

  • Major upgrade of webpack from v4 to v5 and related dependencies:
    • webpack-cli (3.3.12 → 5.1.4)
    • webpack-dev-server (3.11.3 → 5.1.0)
    • Various loaders and plugins updated to their latest compatible versions

Build Configuration Changes

  • Updated webpack configuration to align with v5 best practices
  • Addressed CSS compatibility warning by replacing align-items: end with align-items: flex-end
  • Fixed linting configuration (removed needless disable for scale-unlimited/declaration-strict-value)

Testing Notes

Please verify:

  • Development server starts correctly (npm start / npm run start:reload)
  • No errors in browser console
  • No webpack errors
  • Builds complete successfully (npm run build and npm run build:prod)
  • All styles are compiled correctly
  • No regressions in the development experience
  • Pre-commit hooks work as expected
  • Docker builds are ok
  • Website continues to function as before, without any broken components

Migration Notes

After pulling this branch:

  1. Delete node_modules directory
  2. Run nvm use to switch to Node.js v20
  3. Run npm install to get a fresh installation

Related Documentation

webpack                 |   4.47.0 -> 5.96.1 |
webpack-cli             |   3.3.12 -> 5.1.4  |
webpack-dev-server      |   3.11.3 -> 5.1.0  |

copy-webpack-plugin     |   5.1.2 -> 12.0.2  |
mini-css-extract-plugin |   0.7.0 -> 2.9.2   |
babel-loader            |   8.2.5 -> 9.2.1   |
css-loader              |   3.6.0 -> 7.1.2   |
postcss-loader          |   3.0.0 -> 8.1.1   |
sass-loader             |   7.3.1 -> 16.0.3  |
Because of the following webpack warning:

```console
WARNING in ./rca/static_src/sass/main.scss (./rca/static_src/sass/main.scss.webpack[javascript/auto]!=!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].use[3]!./rca/static_src/sass/main.scss)
Module Warning (from ./node_modules/postcss-loader/dist/cjs.js):
(3:110034) from "autoprefixer" plugin: end value has mixed support, consider using flex-end instead

Code:
  align-items:end

 @ ./rca/static_src/sass/main.scss
 @ ./rca/static_src/javascript/main.entry.js 35:0-27

webpack compiled with 1 warning in 3075 ms
```
@engineervix engineervix marked this pull request as ready for review November 25, 2024 00:48
@engineervix engineervix self-assigned this Nov 25, 2024
@nickmoreton nickmoreton mentioned this pull request Jan 6, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants