Skip to content

Commit 760be6d

Browse files
authored
Merge pull request #216 from reactjs/merge-react-dev
Merge latest react.dev
2 parents 61df3d1 + 1923f98 commit 760be6d

File tree

1,103 files changed

+100332
-64712
lines changed

Some content is hidden

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

1,103 files changed

+100332
-64712
lines changed

.babelrc

-41
This file was deleted.

.circleci/config.yml

-20
This file was deleted.

.env.development

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SANDPACK_BARE_COMPONENTS=true

.env.production

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
NEXT_PUBLIC_GA_TRACKING_ID = 'UA-41298772-4'
2+
SANDPACK_BARE_COMPONENTS=true

.eslintignore

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
node_modules/*
2-
3-
# Ignore markdown files and examples
4-
content/*
5-
6-
# Ignore built files
7-
public/*
8-
9-
# Ignore examples
10-
examples/*
1+
scripts
2+
plugins
3+
next.config.js

.eslintrc

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
{
2-
"extends": [
3-
"fbjs"
4-
],
5-
"plugins": [
6-
"prettier",
7-
"react"
8-
],
9-
"parser": "babel-eslint",
2+
"root": true,
3+
"extends": "next/core-web-vitals",
4+
"parser": "@typescript-eslint/parser",
5+
"plugins": ["@typescript-eslint"],
106
"rules": {
11-
"relay/graphql-naming": 0,
12-
"max-len": 0
7+
"no-unused-vars": "off",
8+
"@typescript-eslint/no-unused-vars": "warn"
139
},
1410
"env": {
1511
"node": true,
16-
"browser": true
12+
"commonjs": true,
13+
"browser": true,
14+
"es6": true
1715
}
1816
}

.flowconfig

-35
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Thank you for the PR! Contributors like you keep React awesome!
44
55
Please see the Contribution Guide for guidelines:
66
7-
https://github.com/reactjs/reactjs.org/blob/master/CONTRIBUTING.md
7+
https://github.com/reactjs/react.dev/blob/main/CONTRIBUTING.md
88
99
If your PR references an existing issue, please add the issue number below
1010

.github/dependabot.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
# Disable Dependabot. Doing it here so it propagates to translation forks.
8+
open-pull-requests-limit: 0

.github/workflows/analyze.yml

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Analyze Bundle
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main # change this if your default branch is named differently
8+
workflow_dispatch:
9+
10+
jobs:
11+
analyze:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Set up node
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: "14.x"
20+
21+
- name: Install dependencies
22+
uses: bahmutov/[email protected]
23+
24+
- name: Restore next build
25+
uses: actions/cache@v2
26+
id: restore-build-cache
27+
env:
28+
cache-name: cache-next-build
29+
with:
30+
path: .next/cache
31+
# change this if you prefer a more strict cache
32+
key: ${{ runner.os }}-build-${{ env.cache-name }}
33+
34+
- name: Build next.js app
35+
# change this if your site requires a custom build command
36+
run: ./node_modules/.bin/next build
37+
38+
# Here's the first place where next-bundle-analysis' own script is used
39+
# This step pulls the raw bundle stats for the current bundle
40+
- name: Analyze bundle
41+
run: npx -p nextjs-bundle-analysis report
42+
43+
- name: Upload bundle
44+
uses: actions/upload-artifact@v2
45+
with:
46+
path: .next/analyze/__bundle_analysis.json
47+
name: bundle_analysis.json
48+
49+
- name: Download base branch bundle stats
50+
uses: dawidd6/action-download-artifact@v2
51+
if: success() && github.event.number
52+
with:
53+
workflow: analyze.yml
54+
branch: ${{ github.event.pull_request.base.ref }}
55+
name: bundle_analysis.json
56+
path: .next/analyze/base/bundle
57+
58+
# And here's the second place - this runs after we have both the current and
59+
# base branch bundle stats, and will compare them to determine what changed.
60+
# There are two configurable arguments that come from package.json:
61+
#
62+
# - budget: optional, set a budget (bytes) against which size changes are measured
63+
# it's set to 350kb here by default, as informed by the following piece:
64+
# https://infrequently.org/2021/03/the-performance-inequality-gap/
65+
#
66+
# - red-status-percentage: sets the percent size increase where you get a red
67+
# status indicator, defaults to 20%
68+
#
69+
# Either of these arguments can be changed or removed by editing the `nextBundleAnalysis`
70+
# entry in your package.json file.
71+
- name: Compare with base branch bundle
72+
if: success() && github.event.number
73+
run: ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare
74+
75+
- name: Upload analysis comment
76+
uses: actions/upload-artifact@v2
77+
with:
78+
name: analysis_comment.txt
79+
path: .next/analyze/__bundle_analysis_comment.txt
80+
81+
- name: Save PR number
82+
run: echo ${{ github.event.number }} > ./pr_number
83+
84+
- name: Upload PR number
85+
uses: actions/upload-artifact@v2
86+
with:
87+
name: pr_number
88+
path: ./pr_number
89+
90+
# The actual commenting happens in the other action, matching the guidance in
91+
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/

.github/workflows/analyze_comment.yml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Analyze Bundle (Comment)
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Analyze Bundle"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
comment:
11+
runs-on: ubuntu-latest
12+
if: >
13+
${{ github.event.workflow_run.event == 'pull_request' &&
14+
github.event.workflow_run.conclusion == 'success' }}
15+
steps:
16+
- name: Download base branch bundle stats
17+
uses: dawidd6/action-download-artifact@v2
18+
with:
19+
workflow: analyze.yml
20+
run_id: ${{ github.event.workflow_run.id }}
21+
name: analysis_comment.txt
22+
path: analysis_comment.txt
23+
24+
- name: Download PR number
25+
uses: dawidd6/action-download-artifact@v2
26+
with:
27+
workflow: analyze.yml
28+
run_id: ${{ github.event.workflow_run.id }}
29+
name: pr_number
30+
path: pr_number
31+
32+
- name: Get comment body
33+
id: get-comment-body
34+
if: success()
35+
run: |
36+
echo 'body<<EOF' >> $GITHUB_OUTPUT
37+
echo '' >> $GITHUB_OUTPUT
38+
echo '## Size changes' >> $GITHUB_OUTPUT
39+
echo '' >> $GITHUB_OUTPUT
40+
echo '<details>' >> $GITHUB_OUTPUT
41+
echo '' >> $GITHUB_OUTPUT
42+
cat analysis_comment.txt/__bundle_analysis_comment.txt >> $GITHUB_OUTPUT
43+
echo '' >> $GITHUB_OUTPUT
44+
echo '</details>' >> $GITHUB_OUTPUT
45+
echo '' >> $GITHUB_OUTPUT
46+
echo 'EOF' >> $GITHUB_OUTPUT
47+
pr_number=$(cat pr_number/pr_number)
48+
echo "pr-number=$pr_number" >> $GITHUB_OUTPUT
49+
50+
- name: Find Comment
51+
uses: peter-evans/find-comment@v1
52+
if: success()
53+
id: fc
54+
with:
55+
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
56+
body-includes: "<!-- __NEXTJS_BUNDLE -->"
57+
58+
- name: Create Comment
59+
uses: peter-evans/[email protected]
60+
if: success() && steps.fc.outputs.comment-id == 0
61+
with:
62+
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
63+
body: ${{ steps.get-comment-body.outputs.body }}
64+
65+
- name: Update Comment
66+
uses: peter-evans/[email protected]
67+
if: success() && steps.fc.outputs.comment-id != 0
68+
with:
69+
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
70+
body: ${{ steps.get-comment-body.outputs.body }}
71+
comment-id: ${{ steps.fc.outputs.comment-id }}
72+
edit-mode: replace

.github/workflows/site_lint.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Site Lint / Heading ID check
2+
3+
on:
4+
push:
5+
branches:
6+
- main # change this if your default branch is named differently
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
14+
name: Lint on node 12.x and ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v1
18+
- name: Use Node.js 12.x
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 12.x
22+
23+
- name: Install deps and build (with cache)
24+
uses: bahmutov/[email protected]
25+
26+
- name: Lint codebase
27+
run: yarn ci-check

0 commit comments

Comments
 (0)