From 87c4d17726ce060519d4170d00e645ac988a03a3 Mon Sep 17 00:00:00 2001 From: Dusan Ralic Date: Mon, 8 Nov 2021 21:53:25 +0100 Subject: [PATCH] Update upgrading.md (#31173) Include required steps for the latest React and Next.js version upgrade via npm/yarn. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint` --- docs/upgrading.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/upgrading.md b/docs/upgrading.md index 15281fdcbb26..f53b2b6930b0 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -10,6 +10,34 @@ description: Learn how to upgrade Next.js. The minimum Node.js version has been bumped from 12.0.0 to 12.22.0 which is the first version of Node.js with native ES Modules support. +### Upgrade React version to latest + +To upgrade you can run the following command: + +``` +npm install react@latest react-dom@latest +``` + +Or using `yarn`: + +``` +yarn add react@latest react-dom@latest +``` + +### Upgrade Next.js version to 12 + +To upgrade you can run the following command in the terminal: + +``` +npm install next@12 +``` + +or + +``` +yarn add next@12 +``` + ### SWC replacing Babel Next.js now uses Rust-based compiler [SWC](https://swc.rs/) to compile JavaScript/TypeScript. This new compiler is up to 17x faster than Babel when compiling individual files and up to 5x faster Fast Refresh.