Skip to content

Commit 71e6f92

Browse files
adammockoriansusamuelmeuliLewis Lloberajxom
authored
Feat/cra update (#163)
* Publish - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] * Update runtime chunk name separator in docs (facebook#7705) * Remove 'shortcut' link type before 'icon' (facebook#7707) * Guard polyfills against window possibly being undefined (facebook#7205) * Enable .eslintignore with extend flag (facebook#7562) * Add "entrypoints" key to asset manifest (facebook#7721) * Update adding flow documentation (facebook#7731) * set output.globalObject to 'this' (facebook#7742) Closes facebook#7741 * Update logic and log errors for EXTEND_ESLINT (facebook#7530) * update list of supported jest config overrides (facebook#7601) * Upgrade Webpack version (facebook#7740) * Close br tags in template README files (facebook#7668) * Fix variable name casing in fileTransform (facebook#7752) * Documentation typo fix (facebook#7757) * Fix linting error when using rest props (facebook#7754) * Add TSC_COMPILE_ON_ERROR setting (facebook#6931) * Remove switch case (facebook#7729) * docs: note that v2 to v3 migration may require deletion of node_modules (facebook#7302) * Stop hiding the column number of ESLint errors (facebook#6980) * Support setting baseUrl to root directory (facebook#7755) * Use installing package manager in README (facebook#7687) * Support production profiling with React Developer Tools (facebook#7737) * Added the alias for profiling and output change to keep the classNames and functionNames for human readbility * defined isEnvProductionProfile with other isEnv checks * moved the keep_classnames and keep_fnames to terserOptions scope * resolve merge conflict for yarn.lock.cache * revert yarn.lock.cache to master yarn.lock.cache - git checkout origin/master -- packages/create-react-app/yarn.lock.cached * Comment and Boolean Check - I clarified the comment and specified the use case - Changed the environment check to check for the specific true rather than the assumed primitive value as before. * Replaced env with flag - Per suggestion --profile flag used instead of env variable PROFILE_APP * documentation in available scripts section with suggested information * resolved a local git issue. Fixed documentation error. * moved documentation to suggested file - Added a brief summary of profiling in available scripts section. The summary references the production-build document. Which is the file I moved the new documentation into under a new Header for production support. * Update production-build.md Co-authored-by: Ian Sutherland <[email protected]> * Prepare 3.2.0 release * Publish - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] * Temporarily disable Windows in CI (facebook#7773) * Add babel runtime version to transform-runtime plugin to reduce… (facebook#7726) * Add Babel sourcemap to resolve VSCode debugging issues (facebook#7022) * Fix process type in TypeScript template (facebook#7796) * Account for browserslist environment variables (facebook#7764) * Clarify dynamic import stage in docs (facebook#7813) * Update adding-typescript.md (facebook#7815) * Document how to use the .env file to enforce HTTPS (facebook#7821) * Fix absolute paths issue in Jest (facebook#7822) * Document correct default behavior for HOST var (facebook#7823) * Fix grammar error in troubleshooting.md (facebook#7824) * Upgrade to docusaurus 2 (facebook#7785) * chore: upgrade to docusaurus 2 * address review * Update doc publishing instructions * Revert logo in templates (facebook#7830) * feat: add additional Jest keys to whitelist (facebook#7832) * Link to React documentation for code splitting (facebook#7686) The official documentation offers a simpler way of achieving route based code splitting. * Add a note about .eslingignore files being respected (facebook#7809) * added check for typescript template and unsupported node version (facebook#7839) * added check for typescript template and unsupported node version * addressed code review feedback regarding syntax and spelling mistakes * Update getting-started.md (facebook#7841) Update the initial project structure generated by create-react-app. * Link to ASP.NET Core docs (facebook#7840) * Update readme gif links (facebook#7849) * Update adding-bootstrap.md (facebook#7853) typo fix * Move unused eslint webpack import into @remove-on-eject block (facebook#7856) * 📖 DOC: Improvement (facebook#7819) * Upgrade terser & enable parallel minification in wsl (facebook#7857) * Add a GitHub Action that runs the build script (facebook#7861) * Edit InterpolateHtmlPlugin hook (facebook#6448) (facebook#6449) * Fix notations of loopback addresses (facebook#7474) * Add Service-Worker header to checkValidServiceWorker (facebook#6753) * Add header to checkValidServiceWorker (ts) * Add header to checkValidServiceWorker * Add additional information for postcss errors (facebook#6282) (facebook#6352) * Add additional information for postcss errors * Add additional information for postcss errors (simplify) * Remove chunkname from postCSS compile error * Remove line number from postCSS compile error * Fix eslint complaints in build.js (facebook#7870) * Add Alex to lint documentation (facebook#7852) * Add Alex to lint documentation * Attempt to trigger GitHub Action * Configure Alex and update docs * More docs updates * Bump docusaurus 🦖 (facebook#7874) * Dark scheme overlay (facebook#7052) * Bump react (facebook#7875) * Bump styling related loaders (facebook#7876) * Remove alex precommit check (facebook#7878) * Add template support (facebook#7716) * Add template support * Update templates version check * Update TypeScript template README * Prepare 3.3.0 beta * If template name already starts with cra-template leave it alone (facebook#7880) * Update prerelease publishing instructions * Upgrade packages and tweak config to adapt to new config format (facebook#7814) Rebased again now with smaller changes in this one which will make it easier to revert in case of eventual regressions. * refactor: remove double coerce (facebook#7882) * Add yarn.lock to .gitignore (facebook#7789) * chore: Fix broken link for CRA deployment (facebook#7897) * chore: Fix broken link for e2e README (facebook#7896) * Add @testing-library to the default templates (facebook#7881) * Add numeric separator support (facebook#7817) * Update open (facebook#7910) * Mark TypeScript as an optional peer dependency (facebook#7860) * Add restoreMocks to supported jest config keys (facebook#7921) * fix seperators typo (facebook#7932) Its the little things that makes the big difference! 😁 Thanks * No spinning React logo if `prefers-reduced-motion` (facebook#7931) * Made PRs welcome badge point to contributors guide (facebook#7792) * Make JavaScript and TypeScript templates consistent (facebook#7944) * Fix CI (facebook#7951) * Add optional chaining and nullish coalescing operators support (facebook#7438) * Add tests for optional chaining and null coalescing (facebook#7952) * Upgrade jest-watch-typeahead (facebook#7956) * Fix light background in docusaurus night mode (facebook#7936) * Fix light background in docusaurus night mode Closes facebook#7930 * Rename lightBackground to gettingStartedSection * Add placeholders where old template READMEs used to be (facebook#7972) * Temporarily disable GitHub Actions (facebook#7978) * Prepare 3.3.0 beta * Bump dependencies (facebook#7986) * Support scoped templates (facebook#7991) * Add contributors section to readme (facebook#7995) * added e2e test for checking typescript template with unsupported node (facebook#7844) * Unpin dependencies in react-app-polyfill (facebook#7999) * Add scripts support to templates (facebook#7989) * Override no-unused-expressions with the typescript-eslint version (facebook#8003) Fixes issues with optional chaining * Prefix apple-touch-icon links with PUBLIC_URL. (facebook#8005) * Bump webpack-dev-server (facebook#7988) * Bump dependencies (facebook#8024) * Re-enable GitHub Actions (facebook#8029) * Update CHANGELOG * Update CODEOWNERS * Remove no-unexpected-multiline rule (facebook#8039) * Add TypeScript peer dependency to react-scripts (facebook#8038) * Update template docs (facebook#8050) * Update template docs * Update custom-templates.md * Update custom-templates.md Co-authored-by: Ian Sutherland <[email protected]> * Prepare 3.3.0 release * Update CHANGELOG * Publish - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] * webpackHotDev now uses wss when https is used (facebook#8079) * Add custom-templates to docs sidebar (facebook#8077) * Fix typo in CHANGELOG.md (facebook#8080) * fix Manifest entries * update react-scripts dependencies * add typesript-eslint to eslint-config peer depndencies Co-authored-by: Ian Sutherland <[email protected]> Co-authored-by: Samuel Meuli <[email protected]> Co-authored-by: Lewis Llobera <[email protected]> Co-authored-by: Jake Moxey <[email protected]> Co-authored-by: Iguchi Tomokatsu <[email protected]> Co-authored-by: Federico Zivolo <[email protected]> Co-authored-by: Kent C. Dodds <[email protected]> Co-authored-by: Laurin Quast <[email protected]> Co-authored-by: neilbryson <[email protected]> Co-authored-by: Reece Dunham <[email protected]> Co-authored-by: Rakan Nimer <[email protected]> Co-authored-by: Tomer Cohen <[email protected]> Co-authored-by: Alexandr Tovmach <[email protected]> Co-authored-by: Kyle Bebak <[email protected]> Co-authored-by: André Lins <[email protected]> Co-authored-by: Kim Persson <[email protected]> Co-authored-by: Justin Grant <[email protected]> Co-authored-by: Robert van Steen <[email protected]> Co-authored-by: Ashrith Reddy <[email protected]> Co-authored-by: Jacob M-G Evans <[email protected]> Co-authored-by: Ian Schmitz <[email protected]> Co-authored-by: Damian Senn <[email protected]> Co-authored-by: Róbert FUSZENECKER <[email protected]> Co-authored-by: May <[email protected]> Co-authored-by: Orta <[email protected]> Co-authored-by: Tomáš Hübelbauer <[email protected]> Co-authored-by: Jesse Jackson <[email protected]> Co-authored-by: Jake Boone <[email protected]> Co-authored-by: Endi <[email protected]> Co-authored-by: Brody McKee <[email protected]> Co-authored-by: Hugo David-Boyet <[email protected]> Co-authored-by: Sean Lafferty <[email protected]> Co-authored-by: Ali Waseem <[email protected]> Co-authored-by: reactjser <[email protected]> Co-authored-by: Daniel Lo Nigro <[email protected]> Co-authored-by: Chun <[email protected]> Co-authored-by: Xuhao <[email protected]> Co-authored-by: Sean Baines <[email protected]> Co-authored-by: Abdul Wahab ⚡️ <[email protected]> Co-authored-by: Guillaume Hertault <[email protected]> Co-authored-by: Wataru Ashihara <[email protected]> Co-authored-by: darthmaim <[email protected]> Co-authored-by: Joshua Robinson <[email protected]> Co-authored-by: Andreas Cederström <[email protected]> Co-authored-by: Fabiano Brito <[email protected]> Co-authored-by: Kanitkorn Sujautra <[email protected]> Co-authored-by: Havit Rovik <[email protected]> Co-authored-by: Tharun Rajendran <[email protected]> Co-authored-by: Dylan Staley <[email protected]> Co-authored-by: Donavon West <[email protected]> Co-authored-by: James George <[email protected]> Co-authored-by: RJ <[email protected]> Co-authored-by: Renato Augusto Gama dos Santos <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-authored-by: Alex Guerra <[email protected]> Co-authored-by: Klas Björkqvist <[email protected]> Co-authored-by: Max Davidson <[email protected]> Co-authored-by: Ben Blank <[email protected]> Co-authored-by: Mike Caulley <[email protected]> Co-authored-by: Trontor <[email protected]>
1 parent f73a619 commit 71e6f92

File tree

289 files changed

+12248
-10439
lines changed

Some content is hidden

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

289 files changed

+12248
-10439
lines changed

.alexignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build
2+
3+
CHANGELOG*
4+
CODE_OF_CONDUCT.md

.alexrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"allow": [
3+
"attacks",
4+
"colors",
5+
"conservative",
6+
"crashes",
7+
"executed",
8+
"executes",
9+
"execution",
10+
"failed",
11+
"hook",
12+
"host-hostess",
13+
"hostesses-hosts",
14+
"invalid",
15+
"remain",
16+
"watchman-watchwoman"
17+
]
18+
}

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
packages/ @bugzpodder @ianschmitz @iansu @mrmckeb @petetnt
1+
packages/ @ianschmitz @iansu @mrmckeb @petetnt
22
docusaurus/ @amyrlam @iansu

