Skip to content
This repository was archived by the owner on Apr 21, 2023. It is now read-only.

Commit 98b7904

Browse files
merging all conflicts
2 parents cf8b5e9 + 38bf76a commit 98b7904

File tree

866 files changed

+115918
-3145
lines changed

Some content is hidden

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

866 files changed

+115918
-3145
lines changed

.circleci/config.yml

-20
This file was deleted.

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
node_modules/*
22

3+
# Skip beta
4+
beta/*
5+
36
# Ignore markdown files and examples
47
content/*
58

.flowconfig

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[ignore]
22

3+
<PROJECT_ROOT>/beta/.*
34
<PROJECT_ROOT>/content/.*
45
<PROJECT_ROOT>/node_modules/.*
56
<PROJECT_ROOT>/public/.*

.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/reactjs.org/blob/main/CONTRIBUTING.md
88
99
If your PR references an existing issue, please add the issue number below
1010

.github/labeler.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
beta:
2+
- beta/**/*

.github/workflows/analyze.yml

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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+
with:
24+
working-directory: 'beta'
25+
26+
- name: Restore next build
27+
uses: actions/cache@v2
28+
id: restore-build-cache
29+
env:
30+
cache-name: cache-next-build
31+
with:
32+
path: beta/.next/cache
33+
# change this if you prefer a more strict cache
34+
key: ${{ runner.os }}-build-${{ env.cache-name }}
35+
36+
- name: Build next.js app
37+
# change this if your site requires a custom build command
38+
run: ./node_modules/.bin/next build
39+
working-directory: beta
40+
41+
# Here's the first place where next-bundle-analysis' own script is used
42+
# This step pulls the raw bundle stats for the current bundle
43+
- name: Analyze bundle
44+
run: npx -p nextjs-bundle-analysis report
45+
working-directory: beta
46+
47+
- name: Upload bundle
48+
uses: actions/upload-artifact@v2
49+
with:
50+
path: beta/.next/analyze/__bundle_analysis.json
51+
name: bundle_analysis.json
52+
53+
- name: Download base branch bundle stats
54+
uses: dawidd6/action-download-artifact@v2
55+
if: success() && github.event.number
56+
with:
57+
workflow: analyze.yml
58+
branch: ${{ github.event.pull_request.base.ref }}
59+
name: bundle_analysis.json
60+
path: beta/.next/analyze/base/bundle
61+
62+
# And here's the second place - this runs after we have both the current and
63+
# base branch bundle stats, and will compare them to determine what changed.
64+
# There are two configurable arguments that come from package.json:
65+
#
66+
# - budget: optional, set a budget (bytes) against which size changes are measured
67+
# it's set to 350kb here by default, as informed by the following piece:
68+
# https://infrequently.org/2021/03/the-performance-inequality-gap/
69+
#
70+
# - red-status-percentage: sets the percent size increase where you get a red
71+
# status indicator, defaults to 20%
72+
#
73+
# Either of these arguments can be changed or removed by editing the `nextBundleAnalysis`
74+
# entry in your package.json file.
75+
- name: Compare with base branch bundle
76+
if: success() && github.event.number
77+
run: ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare
78+
working-directory: beta
79+
80+
- name: Upload analysis comment
81+
uses: actions/upload-artifact@v2
82+
with:
83+
name: analysis_comment.txt
84+
path: beta/.next/analyze/__bundle_analysis_comment.txt
85+
86+
- name: Save PR number
87+
run: echo ${{ github.event.number }} > ./pr_number
88+
89+
- name: Upload PR number
90+
uses: actions/upload-artifact@v2
91+
with:
92+
name: pr_number
93+
path: ./pr_number
94+
95+
# The actual commenting happens in the other action, matching the guidance in
96+
# 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+
pr_number=$(cat pr_number/pr_number)
37+
body=$(cat analysis_comment.txt/__bundle_analysis_comment.txt)
38+
body="## Size Changes
39+
<details>
40+
41+
${body}
42+
43+
</details>"
44+
body="${body//'%'/'%25'}"
45+
body="${body//$'\n'/'%0A'}"
46+
body="${body//$'\r'/'%0D'}"
47+
echo ::set-output name=body::$body
48+
echo ::set-output name=pr-number::$pr_number
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/beta_site_lint.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Beta 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+
with:
26+
working-directory: 'beta'
27+
28+
29+
- name: Lint codebase
30+
run: cd beta && yarn ci-check

