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

[vtadmin-web] Upgrade to node v16.13.0 LTS #9136

Merged
merged 8 commits into from
Nov 4, 2021

Conversation

doeg
Copy link
Contributor

@doeg doeg commented Nov 3, 2021

Description

🎃 This PR should be squash-merged.

tl;dr: This upgrades vtadmin-web to use node v16.13.0, which is the LTS as of October 26th, 2021. It also upgrades node-sass (by replacing with sass) and react-scripts to their latest versions.

Long version! This upgrades node to current LTS.

The node upgrade unearthed build errors with node-sass, which ended up being an unpleasant rathole of dependencies until I came across the fix mentioned in facebook/create-react-app#11037 (comment); namely, to switch from node-sass (which is now deprecated) to sass (a.k.a. "Dart Sass"). We use the SASS dependencies for building the *.scss files as described in the create-react-app docs, though it seems that page is out-of-date + still mentions the node-sass library.

I also upgraded react-scripts since it's supposedly required for that node-sass -> sass swap (although it seemed to work fine without it).

There was only one breaking change to address, which is to update *.scss files using the / division operator to use math.div instead, as described here.

The package-lock.json diff is +24,000 lines, which is.... chonky. Since upgrading to node v16.13.0 implicitly upgrades to npm v8.1.0, we have to go through the npm v7.x lockfile backwards-compatibility rigamarole described in the package-lock.json documentation.

For anyone running vtadmin-web locally:

  1. Check your node version with node --version.
  2. If upgrading is required, download node/npm LTS from https://nodejs.org/en/ (or, even better, use https://github.com/nvm-sh/nvm). If running vtadmin-web in Docker, then the node:16.3.0 docker image is recommended.
  3. Reinstall node_modules. npm is supposed to be "self healing", but deleting node_modules before running npm i (or npm ci) is not a bad idea. :)

Related Issue(s)

N/A

Checklist

  • Should this PR be backported?
  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

It's strongly recommended to build and run vtadmin-web with node v16.13.0. That said, node is "mostly backwards compatible". I've verified that vtadmin-web builds and runs with both node v12.22.7 and node v14.15.3.

If running vtadmin-web in Docker, then the node:16.3.0 docker image is recommended.

(cc @askdba, please let me know if you'd like more information for the release notes.)

@doeg doeg marked this pull request as ready for review November 3, 2021 19:19
@doeg doeg requested a review from ajm188 as a code owner November 3, 2021 19:19
@askdba askdba merged commit af6edd3 into vitessio:main Nov 4, 2021
kas-catholic added a commit to kas-catholic/confessit-web that referenced this pull request Nov 21, 2021
Node 16 is the current LTS release and has support for M1 macs.
Fortunately most of our JS is very common/simple, so the upgrade should
be painless.

Making this upgrade also required replacing node-sass with sass:
facebook/create-react-app#11037
Ex. vitessio/vitess#9136
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.

3 participants