.github/workflows/build.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Build
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v1
10+
- name: Install
11+
run: yarn --no-progress --non-interactive --no-lockfile
12+
- name: Build
13+
run: yarn build

.github/workflows/lint.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Lint
2+
3+
on: [push]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v1
10+
- name: Install
11+
run: yarn --no-progress --non-interactive --no-lockfile
12+
- name: Alex
13+
run: yarn alex

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ yarn-debug.log*
1212
yarn-error.log*
1313
/.changelog
1414
.npm/
15+
yarn.lock

CHANGELOG-1.x.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,20 +1577,20 @@ Unhandled Promise rejections will now crash tests. You can fix them by explicitl
15771577
After the regular update procedure above, add these line to `<head>` in `public/index.html`:
15781578

15791579
```html
1580-
<meta name="theme-color" content="#000000">
1581-
<!--
1580+
<meta name="theme-color" content="#000000" />
1581+
<!--
15821582
manifest.json provides metadata used when your web app is added to the
15831583
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
15841584
-->
1585-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
1585+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
15861586
```
15871587

15881588
Add `<noscript>` to `<body>` in `public/index.html`:
15891589

15901590
```html
1591-
<noscript>
1592-
You need to enable JavaScript to run this app.
1593-
</noscript>
1591+
<noscript>
1592+
You need to enable JavaScript to run this app.
1593+
</noscript>
15941594
```
15951595