.github/workflows/label.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This workflow will triage pull requests and apply a label based on the
2+
# paths that are modified in the pull request.
3+
#
4+
# To use this workflow, you will need to set up a .github/labeler.yml
5+
# file with configuration. For more information, see:
6+
# https://github.com/actions/labeler
7+
8+
name: Labeler
9+
on: [pull_request_target]
10+
11+
jobs:
12+
label:
13+
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
pull-requests: write
18+
19+
steps:
20+
- uses: actions/labeler@v2
21+
with:
22+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/nodejs.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Lint / Flow 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

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
.DS_STORE
33
.idea
44
node_modules
5-
public
5+
/public
66
yarn-error.log

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12.16.1
1+
12.22.0

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This repo contains the source code and documentation powering [reactjs.org](http
88

99
1. Git
1010
1. Node: any 12.x version starting with v12.0.0 or greater
11-
1. Yarn: See [Yarn website for installation instructions](https://yarnpkg.com/lang/en/docs/install/)
11+
1. Yarn v1: See [Yarn website for installation instructions](https://yarnpkg.com/lang/en/docs/install/)
1212
1. A fork of the repo (for any contributions)
1313
1. A clone of the [reactjs.org repo](https://github.com/reactjs/reactjs.org) on your local machine
1414

@@ -26,12 +26,12 @@ This repo contains the source code and documentation powering [reactjs.org](http
2626

2727
### Guidelines
2828

29-
The documentation is divided into several sections with a different tone and purpose. If you plan to write more than a few sentences, you might find it helpful to get familiar with the [contributing guidelines](https://github.com/reactjs/reactjs.org/blob/master/CONTRIBUTING.md#guidelines-for-text) for the appropriate sections.
29+
The documentation is divided into several sections with a different tone and purpose. If you plan to write more than a few sentences, you might find it helpful to get familiar with the [contributing guidelines](https://github.com/reactjs/reactjs.org/blob/main/CONTRIBUTING.md#guidelines-for-text) for the appropriate sections.
3030

3131
### Create a branch
3232

33-
1. `git checkout master` from any folder in your local `reactjs.org` repository
34-
1. `git pull origin master` to ensure you have the latest main code
33+
1. `git checkout main` from any folder in your local `reactjs.org` repository
34+
1. `git pull origin main` to ensure you have the latest main code
3535
1. `git checkout -b the-name-of-my-branch` (replacing `the-name-of-my-branch` with a suitable name) to create a branch
3636

3737
### Make the change
@@ -53,11 +53,11 @@ The documentation is divided into several sections with a different tone and pur
5353
1. `git push my-fork-name the-name-of-my-branch`
5454
1. Go to the [reactjs.org repo](https://github.com/reactjs/reactjs.org) and you should see recently pushed branches.
5555
1. Follow GitHub's instructions.
56-
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.
56+
1. If possible, include screenshots of visual changes. A preview build is triggered after your changes are pushed to GitHub.
5757

5858
## Translation
5959

60-
If you are interested in translating `reactjs.org`, please see the current translation efforts at [isreacttranslatedyet.com](https://www.isreacttranslatedyet.com/).
60+
If you are interested in translating `reactjs.org`, please see the current translation efforts at [translations.reactjs.org](https://translations.reactjs.org/).
6161

6262

6363
If your language does not have a translation and you would like to create one, please follow the instructions at [reactjs.org Translations](https://github.com/reactjs/reactjs.org-translation#translating-reactjsorg).
@@ -67,4 +67,4 @@ If your language does not have a translation and you would like to create one, p
6767
- `yarn reset` to clear the local cache
6868

6969
## License
70-
Content submitted to [reactjs.org](https://reactjs.org/) is CC-BY-4.0 licensed, as found in the [LICENSE-DOCS.md](https://github.com/open-source-explorer/reactjs.org/blob/master/LICENSE-DOCS.md) file.
70+
Content submitted to [reactjs.org](https://reactjs.org/) is CC-BY-4.0 licensed, as found in the [LICENSE-DOCS.md](LICENSE-DOCS.md) file.

beta/.env.development

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

beta/.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

beta/.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
scripts
2+
plugins
3+
next.config.js

beta/.eslintrc

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"root": true,
3+
"extends": "next/core-web-vitals",
4+
"parser": "@typescript-eslint/parser",
5+
"plugins": ["@typescript-eslint"],
6+
"rules": {
7+
"no-unused-vars": "off",
8+
"@typescript-eslint/no-unused-vars": "warn"
9+
},
10+
"env": {
11+
"node": true,
12+
"commonjs": true,
13+
"browser": true,
14+
"es6": true
15+
}
16+
}

0 commit comments

Comments
 (0)