Node 18 Upgrade
Micro-frontends of edX are currently using Node JS v16 that will no longer get support after September 11, 2023. We have to upgrade Node JS version to v18 before that
Approach
We have created tickets in each MFE for node upgrade ticket and all the tickets are added in Maintenance board. FED-BOM is creating PRs in each MFEs and adding these in the Maintenance boards as well. FED-BOM is following these steps to upgrade Node JS
Steps to upgrade
First we need to use node v18. The suggested way is to use nvm to use Node v18
Delete the
package-lock.jsonfile and runnpm installIdentify and update packages according to node v18
Add/Update
.nvmrcto use v18Update CI workflow to use node version from
.nvmrcUpdate Release workflow to use node version from
.nvmrcUpdate
lockfileversion-check.ymlworkflow to useopenedx/.github/.github/workflows/lockfileversion-check-v3.yml@masterUpdate Readme according to node v18 changes
Run unit tests, linting and build scripts if exists.
Test extract (pull/push) translations
Start & test the project
Perform consumer testing if its a library to check its impacts on consumers
If its a library and consumers are breaking with node upgrade, it should be release as a major version so renovate doesn’t auto merge its changes in consumers.
Know issues
Sometimes npm create cache with node 16 and when run on node 18 it might cause some random errors(e.g: axios mock errors). To handle such issues, it is recommended to remove node_modules.
In some cases, we have to update semantic release version to v20 as v20 of semantic release doesn’t support node version <18
In case of any help/queries, you can contact us on slack at #tech-fed-bom.