15961596
Then create a file called `public/manifest.json` that looks like this:

azure-pipelines-test-job.yml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,35 @@ parameters:
66
name: ''
77
testScript: ''
88
configurations:
9-
LinuxNode8: { vmImage: 'ubuntu-16.04', nodeVersion: 8.x }
10-
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
11-
WindowsNode8: { vmImage: 'vs2017-win2016', nodeVersion: 8.x }
12-
WindowsNode10: { vmImage: 'vs2017-win2016', nodeVersion: 10.x }
13-
9+
LinuxNode8: { vmImage: 'ubuntu-16.04', nodeVersion: 8.x }
10+
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
11+
# WindowsNode8: { vmImage: 'vs2017-win2016', nodeVersion: 8.x }
12+
# WindowsNode10: { vmImage: 'vs2017-win2016', nodeVersion: 10.x }
13+
1414
jobs:
15-
- job: ${{ parameters.name }}
16-
strategy:
17-
matrix:
18-
${{ insert }}: ${{ parameters.configurations }}
19-
pool:
20-
vmImage: $(vmImage)
21-
steps:
22-
- script: |
23-
git config --global core.autocrlf false
24-
git config --global user.name "Create React App"
25-
git config --global user.email "[email protected]"
26-
displayName: 'Initialize Git config'
15+
- job: ${{ parameters.name }}
16+
strategy:
17+
matrix:
18+
${{ insert }}: ${{ parameters.configurations }}
19+
pool:
20+
vmImage: $(vmImage)
21+
steps:
22+
- script: |
23+
git config --global core.autocrlf false
24+
git config --global user.name "Create React App"
25+
git config --global user.email "[email protected]"
26+
displayName: 'Initialize Git config'
2727
28-
- checkout: self
29-
path: create-react-app
28+
- checkout: self
29+
path: create-react-app
3030

