Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Most of our repositories are currently using Node v8 or v12. As node v8’s support ended on 31st December 2019 and node v12’s support is scheduled to end on 30th April 2022, we’re going to start upgrading our repositories to node v16.

...

(we’ll consider adding a modernizer to automate this phase as well but as of now it’s going to be a manual step taken by the owning team).

If applicable, please update the status in this sheet as well Node 16 upgrade status tracking

Steps to deploy an MFE on Node 16:

...

Helpful local testing notes for testing out enterprise repos against node 16

In case someone decides to try this, here are the tailored node ‘tryout’ instructions. I can move this to a doc if that works better. Consulted with @astankiewicz before sending this out

  • Install nvm locally (you can use other node manages too this is just what I use)

  • Sync this branch of frontend-enterprise with Adam’s fixes: https://github.com/openedx/frontend-enterprise/pull/250

  • Start completely clean, remove node_modules/, package-lock file (it will all need to be regenerated)

  • update .nvmrc file to v16 if not already

  • nvm use (nvm will ask to install node16 if not already on your system)

  • Verify node is now 16 and npm is v8

Code Block
node -v; npm -v 
  • npm run clean; npm run setup; npm run build

  • All set with frontend-enterprise prep

MFE

  • For MFE: keep what you have, do not upgrade node:

  • Ensure node version by node -v and npm -v is what you used to have.

  • Create/update module.config.js file with the necessary changes such as this (for learner portal)

Code Block
{ moduleName: '@edx/frontend-enterprise-catalog-search', dir: '../frontend-enterprise/packages/catalog-search', dist: 'src' },
        { moduleName: '@edx/frontend-enterprise-utils', dir: '../frontend-enterprise/packages/utils', dist: 'src' },
  • Note: using dist: 'src' mean you will get hot reload without having to rebuild frontend-enterprise all the time

  • Start app. If already running, you first need to ctrl+c to pick up the module.config changes

  • Test the app!

There you go, this is what I think needs to be done. I will be doing this myself, but this is for adventurous souls to explore as they wish!