Skip to content

Commit 705a2d0

Browse files
committed
Limit contributor cleanup to factual corrections
1 parent a3f85fe commit 705a2d0

7 files changed

Lines changed: 30 additions & 37 deletions

File tree

‎.github/workflows/analyze.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ jobs:
1818
- name: Set up node
1919
uses: actions/setup-node@v4
2020
with:
21-
node-version-file: .nvmrc
21+
node-version: '20.x'
2222
cache: yarn
2323
cache-dependency-path: yarn.lock
2424

2525
- name: Restore cached node_modules
2626
uses: actions/cache@v4
2727
with:
2828
path: '**/node_modules'
29-
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('.nvmrc', 'yarn.lock') }}
29+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
3030

3131
- name: Install deps
3232
run: yarn install --frozen-lockfile

‎.github/workflows/site_lint.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ jobs:
1313
lint:
1414
runs-on: ubuntu-latest
1515

16-
name: Lint on Node.js 24.x and ubuntu-latest
16+
name: Lint on node 20.x and ubuntu-latest
1717

1818
steps:
1919
- uses: actions/checkout@v4
20-
- name: Use Node.js from .nvmrc
20+
- name: Use Node.js 20.x
2121
uses: actions/setup-node@v4
2222
with:
23-
node-version-file: .nvmrc
23+
node-version: 20.x
2424
cache: yarn
2525
cache-dependency-path: yarn.lock
2626

2727
- name: Restore cached node_modules
2828
uses: actions/cache@v4
2929
with:
3030
path: '**/node_modules'
31-
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('.nvmrc', 'yarn.lock') }}
31+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
3232

3333
- name: Install deps
3434
run: yarn install --frozen-lockfile

‎.nvmrc‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎CLAUDE.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code when working with this repository.
44

55
## Project Overview
66

7-
This is the React documentation website (react.dev), built with Next.js and React. See `package.json` for dependency versions and `.nvmrc` for the Node.js version used in development and CI. Documentation is written in MDX format.
7+
This is the React documentation website (react.dev), built with Next.js 15.1.12 and React 19. Documentation is written in MDX format.
88

99
## Development Commands
1010

@@ -13,7 +13,6 @@ yarn build # Production build
1313
yarn lint # Run ESLint
1414
yarn lint:fix # Auto-fix lint issues
1515
yarn tsc # TypeScript type checking
16-
yarn ci-check # Run the same validation checks as CI
1716
yarn check-all # Run prettier, lint:fix, tsc, and rss together
1817
```
1918

@@ -48,6 +47,6 @@ When editing files in `src/content/`, the appropriate skill will be auto-suggest
4847
For MDX components (DeepDive, Pitfall, Note, etc.), invoke `/docs-components`.
4948
For Sandpack code examples, invoke `/docs-sandpack`.
5049

51-
See `.claude/skills/docs-voice/SKILL.md` for shared writing conventions, and the `docs-writer-learn`, `docs-writer-reference`, and `docs-writer-blog` skills for page-specific guidance.
50+
See `.claude/skills/` for comprehensive style guidelines.
5251

5352
Prettier is used for formatting (config in `.prettierrc`).

‎CONTRIBUTING.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ Ignore this if you're specifically describing `createElement`.
3838

3939
Ignore this if you're specifically writing about ES5.
4040

41-
#### Prefer readable JavaScript.
41+
#### Don't use ES6 features when equivalent ES5 features have no downsides.
4242

43-
Use modern JavaScript when it makes an example clearer. Prefer named `function` declarations for components and top-level functions. Use arrow functions for inline callbacks where they improve readability.
43+
While we use ES6 in many places (`const` / `let`, classes, arrow functions), if the equivalent ES5 code is just as straightforward and readable, consider using it.
4444

45-
#### Don't use features that aren't standardized yet.
45+
In particular, you should prefer named `function` declarations over `const myFunction = () => ...` arrows for top-level functions. However, you *should* use arrow functions where they provide a tangible improvement (such as preserving `this` context inside a component). Consider both sides of the tradeoff when deciding whether to use a new feature.
4646

47-
Use standardized JavaScript features in examples. Class fields are standardized and may be used when documenting class components. Prefer function components and Hooks for new examples, unless the page documents a class-specific API.
47+
#### Don't use features that aren't standardized yet.
4848

49-
If you're specifically describing an experimental proposal, mention its experimental nature in the code and surrounding text.
49+
Ignore this rule if you're specifically describing an experimental proposal. Make sure to mention its experimental nature in the code and in the surrounding text.
5050

5151
### Style
5252

‎README.md‎

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,20 @@ This repo contains the source code and documentation powering [react.dev](https:
77
### Prerequisites
88

99
1. Git
10-
1. Node.js 24.x (LTS), matching [`.nvmrc`](./.nvmrc) and CI
11-
1. Yarn Classic 1.22.22: See the [installation instructions](https://classic.yarnpkg.com/en/docs/install/)
10+
1. Node: v18.18.0 or greater (see supported versions in [`package.json`](./package.json))
11+
1. Yarn Classic 1.22.22: See [Yarn website for installation instructions](https://classic.yarnpkg.com/en/docs/install/)
12+
1. A fork of the repo (for any contributions)
13+
1. A clone of your fork of the [react.dev repo](https://github.com/reactjs/react.dev) on your local machine
1214

1315
### Installation
1416

15-
1. [Fork the repo](https://github.com/reactjs/react.dev/fork), then clone your fork. Replace `YOUR_USERNAME` with your GitHub username:
16-
17-
```bash
18-
git clone https://github.com/YOUR_USERNAME/react.dev.git
19-
cd react.dev
20-
git remote add upstream https://github.com/reactjs/react.dev.git
21-
```
22-
23-
1. `yarn install --frozen-lockfile` to install the website's dependencies
17+
1. `cd react.dev` to go into the project root
18+
3. `yarn` to install the website's npm dependencies
2419

2520
### Running locally
2621

2722
1. `yarn dev` to start the development server (powered by [Next.js](https://nextjs.org/))
28-
1. Open [http://localhost:3000](http://localhost:3000) in your browser
23+
1. `open http://localhost:3000` to open the site in your favorite browser
2924