31-
- task: NodeTool@0
32-
inputs:
33-
versionSpec: $(nodeVersion)
34-
displayName: 'Install Node.js'
31+
- task: NodeTool@0
32+
inputs:
33+
versionSpec: $(nodeVersion)
34+
displayName: 'Install Node.js'
3535

36-
- script: yarn --frozen-lockfile
37-
displayName: 'Run yarn'
36+
- script: yarn --frozen-lockfile
37+
displayName: 'Run yarn'
3838

39-
- bash: ${{ parameters.testScript }}
40-
displayName: 'Run tests'
39+
- bash: ${{ parameters.testScript }}
40+
displayName: 'Run tests'

azure-pipelines.yml

Lines changed: 67 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55
trigger:
6-
- master
6+
- master
77

88
variables:
99
CI: true
@@ -14,65 +14,79 @@ variables:
1414
VSTS_OVERWRITE_TEMP: True
1515
# Override Verdaccio package to use. This is temporary and is needed to avoid socket timeouts on hosted Windows agent (on Azure). This also changes Verdaccio to return a 503 (service unavailable) instead of a 404 (not found) when the connection to the uplink timesout.
1616
VERDACCIO_PACKAGE: https://github.com/willsmythe/verdaccio/releases/download/create-react-app/verdaccio-4.0.0-alpha.8.tgz
17+
CRA_INTERNAL_TEST: true
1718

