Skip to content

Commit a3f85fe

Browse files
committed
Refresh contributor setup and validation guidance
1 parent 2e6dca1 commit a3f85fe

8 files changed

Lines changed: 37 additions & 54 deletions

File tree

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ contact_links:
33
url: https://github.com/react/react/issues/new/choose
44
about: This issue tracker is not for bugs in React. Please file React issues here.
55
- name: 🤔 Questions and Help
6-
url: https://reactjs.org/community/support.html
6+
url: https://react.dev/community
77
about: This issue tracker is not for support questions. Please refer to the React community's help and discussion forums.

‎.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: '20.x'
21+
node-version-file: .nvmrc
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('yarn.lock') }}
29+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('.nvmrc', '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 20.x and ubuntu-latest
16+
name: Lint on Node.js 24.x and ubuntu-latest
1717

1818
steps:
1919
- uses: actions/checkout@v4
20-
- name: Use Node.js 20.x
20+
- name: Use Node.js from .nvmrc
2121
uses: actions/setup-node@v4
2222
with:
23-
node-version: 20.x
23+
node-version-file: .nvmrc
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('yarn.lock') }}
31+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('.nvmrc', 'yarn.lock') }}
3232

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

‎.nvmrc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

‎CLAUDE.md‎

Lines changed: 3 additions & 2 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 15.1.11 and React 19. Documentation is written in MDX format.
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.
88

99
## Development Commands
1010

@@ -13,6 +13,7 @@ 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
1617
yarn check-all # Run prettier, lint:fix, tsc, and rss together
1718
```
1819

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

50-
See `.claude/docs/react-docs-patterns.md` for comprehensive style guidelines.
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.
5152

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

‎CONTRIBUTING.md‎

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

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

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

43-
Remember that ES6 is still new to a lot of people. While we use it in many places (`const` / `let`, classes, arrow functions), if the equivalent ES5 code is just as straightforward and readable, consider using it.
44-
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.
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.
4644

4745
#### Don't use features that aren't standardized yet.
4846

49-
For example, **don't** write this:
50-
51-
```js
52-
class MyComponent extends React.Component {
53-
state = {value: ''};
54-
handleChange = (e) => {
55-
this.setState({value: e.target.value});
56-
};
57-
}
58-
```
59-
60-
Instead, **do** write this:
61-
62-
```js
63-
class MyComponent extends React.Component {
64-
constructor(props) {
65-
super(props);
66-
this.handleChange = this.handleChange.bind(this);
67-
this.state = {value: ''};
68-
}
69-
handleChange(e) {
70-
this.setState({value: e.target.value});
71-
}
72-
}
73-
```
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.
7448

75-
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.
49+
If you're specifically describing an experimental proposal, mention its experimental nature in the code and surrounding text.
7650

7751
### Style
7852

‎README.md‎

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

99
1. Git
10-
1. Node: any version starting with v16.8.0 or greater
11-
1. Yarn: See [Yarn website for installation instructions](https://yarnpkg.com/lang/en/docs/install/)
12-
1. A fork of the repo (for any contributions)
13-
1. A clone of the [react.dev repo](https://github.com/reactjs/react.dev) on your local machine
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/)
1412

1513
### Installation
1614

17-
1. `cd react.dev` to go into the project root
18-
3. `yarn` to install the website's npm dependencies
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
1924

2025
### Running locally
2126

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

2530
## Contributing
2631

@@ -31,33 +36,35 @@ The documentation is divided into several sections with a different tone and pur
3136
### Create a branch
3237

3338
1. `git checkout main` from any folder in your local `react.dev` repository
34-
1. `git pull origin main` to ensure you have the latest main code
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`
3541
1. `git checkout -b the-name-of-my-branch` (replacing `the-name-of-my-branch` with a suitable name) to create a branch
3642

3743
### Make the change
3844

3945
1. Follow the ["Running locally"](#running-locally) instructions
4046
1. Save the files and check in the browser
41-
1. Changes to React components in `src` will hot-reload
42-
1. Changes to markdown files in `content` will hot-reload
43-
1. If working with plugins, you may need to remove the `.cache` directory and restart the server
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
4450

4551
### Test the change
4652

4753
1. If possible, test any visual changes in all latest versions of common browsers, on both desktop and mobile.
48-
2. Run `yarn check-all`. (This will run Prettier, ESLint and validate types.)
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.
4956

5057
### Push it
5158

5259
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
53-
1. `git push my-fork-name the-name-of-my-branch`
60+
1. `git push -u origin the-name-of-my-branch` to push the branch to your fork
5461
1. Go to the [react.dev repo](https://github.com/reactjs/react.dev) and you should see recently pushed branches.
5562
1. Follow GitHub's instructions.
5663
1. If possible, include screenshots of visual changes. A preview build is triggered after your changes are pushed to GitHub.
5764

5865
## Translation
5966

60-
If you are interested in translating `react.dev`, please see the current translation efforts [here](https://github.com/reactjs/react.dev/issues/4135).
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/).
6168

6269
## License
6370
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": ">=16.8.0"
114+
"node": ">=24.0.0"
115115
},
116116
"nextBundleAnalysis": {
117117
"budget": null,

0 commit comments

Comments
 (0)