3025
## Contributing
3126

@@ -35,36 +30,36 @@ The documentation is divided into several sections with a different tone and pur
3530

3631
### Create a branch
3732

33+
1. `git remote add upstream https://github.com/reactjs/react.dev.git` to add the source repo as a remote (only needed once)
3834
1. `git checkout main` from any folder in your local `react.dev` repository
39-
1. `git fetch upstream` to get the latest changes from the source repo
40-
1. `git merge --ff-only upstream/main` to update your local `main`
35+
1. `git pull --ff-only upstream main` to ensure you have the latest main code
4136
1. `git checkout -b the-name-of-my-branch` (replacing `the-name-of-my-branch` with a suitable name) to create a branch
4237

4338
### Make the change
4439

4540
1. Follow the ["Running locally"](#running-locally) instructions
4641
1. Save the files and check in the browser
47-
1. Changes to React components in `src` will hot-reload
48-
1. Changes to Markdown files in `src/content` will hot-reload
49-
1. If changes to MDX plugins aren't reflected, stop the server, remove `node_modules/.cache/react-docs-mdx`, and restart it
42+
1. Changes to React components in `src` will hot-reload
43+
1. Changes to markdown files in `src/content` will hot-reload
44+
1. If working with plugins, you may need to remove the `node_modules/.cache/react-docs-mdx` directory and restart the server
5045

5146
### Test the change
5247

5348
1. If possible, test any visual changes in all latest versions of common browsers, on both desktop and mobile.
54-
1. Run `yarn ci-check` to run the same checks as CI: formatting, ESLint, local ESLint rule tests, TypeScript, heading IDs, RSS generation, and internal links.
55-
1. To apply formatting and ESLint fixes, run `yarn check-all`. This command modifies files and also checks types and generates RSS. Review the resulting changes before committing.
49+
2. Run `yarn check-all`. (This will apply Prettier and ESLint fixes, validate types, and generate RSS.)
50+
3. Run `yarn ci-check` to run the same checks as CI.
5651

5752
### Push it
5853

5954
1. `git add -A && git commit -m "My message"` (replacing `My message` with a commit message, such as `Fix header logo on Android`) to stage and commit your changes
60-
1. `git push -u origin the-name-of-my-branch` to push the branch to your fork
55+
1. `git push origin the-name-of-my-branch`
6156
1. Go to the [react.dev repo](https://github.com/reactjs/react.dev) and you should see recently pushed branches.
6257
1. Follow GitHub's instructions.
6358
1. If possible, include screenshots of visual changes. A preview build is triggered after your changes are pushed to GitHub.
6459

6560
## Translation
6661

67-
If you are interested in translating `react.dev`, see the [translation guide](https://react.dev/community/translations) and [current translation progress](https://translations.react.dev/).
62+
If you are interested in translating `react.dev`, please see the current translation efforts [here](https://react.dev/community/translations).
6863

6964
## License
7065
Content submitted to [react.dev](https://react.dev/) is CC-BY-4.0 licensed, as found in the [LICENSE-DOCS.md](https://github.com/reactjs/react.dev/blob/main/LICENSE-DOCS.md) file.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
"webpack-bundle-analyzer": "^4.5.0"
112112
},
113113
"engines": {
114-
"node": ">=24.0.0"
114+
"node": "^18.18.0 || ^19.8.0 || >=20.0.0"
115115
},
116116
"nextBundleAnalysis": {
117117
"budget": null,

0 commit comments

Comments
 (0)