1819
# ******************************************************************************
1920
# Simple test suite
2021
# ******************************************************************************
2122
jobs:
22-
- template: azure-pipelines-test-job.yml
23-
parameters:
24-
name: Simple
25-
testScript: tasks/e2e-simple.sh
23+
- template: azure-pipelines-test-job.yml
24+
parameters:
25+
name: Simple
26+
testScript: tasks/e2e-simple.sh
2627

27-
# ******************************************************************************
28-
# Installs test suite
29-
# ******************************************************************************
30-
- template: azure-pipelines-test-job.yml
31-
parameters:
32-
name: Installs
33-
testScript: tasks/e2e-installs.sh
28+
# ******************************************************************************
29+
# Installs test suite
30+
# ******************************************************************************
31+
- template: azure-pipelines-test-job.yml
32+
parameters:
33+
name: Installs
34+
testScript: tasks/e2e-installs.sh
3435

35-
# ******************************************************************************
36-
# Kitchensink test suite
37-
# ******************************************************************************
38-
- template: azure-pipelines-test-job.yml
39-
parameters:
40-
name: Kitchensink
41-
testScript: tasks/e2e-kitchensink.sh
36+
# ******************************************************************************
37+
# Kitchensink test suite
38+
# ******************************************************************************
39+
- template: azure-pipelines-test-job.yml
40+
parameters:
41+
name: Kitchensink
42+
testScript: tasks/e2e-kitchensink.sh
4243

43-
# ******************************************************************************
44-
# Kitchensink Eject test suite
45-
# ******************************************************************************
46-
- template: azure-pipelines-test-job.yml
47-
parameters:
48-
name: KitchensinkEject
49-
testScript: tasks/e2e-kitchensink-eject.sh
44+
# ******************************************************************************
45+
# Kitchensink Eject test suite
46+
# ******************************************************************************
47+
- template: azure-pipelines-test-job.yml
48+
parameters:
49+
name: KitchensinkEject
50+
testScript: tasks/e2e-kitchensink-eject.sh
5051

51-
# ******************************************************************************
52-
# Behavior test suite
53-
# ******************************************************************************
54-
- template: azure-pipelines-test-job.yml
55-
parameters:
56-
name: Behavior
57-
testScript: tasks/e2e-behavior.sh
58-
configurations:
59-
LinuxNode8: { vmImage: 'ubuntu-16.04', nodeVersion: 8.x }
60-
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
61-
WindowsNode8: { vmImage: 'vs2017-win2016', nodeVersion: 8.x }
62-
WindowsNode10: { vmImage: 'vs2017-win2016', nodeVersion: 10.x }
63-
MacNode8: { vmImage: 'macOS-10.13', nodeVersion: 8.x }
64-
MacNode10: { vmImage: 'macOS-10.13', nodeVersion: 10.x }
52+
# ******************************************************************************
53+
# Behavior test suite
54+
# ******************************************************************************
55+
- template: azure-pipelines-test-job.yml
56+
parameters:
57+
name: Behavior
58+
testScript: tasks/e2e-behavior.sh
59+
configurations:
60+
LinuxNode8: { vmImage: 'ubuntu-16.04', nodeVersion: 8.x }
61+
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
62+
# WindowsNode8: { vmImage: 'vs2017-win2016', nodeVersion: 8.x }
63+
# WindowsNode10: { vmImage: 'vs2017-win2016', nodeVersion: 10.x }
64+
MacNode8: { vmImage: 'macOS-10.13', nodeVersion: 8.x }
65+
MacNode10: { vmImage: 'macOS-10.13', nodeVersion: 10.x }
6566

