ScottishCovidResponse / rampvis-ui

This is a React based RAMP VIS visualisation interface. This client uses the REST API: https://github.com/ScottishCovidResponse/rampvis-api
BSD 2-Clause "Simplified" License
7 stars 6 forks source link

Upgrade project dependencies and remove unused ones #120

Closed kachkaev closed 2 years ago

kachkaev commented 2 years ago

To create this PR, I ran npx npm-check-updates -u, then deleted yarn.lock and ran yarn 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:

Out of scope

I kept d3 and @types/d3 at 5.16.0. It’s best to upgrade them to 7.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:

=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.5.0

YOUR TYPESCRIPT VERSION: 4.5.2

Please only submit bug reports when using the officially supported version.

=============

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.jsonengines

Some dependencies like lint-staged v12 require Node v12+ (see https://github.com/okonet/lint-staged/releases/tag/v12.0.0). I've added package.jsonengines 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 https://github.com/vercel/next.js/pull/29865.

When Next.js 12.0.5 or 12.1.0 is released, we’ll replace 12.0.5-canary.6 with a stable version.

netlify[bot] commented 2 years ago

✔️ Deploy Preview for rampvis-ui-development ready!

🔨 Explore the source changes: 1d801c971eb645cdf34e8bd447283c5c3f845239

🔍 Inspect the deploy log: https://app.netlify.com/sites/rampvis-ui-development/deploys/61996bbb2a311500083f7a7e

😎 Browse the preview: https://deploy-preview-120--rampvis-ui-development.netlify.app