Skip to content

Commit 80a4d4c

Browse files
committed
Merge branch 'facebook-main'
2 parents a465fa8 + 39430a1 commit 80a4d4c

File tree

84 files changed

+8838
-1562
lines changed

Some content is hidden

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

84 files changed

+8838
-1562
lines changed

.eslintignore

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
node_modules/
2-
build
3-
my-app*
4-
packages/react-scripts/template
5-
packages/react-scripts/fixtures
6-
fixtures/
2+
build/
3+
test/fixtures/webpack-message-formatting/src/AppBabel.js
4+
packages/react-error-overlay/lib/

.eslintrc.json

+35-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,39 @@
1414
"no-console": "off",
1515
"strict": ["error", "global"],
1616
"curly": "warn"
17-
}
17+
},
18+
"overrides": [
19+
{
20+
"files": [
21+
"docusaurus/website/src/**/*.js",
22+
"packages/cra-template/**/*.js",
23+
"packages/react-error-overlay/**/*.js",
24+
"packages/react-scripts/fixtures/kitchensink/template/{src,integration}/**/*.js",
25+
"test/fixtures/*/src/*.js"
26+
],
27+
"excludedFiles": ["packages/react-error-overlay/*.js"],
28+
"extends": ["react-app", "react-app/jest"]
29+
},
30+
{
31+
"files": [
32+
"test/fixtures/webpack-message-formatting/src/{AppLintError,AppLintWarning,AppUnknownFile}.js"
33+
],
34+
"rules": {
35+
"no-unused-vars": "off",
36+
"no-undef": "off"
37+
}
38+
},
39+
{
40+
"files": ["test/fixtures/webpack-message-formatting/src/Export5.js"],
41+
"rules": {
42+
"import/no-anonymous-default-export": "off"
43+
}
44+
},
45+
{
46+
"files": ["test/fixtures/issue-5176-flow-class-properties/src/App.js"],
47+
"rules": {
48+
"no-dupe-class-members": "off"
49+
}
50+
}
51+
]
1852
}

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Build
22

3-
on: [push]
3+
on: [push, pull_request]
44

55
jobs:
66
build:

.github/workflows/lint.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Lint
22

3-
on: [push]
3+
on: [push, pull_request]
44

55
jobs:
66
lint:
@@ -15,5 +15,11 @@ jobs:
1515
run: npm i -g npm@8
1616
- name: Install
1717
run: npm ci --prefer-offline
18+
- name: Build
19+
run: npm run build
1820
- name: Alex
1921
run: npm run alex
22+
- name: Prettier
23+
run: npm run prettier -- --list-different
24+
- name: Eslint
25+
run: npm run eslint -- --max-warnings 0

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.idea/
22
.vscode/
33
node_modules/
4-
build
4+
build/
55
.DS_Store
66
*.tgz
77
my-app*

.prettierignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
build/
2+
package-lock.json
3+
test/fixtures/webpack-message-formatting/src/AppBabel.js
4+
test/fixtures/webpack-message-formatting/src/AppCss.css
5+
packages/react-error-overlay/fixtures/bundle*
6+
packages/react-error-overlay/fixtures/inline*
7+
packages/react-error-overlay/fixtures/junk*
8+
packages/react-error-overlay/lib/
9+
packages/react-error-overlay/coverage/

CHANGELOG-4.x.md

+503
Large diffs are not rendered by default.

CHANGELOG.md

+149-415
Large diffs are not rendered by default.

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Create React App is a great fit for:
171171

172172
Here are a few common cases where you might want to try something else:
173173

174-
- If you want to **try React** without hundreds of transitive build tool dependencies, consider [using a single HTML file or an online sandbox instead](https://reactjs.org/docs/try-react.html).
174+
- If you want to **try React** without hundreds of transitive build tool dependencies, consider [using a single HTML file or an online sandbox instead](https://reactjs.org/docs/getting-started.html#try-react).
175175

176176
- If you need to **integrate React code with a server-side template framework** like Rails, Django or Symfony, or if you’re **not building a single-page app**, consider using [nwb](https://github.com/insin/nwb), or [Neutrino](https://neutrino.js.org/) which are more flexible. For Rails specifically, you can use [Rails Webpacker](https://github.com/rails/webpacker). For Symfony, try [Symfony's webpack Encore](https://symfony.com/doc/current/frontend/encore/reactjs.html).
177177

@@ -185,7 +185,7 @@ Here are a few common cases where you might want to try something else:
185185

186186
All of the above tools can work with little to no configuration.
187187

188-
If you prefer configuring the build yourself, [follow this guide](https://reactjs.org/docs/add-react-to-an-existing-app.html).
188+
If you prefer configuring the build yourself, [follow this guide](https://reactjs.org/docs/add-react-to-a-website.html).
189189

190190
## React Native
191191

docusaurus/docs/adding-a-router.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ id: adding-a-router
33
title: Adding a Router
44
---
55

6-
Create React App doesn't prescribe a specific routing solution, but [React Router](https://reacttraining.com/react-router/web/) is the most popular one.
6+
Create React App doesn't prescribe a specific routing solution, but [React Router](https://reactrouter.com/) is the most popular one.
77

88
To add it, run:
99

1010
```sh
11-
npm install --save react-router-dom
11+
npm install react-router-dom
1212
```
1313

1414
Alternatively you may use `yarn`:
@@ -17,6 +17,6 @@ Alternatively you may use `yarn`:
1717
yarn add react-router-dom
1818
```
1919

20-
To try it, delete all the code in `src/App.js` and replace it with any of the examples on its website. The [Basic Example](https://reacttraining.com/react-router/web/example/basic) is a good place to get started.
20+
To try it, delete all the code in `src/App.js` and replace it with any of the examples on its website. The [Basic Example](https://reactrouter.com/docs/examples/basic) is a good place to get started. For more info on adding routes, check out [the React Router docs on adding routes](https://reactrouter.com/docs/getting-started/tutorial#add-some-routes).
2121

2222
Note that [you may need to configure your production server to support client-side routing](deployment.md#serving-apps-with-client-side-routing) before deploying your app.

docusaurus/docs/adding-typescript.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ To start a new Create React App project with [TypeScript](https://www.typescript
1313

1414
```sh
1515
npx create-react-app my-app --template typescript
16+
```
1617

17-
# or
18+
or
1819

20+
```sh
1921
yarn create react-app my-app --template typescript
2022
```
2123

@@ -27,13 +29,17 @@ To add [TypeScript](https://www.typescriptlang.org/) to an existing Create React
2729

2830
```sh
2931
npm install --save typescript @types/node @types/react @types/react-dom @types/jest
32+
```
3033

31-
# or
34+
or
3235

36+
```sh
3337
yarn add typescript @types/node @types/react @types/react-dom @types/jest
3438
```
3539

36-
Next, rename any file to be a TypeScript file (e.g. `src/index.js` to `src/index.tsx`) and **restart your development server**!
40+
Next, rename any file to be a TypeScript file (e.g. `src/index.js` to `src/index.tsx`) and create tsconfig.json if it's not in the root of your project [`tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html).
41+
42+
Finally **restart your development server**!
3743

3844
Type errors will show up in the same console as the build one. You'll have to fix these type errors before you continue development or build your project. For advanced configuration, [see here](advanced-configuration.md).
3945

docusaurus/docs/advanced-configuration.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You can adjust various development and production settings by setting environmen
1515
| PORT | ✅ Used | 🚫 Ignored | By default, the development web server will attempt to listen on port 3000 or prompt you to attempt the next available port. You may use this variable to specify a different port. |
1616
| HTTPS | ✅ Used | 🚫 Ignored | When set to `true`, Create React App will run the development server in `https` mode. |
1717
| WDS_SOCKET_HOST | ✅ Used | 🚫 Ignored | When set, Create React App will run the development server with a custom websocket hostname for hot module reloading. Normally, `webpack-dev-server` defaults to `window.location.hostname` for the SockJS hostname. You may use this variable to start local development on more than one Create React App project at a time. See [webpack-dev-server documentation](https://webpack.js.org/configuration/dev-server/#devserversockhost) for more details. |
18-
| WDS_SOCKET_PATH | ✅ Used | 🚫 Ignored | When set, Create React App will run the development server with a custom websocket path for hot module reloading. Normally, `webpack-dev-server` defaults to `/ws` for the SockJS pathname. You may use this variable to start local development on more than one Create React App project at a time. See [webpack-dev-server documentation](https://webpack.js.org/configuration/dev-server/#devserversockpath) for more details. |
18+
| WDS_SOCKET_PATH | ✅ Used | 🚫 Ignored | When set, Create React App will run the development server with a custom websocket path for hot module reloading. Normally, `webpack-dev-server` defaults to `/ws` for the SockJS pathname. You may use this variable to start local development on more than one Create React App project at a time. See [webpack-dev-server documentation](https://webpack.js.org/configuration/dev-server/#devserversockpath) for more details. |
1919
| WDS_SOCKET_PORT | ✅ Used | 🚫 Ignored | When set, Create React App will run the development server with a custom websocket port for hot module reloading. Normally, `webpack-dev-server` defaults to `window.location.port` for the SockJS port. You may use this variable to start local development on more than one Create React App project at a time. See [webpack-dev-server documentation](https://webpack.js.org/configuration/dev-server/#devserversockport) for more details. |
2020
| PUBLIC_URL | ✅ Used | ✅ Used | Create React App assumes your application is hosted at the serving web server's root or a subpath as specified in [`package.json` (`homepage`)](deployment#building-for-relative-paths). Normally, Create React App ignores the hostname. You may use this variable to force assets to be referenced verbatim to the url you provide (hostname included). This may be particularly useful when using a CDN to host your application. |
2121
| BUILD_PATH | 🚫 Ignored | ✅ Used | By default, Create React App will output compiled assets to a `/build` directory adjacent to your `/src`. You may use this variable to specify a new path for Create React App to output assets. BUILD_PATH should be specified as a path relative to the root of your project. |
@@ -24,7 +24,7 @@ You can adjust various development and production settings by setting environmen
2424
| CHOKIDAR_USEPOLLING | ✅ Used | 🚫 Ignored | When set to `true`, the watcher runs in polling mode, as necessary inside a VM. Use this option if `npm start` isn't detecting changes. |
2525
| GENERATE_SOURCEMAP | 🚫 Ignored | ✅ Used | When set to `false`, source maps are not generated for a production build. This solves out of memory (OOM) issues on some smaller machines. |
2626
| INLINE_RUNTIME_CHUNK | 🚫 Ignored | ✅ Used | By default, Create React App will embed the runtime script into `index.html` during the production build. When set to `false`, the script will not be embedded and will be imported as usual. This is normally required when dealing with CSP. |
27-
| IMAGE_INLINE_SIZE_LIMIT | ✅ Used | ✅ Used | By default, images smaller than 10,000 bytes are encoded as a data URI in base64 and inlined in the CSS or JS build artifact. Set this to control the size limit in bytes. Setting it to `0` will disable the inlining of images. |
27+
| IMAGE_INLINE_SIZE_LIMIT | ✅ Used | ✅ Used | By default, images smaller than 10,000 bytes are encoded as a data URI in base64 and inlined in the CSS or JS build artifact. Set this to control the size limit in bytes. Setting it to `0` will disable the inlining of images. |
2828
| FAST_REFRESH | ✅ Used | 🚫 Ignored | When set to `false`, disables experimental support for Fast Refresh to allow you to tweak your components in real time without reloading the page. |
2929
| TSC_COMPILE_ON_ERROR | ✅ Used | ✅ Used | When set to `true`, you can run and properly build TypeScript projects even if there are TypeScript type check errors. These errors are printed as warnings in the terminal and/or browser console. |
3030
| ESLINT_NO_DEV_ERRORS | ✅ Used | 🚫 Ignored | When set to `true`, ESLint errors are converted to warnings during development. As a result, ESLint output will no longer appear in the error overlay. |

docusaurus/docs/deployment.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,13 @@ The `predeploy` script will run automatically before `deploy` is run.
318318
If you are deploying to a GitHub user page instead of a project page you'll need to make one
319319
additional modification:
320320

321-
1. Tweak your `package.json` scripts to push deployments to **master**:
321+
1. Tweak your `package.json` scripts to push deployments to **main**:
322322

323323
```diff
324324
"scripts": {
325325
"predeploy": "npm run build",
326326
- "deploy": "gh-pages -d build",
327-
+ "deploy": "gh-pages -b master -d build",
327+
+ "deploy": "gh-pages -b main -d build",
328328
```
329329
330330
### Step 3: Deploy the site by running `npm run deploy`
@@ -378,7 +378,7 @@ If, when deploying, you get `Cannot read property 'email' of null`, try the foll
378378
379379
## [Heroku](https://www.heroku.com/)
380380
381-
Use the [Heroku Buildpack for Create React App](https://github.com/mars/create-react-app-buildpack).
381+
Use the [Heroku Buildpack for Create React App](https://github.com/heroku/heroku-buildpack-nodejs).
382382
383383
You can find instructions in [Deploying React with Zero Configuration](https://blog.heroku.com/deploying-react-with-zero-configuration).
384384
@@ -464,7 +464,7 @@ If you want to use a Custom Domain with your Vercel deployment, you can **Add**
464464
465465
To add your domain to your project, navigate to your [Project](https://vercel.com/docs/platform/projects) from the Vercel Dashboard. Once you have selected your project, click on the "Settings" tab, then select the **Domains** menu item. From your projects **Domain** page, enter the domain you wish to add to your project.
466466
467-
Once the domain as been added, you will be presented with different methods for configuring it.
467+
Once the domain has been added, you will be presented with different methods for configuring it.
468468
469469
### Deploying a fresh React project
470470

0 commit comments

Comments
 (0)