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

Upgrade project dependencies and remove unused ones #120

Merged
merged 4 commits into from Nov 20, 2021

Conversation

kachkaev
Copy link
Collaborator

@kachkaev kachkaev commented Nov 20, 2021

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:

  • "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 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 vercel/next.js#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
Copy link

netlify bot commented Nov 20, 2021

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

🔨 Explore the source changes: 1d801c9

🔍 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

@kachkaev kachkaev marked this pull request as ready for review November 20, 2021 21:49
@saifulkhan saifulkhan merged commit 5d1551b into nextjs-migrate Nov 20, 2021
@saifulkhan saifulkhan deleted the upgrade-dependencies-2021-11-20 branch November 20, 2021 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants