Skip to content

Commit ee21698

Browse files
authored
Merge branch 'main' into scaling-up-with-reducer-and-context
2 parents 0a3281c + 49f53fe commit ee21698

File tree

109 files changed

+4210
-4473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+4210
-4473
lines changed

.github/workflows/analyze.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
node-version: "14.x"
2020

2121
- name: Install dependencies
22-
uses: bahmutov/npm-install@v1.6.0
22+
uses: bahmutov/npm-install@v1.7.10
2323
with:
2424
working-directory: 'beta'
2525

@@ -54,7 +54,7 @@ jobs:
5454
uses: dawidd6/action-download-artifact@v2
5555
if: success() && github.event.number
5656
with:
57-
workflow: bundle_analysis_upload.yml
57+
workflow: analyze.yml
5858
branch: ${{ github.event.pull_request.base.ref }}
5959
name: bundle_analysis.json
6060
path: beta/.next/analyze/base/bundle

.github/workflows/beta_site_lint.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
name: Beta Site Lint
1+
name: Beta Site Lint / Heading ID check
22

33
on:
4+
push:
5+
branches:
6+
- main # change this if your default branch is named differently
47
pull_request:
58
types: [opened, synchronize, reopened]
69

@@ -18,7 +21,7 @@ jobs:
1821
node-version: 12.x
1922

2023
- name: Install deps and build (with cache)
21-
uses: bahmutov/npm-install@v1.6.0
24+
uses: bahmutov/npm-install@v1.7.10
2225
with:
2326
working-directory: 'beta'
2427

.github/workflows/nodejs.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
name: Build
1+
name: Lint / Flow check
22

33
on:
4+
push:
5+
branches:
6+
- main # change this if your default branch is named differently
47
pull_request:
58
types: [opened, synchronize, reopened]
69

@@ -18,7 +21,7 @@ jobs:
1821
node-version: 12.x
1922

2023
- name: Install deps and build (with cache)
21-
uses: bahmutov/npm-install@v1.6.0
24+
uses: bahmutov/npm-install@v1.7.10
2225

2326
- name: Lint codebase
2427
run: yarn ci-check

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ The documentation is divided into several sections with a different tone and pur
141141
1. `git push my-fork-name the-name-of-my-branch`
142142
1. Go to the [reactjs.org repo](https://github.com/reactjs/reactjs.org) and you should see recently pushed branches.
143143
1. Follow GitHub's instructions.
144-
1. If possible, include screenshots of visual changes. A [Netlify](https://www.netlify.com/) build will also be automatically created once you make your PR so other people can see your change.
144+
1. If possible, include screenshots of visual changes. A preview build is triggered after your changes are pushed to GitHub.
145145

146146
## Translation
147147

beta/.env.production

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
NEXT_PUBLIC_HJ_SITE_ID = 2411651
2-
NEXT_PUBLIC_HJ_SITE_V = 6
2+
NEXT_PUBLIC_HJ_SITE_V = 6
3+
NEXT_PUBLIC_GA_TRACKING_ID = 'G-3918VS75Y6'

beta/.husky/pre-commit

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,4 @@
22
. "$(dirname "$0")/_/husky.sh"
33

44
cd beta
5-
# yarn generate-ids
6-
# git add -u src/pages/**/*.md
7-
yarn prettier
8-
yarn lint:fix
5+
yarn lint-staged

beta/.prettierrc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,19 @@
33
"singleQuote": true,
44
"bracketSameLine": true,
55
"trailingComma": "es5",
6-
"printWidth": 80
6+
"printWidth": 80,
7+
"overrides": [
8+
{
9+
"files": "*.css",
10+
"options": {
11+
"parser": "css"
12+
}
13+
},
14+
{
15+
"files": "*.md",
16+
"options": {
17+
"parser": "mdx"
18+
}
19+
}
20+
]
721
}

beta/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The documentation is divided into sections to cater to different learning styles
2020

2121
**[Learn React](https://beta.reactjs.org/learn)** is designed to introduce fundamental concepts in a step-by-step way. Each individual article in Learn React builds on the knowledge from the previous ones, so make sure not to add any "cyclical dependencies" between them. It is important that the reader can start with the first article and work their way to the last Learn React article without ever having to "look ahead" for a definition. This explains some ordering choices (e.g. that state is explained before events, or that "thinking in React" doesn't use refs). Learn React also serves as a reference manual for React concepts, so it is important to be very strict about their definitions and relationships between them.
2222

23-
**[API Reference](https://reactjs.org/reference)** is organized by APIs rather than concepts. It is intended to be exhaustive. Any corner cases or recommendations that were skipped for brevity in Learn React should be mentioned in the reference documentation for the corresponding APIs.
23+
**[API Reference](https://reactjs.org/apis)** is organized by APIs rather than concepts. It is intended to be exhaustive. Any corner cases or recommendations that were skipped for brevity in Learn React should be mentioned in the reference documentation for the corresponding APIs.
2424

2525
**Try to follow your own instructions.**
2626

beta/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The documentation is divided into several sections with a different tone and pur
5656
1. `git push my-fork-name the-name-of-my-branch`
5757
1. Go to the [reactjs.org repo](https://github.com/reactjs/reactjs.org) and you should see recently pushed branches.
5858
1. Follow GitHub's instructions.
59-
1. If possible, include screenshots of visual changes. A [Netlify](https://www.netlify.com/) build will also be automatically created once you make your PR so other people can see your change.
59+
1. If possible, include screenshots of visual changes. A preview build is triggered after your changes are pushed to GitHub.
6060

6161
## Translation
6262

beta/next-env.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/// <reference types="next" />
2-
/// <reference types="next/types/global" />
32
/// <reference types="next/image-types/global" />
43

54
// NOTE: This file should not be edited

beta/next.config.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ module.exports = {
1717
async redirects() {
1818
return redirects.redirects;
1919
},
20-
env: {
21-
// @todo Remove when https://github.com/vercel/next.js/pull/16529 lands
22-
GA_TRACKING_ID: 'XXXX',
23-
NEXT_PUBLIC_GA_TRACKING_ID: 'XXX',
24-
},
2520
rewrites() {
2621
return [
2722
{

beta/package.json

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,37 @@
66
"scripts": {
77
"analyze": "ANALYZE=true next build",
88
"dev": "next",
9-
"build": "next build && node ./scripts/generateRSS.js",
9+
"build": "next build && node ./scripts/generateRSS.js && node ./scripts/generateRedirects.js",
1010
"lint": "next lint",
1111
"lint:fix": "next lint --fix",
12-
"format:source": "prettier --config .prettierrc --write \"{plugins,src}/**/*.{js,ts,jsx,tsx}\"",
13-
"nit:source": "prettier --config .prettierrc --list-different \"{plugins,src}/**/*.{js,ts,jsx,tsx}\"",
12+
"format:source": "prettier --config .prettierrc --write \"{plugins,src}/**/*.{js,ts,jsx,tsx,css}\"",
13+
"nit:source": "prettier --config .prettierrc --list-different \"{plugins,src}/**/*.{js,ts,jsx,tsx,css}\"",
1414
"prettier": "yarn format:source",
1515
"prettier:diff": "yarn nit:source",
16-
"generate-ids": "node scripts/generateHeadingIDs.js src/pages/",
17-
"ci-check": "npm-run-all prettier:diff --parallel lint tsc",
16+
"lint-heading-ids": "node scripts/headingIdLinter.js",
17+
"fix-headings": "node scripts/headingIdLinter.js --fix",
18+
"ci-check": "npm-run-all prettier:diff --parallel lint tsc lint-heading-ids",
1819
"tsc": "tsc --noEmit",
1920
"start": "next start",
2021
"postinstall": "is-ci || (cd .. && husky install beta/.husky)",
2122
"check-all": "npm-run-all prettier lint:fix tsc"
2223
},
2324
"dependencies": {
24-
"@codesandbox/sandpack-react": "^0.1.20",
25+
"@codesandbox/sandpack-react": "0.13.11-experimental.0",
2526
"@docsearch/css": "3.0.0-alpha.41",
2627
"@docsearch/react": "3.0.0-alpha.41",
2728
"@headlessui/react": "^1.3.0",
2829
"@mdx-js/react": "^1.6.16",
29-
"@next/plugin-google-analytics": "^10.0.6",
3030
"body-scroll-lock": "^3.1.3",
3131
"classnames": "^2.2.6",
3232
"date-fns": "^2.16.1",
3333
"debounce": "^1.2.1",
3434
"github-slugger": "^1.3.0",
35-
"next": "^12.0.3-canary.2",
35+
"next": "^12.0.9",
3636
"parse-numeric-range": "^1.2.0",
37-
"react": "18.0.0-alpha-930c9e7ee-20211015",
37+
"react": "experimental",
3838
"react-collapsed": "3.1.0",
39-
"react-dom": "18.0.0-alpha-930c9e7ee-20211015",
39+
"react-dom": "experimental",
4040
"scroll-into-view-if-needed": "^2.2.25"
4141
},
4242
"devDependencies": {
@@ -67,13 +67,14 @@
6767
"gray-matter": "^4.0.2",
6868
"husky": "^7.0.4",
6969
"is-ci": "^3.0.1",
70+
"lint-staged": ">=10",
7071
"mdast-util-to-string": "^1.1.0",
7172
"npm-run-all": "^4.1.5",
7273
"patch-package": "^6.2.2",
7374
"postcss": "^8.3.6",
7475
"postcss-flexbugs-fixes": "4.2.1",
7576
"postcss-preset-env": "^6.7.0",
76-
"prettier": "^2.1.1",
77+
"prettier": "^2.5.1",
7778
"reading-time": "^1.2.0",
7879
"remark": "^12.0.1",
7980
"remark-external-links": "^7.0.0",
@@ -96,5 +97,9 @@
9697
"budget": null,
9798
"budgetPercentIncreaseRed": 10,
9899
"showDetails": true
100+
},
101+
"lint-staged": {
102+
"*.{js,ts,jsx,tsx,css}": "yarn prettier",
103+
"src/**/*.md": "yarn fix-headings"
99104
}
100105
}

beta/patches/@next+plugin-google-analytics+9.5.2.patch

Lines changed: 0 additions & 35 deletions
This file was deleted.

beta/plugins/md-layout-loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = async function (src) {
2323
const layoutMap = {
2424
blog: 'Post',
2525
learn: 'Learn',
26-
reference: 'API',
26+
apis: 'API',
2727
};
2828
const layout = layoutMap[pageParentDir] || 'Home';
2929
const code =

beta/scripts/generateHeadingIDs.js

Lines changed: 0 additions & 108 deletions
This file was deleted.

0 commit comments

Comments
 (0)