Upgrade project dependencies and remove unused ones #120
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To create this PR, I ran
npx npm-check-updates -u
, then deletedyarn.lock
and ranyarn fix:yarn-deduplicate
. Then I checked if we have any unused depenedencies and removed those that were not mentioned in the code. We can re-add them later when needed.Here is a full list of removed depencencies:
"history": "^5.0.1"
"react-apexcharts": "^1.3.9"
"react-beautiful-dnd": "^13.1.0"
"react-draft-wysiwyg": "^1.14.7"
"react-markdown": "^7.1.0"
"react-modal-image": "^2.5.0"
"react-quill": "^1.3.5"
"react-redux": "^7.2.6"
"react-syntax-highlighter": "^15.4.4"
"stylis-plugin-rtl": "^2.1.1"
"@types/react-beautiful-dnd": "^13.1.2"
"@types/react-draft-wysiwyg": "^1.13.3"
Out of scope
I kept
d3
and@types/d3
at5.16.0
. It’s best to upgrade them to7.1.1
or newer in a separate PR to avoid possible disruption. Breaking changes:I also did not update to the very latest TypeScript version available (4.5.2). When running
yarn lint:eslint
, this message gets shown:We’ll use TS 4.4.4 for now. Upgrading to v4.5 will make sense when new syntax is supported by ESLint and Prettier.
On
package.json
→engines
Some dependencies like
lint-staged
v12 require Node v12+ (see https://github.com/okonet/lint-staged/releases/tag/v12.0.0). I've addedpackage.json
→engines
to avoid accidental script execution on Node 10 or below. Node 10 reached end of life in April 2021, so folks with older version need to upgrade their local setup. It’s not safe to run old unmaintained Node.js versions because they have known but unpatched vulnerabilities. See https://nodejs.org/en/about/releases/ for the list of actively maintained versions.On Next.js version
We usually stick with stable releases and avoid alphas / betas etc. to spend less time on fighting third-party bugs. At the time of creating this PR, the latest stable version of Next.js was
12.0.4
. Unfortunately, it did not have ESLint 8 support – see vercel/next.js#29865.When Next.js
12.0.5
or12.1.0
is released, we’ll replace12.0.5-canary.6
with a stable version.