66-
# ******************************************************************************
67-
# Old Node test suite
68-
# ******************************************************************************
69-
- job: OldNode
70-
pool:
71-
vmImage: ubuntu-16.04
72-
steps:
73-
- task: NodeTool@0
74-
inputs:
75-
versionSpec: 6.x
76-
displayName: 'Install Node.js 6.x'
77-
- bash: tasks/e2e-old-node.sh
78-
displayName: 'Run tests'
67+
# ******************************************************************************
68+
# Old Node test suite
69+
# ******************************************************************************
70+
- job: OldNode
71+
pool:
72+
vmImage: ubuntu-16.04
73+
steps:
74+
- task: NodeTool@0
75+
inputs:
76+
versionSpec: 6.x
77+
displayName: 'Install Node.js 6.x'
78+
- bash: tasks/e2e-old-node.sh
79+
displayName: 'Run tests'
80+
# ******************************************************************************
81+
# Unsupported Node with TypeScript flag
82+
# ******************************************************************************
83+
- job: UnsupportedNodeWithTypeScript
84+
pool:
85+
vmImage: ubuntu-16.04
86+
steps:
87+
- task: NodeTool@0
88+
inputs:
89+
versionSpec: 8.9.x
90+
displayName: 'Install Node.js 8.9.x'
91+
- bash: tasks/e2e-typescript-unsupported-node.sh
92+
displayName: 'Run unsupported TypeScript test'

docusaurus/docs/adding-bootstrap.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ import 'bootstrap/dist/css/bootstrap.css';
2929

3030
> Note: this feature is available with `[email protected]` and higher.
3131
32-
Sometimes you might need to tweak the visual styles of Bootstrap (or equivalent package).<br>
32+
Sometimes you might need to tweak the visual styles of Bootstrap (or equivalent package).
33+
3334
As of `[email protected]` you can import `.scss` files. This makes it possible to use a package's built-in Sass variables for global style preferences.
3435

3536
To enable `scss` in Create React App you will need to install `node-sass`.
@@ -38,7 +39,7 @@ To enable `scss` in Create React App you will need to install `node-sass`.
3839
npm install --save node-sass
3940
```
4041

41-
Alternatively you may use `yarn`::
42+
Alternatively you may use `yarn`:
4243

4344
```sh
4445
yarn add node-sass

docusaurus/docs/adding-custom-environment-variables.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ Your project can consume variables declared in your environment as if they were
1212
>
1313
> Environment variables are embedded into the build, meaning anyone can view them by inspecting your app's files.
1414
15-
**The environment variables are embedded during the build time**. Since Create React App produces a static HTML/CSS/JS bundle, it can’t possibly read them at runtime. To read them at runtime, you would need to load HTML into memory on the server and replace placeholders in runtime, just like [described here](title-and-meta-tags.md#injecting-data-from-the-server-into-the-page). Alternatively you can rebuild the app on the server anytime you change them.
15+
**The environment variables are embedded during the build time**. Since Create React App produces a static HTML/CSS/JS bundle, it can’t possibly read them at runtime. To read them at runtime, you would need to load HTML into memory on the server and replace placeholders in runtime, as [described here](title-and-meta-tags.md#injecting-data-from-the-server-into-the-page). Alternatively you can rebuild the app on the server anytime you change them.
1616

1717
> Note: You must create custom environment variables beginning with `REACT_APP_`. Any other variables except `NODE_ENV` will be ignored to avoid accidentally [exposing a private key on the machine that could have the same name](https://github.com/facebook/create-react-app/issues/865#issuecomment-252199527). Changing any environment variables will require you to restart the development server if it is running.
1818
1919
These environment variables will be defined for you on `process.env`. For example, having an environment variable named `REACT_APP_NOT_SECRET_CODE` will be exposed in your JS as `process.env.REACT_APP_NOT_SECRET_CODE`.
2020

21-
There is also a special built-in environment variable called `NODE_ENV`. You can read it from `process.env.NODE_ENV`. When you run `npm start`, it is always equal to `'development'`, when you run `npm test` it is always equal to `'test'`, and when you run `npm run build` to make a production bundle, it is always equal to `'production'`. **You cannot override `NODE_ENV` manually.** This prevents developers from accidentally deploying a slow development build to production.
21+
There is also a built-in environment variable called `NODE_ENV`. You can read it from `process.env.NODE_ENV`. When you run `npm start`, it is always equal to `'development'`, when you run `npm test` it is always equal to `'test'`, and when you run `npm run build` to make a production bundle, it is always equal to `'production'`. **You cannot override `NODE_ENV` manually.** This prevents developers from accidentally deploying a slow development build to production.
2222

2323
These environment variables can be useful for displaying information conditionally based on where the project is deployed or consuming sensitive data that lives outside of version control.
2424

@@ -136,7 +136,8 @@ Files on the left have more priority than files on the right:
136136
- `npm run build`: `.env.production.local`, `.env.production`, `.env.local`, `.env`
137137
- `npm test`: `.env.test.local`, `.env.test`, `.env` (note `.env.local` is missing)
138138

139-
These variables will act as the defaults if the machine does not explicitly set them.<br>
139+
These variables will act as the defaults if the machine does not explicitly set them.
140+
140141
Please refer to the [dotenv documentation](https://github.com/motdotla/dotenv) for more details.
141142

142143
> Note: If you are defining environment variables for development, your CI and/or hosting platform will most likely need

docusaurus/docs/adding-flow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ make sure to add the following line to your `.flowconfig` to make Flow aware of
2222

2323
```diff
2424
[options]
25-
+ module.name_mapper='^\(.*\)$' -> '<PROJECT_ROOT>/src/\1'
25+
+ module.name_mapper='^\([^\.].*\)$' -> '<PROJECT_ROOT>/src/\1'
2626
```
2727

2828
To learn more about Flow, check out [its documentation](https://flow.org/).

docusaurus/docs/adding-images-fonts-and-files.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ This works in CSS too:
3535
}
3636
```
3737

38-
Webpack finds all relative module references in CSS (they start with `./`) and replaces them with the final paths from the compiled bundle. If you make a typo or accidentally delete an important file, you will see a compilation error, just like when you import a non-existent JavaScript module. The final filenames in the compiled bundle are generated by Webpack from content hashes. If the file content changes in the future, Webpack will give it a different name in production so you don’t need to worry about long-term caching of assets.
38+
Webpack finds all relative module references in CSS (they start with `./`) and replaces them with the final paths from the compiled bundle. If you make a typo or accidentally delete an important file, you will see a compilation error, like when you import a non-existent JavaScript module. The final filenames in the compiled bundle are generated by Webpack from content hashes. If the file content changes in the future, Webpack will give it a different name in production so you don’t need to worry about long-term caching of assets.
3939

4040
Please be advised that this is also a custom feature of Webpack.
4141

42-
**It is not required for React** but many people enjoy it (and React Native uses a similar mechanism for images).<br>
42+
**It is not required for React** but many people enjoy it (and React Native uses a similar mechanism for images).
43+
4344
An alternative way of handling static assets is described in the next section.
4445

4546
## Adding SVGs
@@ -58,6 +59,6 @@ const App = () => (
5859
);
5960
```
6061

61-
This is handy if you don't want to load SVG as a separate file. Don't forget the curly braces in the import! The `ReactComponent` import name is special and tells Create React App that you want a React component that renders an SVG, rather than its filename.
62+
This is handy if you don't want to load SVG as a separate file. Don't forget the curly braces in the import! The `ReactComponent` import name is significant and tells Create React App that you want a React component that renders an SVG, rather than its filename.
6263

63-
> **Tip:** The imported SVG React Component accepts a `title` prop along with other props that a `svg` element accepts. Use this prop to add an accessbile title to your svg component.
64+
> **Tip:** The imported SVG React Component accepts a `title` prop along with other props that a `svg` element accepts. Use this prop to add an accessible title to your svg component.

docusaurus/docs/adding-relay.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: adding-relay
33
title: Adding Relay
44
---
55

6-
Relay is a framework for building data-driven React applications powered by GraphQL. The current release of Relay works with Create React App projects out of the box using Babel Macros. Simply set up your project as laid out in the [Relay documentation](https://facebook.github.io/relay/), then make sure you have a version of the babel plugin providing the macro.
6+
Relay is a framework for building data-driven React applications powered by GraphQL. The current release of Relay works with Create React App projects out of the box using Babel Macros. Set up your project as shown in the [Relay documentation](https://facebook.github.io/relay/), then make sure you have a version of the babel plugin providing the macro.
77

88
To add it, run:
99

0 commit comments

Comments
 (0)