Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/cra update #163

Merged
merged 118 commits into from
Jan 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
6a2a61a
Merge commit 'dc74990b89b5c6e143b522c759be3dac2c286514' into upstream
adammockor Oct 23, 2018
e40a6bc
Merge branch 'master' of github.com:facebook/create-react-app into up…
adammockor Nov 17, 2018
16211f4
Merge remote-tracking branch 'upstream/master' into upstream
adammockor Sep 8, 2019
a825e8f
Publish
iansu Sep 19, 2019
0dc69ec
Update runtime chunk name separator in docs (#7705)
samuelmeuli Sep 19, 2019
05f7924
Remove 'shortcut' link type before 'icon' (#7707)
lewislbr Sep 20, 2019
b1e6155
Guard polyfills against window possibly being undefined (#7205)
jxom Sep 24, 2019
6f5221c
Enable .eslintignore with extend flag (#7562)
igtm Sep 24, 2019
93150c5
Add "entrypoints" key to asset manifest (#7721)
samuelmeuli Sep 24, 2019
0d1775e
Update adding flow documentation (#7731)
FezVrasta Sep 25, 2019
42ee721
set output.globalObject to 'this' (#7742)
Sep 26, 2019
6533a6d
Update logic and log errors for EXTEND_ESLINT (#7530)
n1ru4l Sep 27, 2019
e624b75
update list of supported jest config overrides (#7601)
neilbryson Sep 27, 2019
4a3718b
Upgrade Webpack version (#7740)
RDIL Sep 30, 2019
c0d73ba
Close br tags in template README files (#7668)
rakannimer Sep 30, 2019
fefd716
Fix variable name casing in fileTransform (#7752)
lewislbr Sep 30, 2019
a10223d
Documentation typo fix (#7757)
tomer Sep 30, 2019
6f7b371
Fix linting error when using rest props (#7754)
alexandrtovmach Oct 1, 2019
71946b1
Add TSC_COMPILE_ON_ERROR setting (#6931)
kylebebak Oct 1, 2019
f36d61a
Remove switch case (#7729)
andrelmlins Oct 1, 2019
6980616
docs: note that v2 to v3 migration may require deletion of node_modul…
kimpers Oct 1, 2019
85aac9b
Stop hiding the column number of ESLint errors (#6980)
justingrant Oct 1, 2019
7e2b6b1
Support setting baseUrl to root directory (#7755)
robertvansteen Oct 2, 2019
6b8fa00
Use installing package manager in README (#7687)
ashr81 Oct 2, 2019
a8c379f
Merge remote-tracking branch 'upstream/master' into upstream
adammockor Oct 2, 2019
88cf8cd
Support production profiling with React Developer Tools (#7737)
JacobMGEvans Oct 3, 2019
6a74342
Prepare 3.2.0 release
iansu Oct 3, 2019
7fae307
Publish
iansu Oct 3, 2019
e51ea13
Temporarily disable Windows in CI (#7773)
ianschmitz Oct 3, 2019
ac93f31
Add babel runtime version to transform-runtime plugin to reduce… (#7726)
topaxi Oct 6, 2019
09cbb89
Add Babel sourcemap to resolve VSCode debugging issues (#7022)
justingrant Oct 10, 2019
9161ba8
Fix process type in TypeScript template (#7796)
fuszenecker Oct 10, 2019
f06ae8b
Account for browserslist environment variables (#7764)
Oct 11, 2019
c8ca307
Clarify dynamic import stage in docs (#7813)
aprilandjan Oct 13, 2019
dc4d62d
Update adding-typescript.md (#7815)
orta Oct 14, 2019
ab41c4c
Document how to use the .env file to enforce HTTPS (#7821)
TomasHubelbauer Oct 14, 2019
889df8e
Fix absolute paths issue in Jest (#7822)
robertvansteen Oct 14, 2019
4a4ae1e
Document correct default behavior for HOST var (#7823)
jsejcksn Oct 15, 2019
81c48dc
Fix grammar error in troubleshooting.md (#7824)
jakeboone02 Oct 15, 2019
9243305
Upgrade to docusaurus 2 (#7785)
endiliey Oct 15, 2019
b4068f2
Update doc publishing instructions
iansu Oct 15, 2019
584e352
Revert logo in templates (#7830)
iansu Oct 16, 2019
2da645c
feat: add additional Jest keys to whitelist (#7832)
mrmckeb Oct 16, 2019
ca37609
Link to React documentation for code splitting (#7686)
Hugodby Oct 16, 2019
053f977
Add a note about .eslingignore files being respected (#7809)
seanlaff Oct 16, 2019
4b024e9
added check for typescript template and unsupported node version (#7839)
awaseem Oct 17, 2019
ce968a9
Update getting-started.md (#7841)
reactjser Oct 18, 2019
07470fd
Link to ASP.NET Core docs (#7840)
Daniel15 Oct 19, 2019
da06c23
Update readme gif links (#7849)
cchanxzy Oct 20, 2019
9455ec5
Update adding-bootstrap.md (#7853)
Xuhao Oct 21, 2019
f337acc
Move unused eslint webpack import into @remove-on-eject block (#7856)
mrseanbaines Oct 21, 2019
9d00fce
📖 DOC: Improvement (#7819)
waahab Oct 21, 2019
7690af5
Upgrade terser & enable parallel minification in wsl (#7857)
endiliey Oct 21, 2019
9788522
Add a GitHub Action that runs the build script (#7861)
iansu Oct 22, 2019
42140e5
Edit InterpolateHtmlPlugin hook (#6448) (#6449)
GuiHash Oct 23, 2019
5ea3b34
Fix notations of loopback addresses (#7474)
wataash Oct 23, 2019
ea34c1d
Add Service-Worker header to checkValidServiceWorker (#6753)
darthmaim Oct 23, 2019
a351750
Add additional information for postcss errors (#6282) (#6352)
buildbreakdo Oct 23, 2019
4582491
Fix eslint complaints in build.js (#7870)
andriijas Oct 24, 2019
1d03579
Add Alex to lint documentation (#7852)
iansu Oct 24, 2019
a51729c
Bump docusaurus 🦖 (#7874)
andriijas Oct 24, 2019
c24314d
Dark scheme overlay (#7052)
Fabianopb Oct 24, 2019
7efe29b
Bump react (#7875)
andriijas Oct 24, 2019
f79f303
Bump styling related loaders (#7876)
andriijas Oct 24, 2019
e92db94
Remove alex precommit check (#7878)
iansu Oct 24, 2019
4c0c819
Add template support (#7716)
mrmckeb Oct 24, 2019
facd8f9
Prepare 3.3.0 beta
iansu Oct 24, 2019
3e7391d
If template name already starts with cra-template leave it alone (#7880)
iansu Oct 24, 2019
07ccad7
Update prerelease publishing instructions
iansu Oct 24, 2019
324428f
Upgrade packages and tweak config to adapt to new config format (#7814)
andriijas Oct 25, 2019
971f249
refactor: remove double coerce (#7882)
mrmckeb Oct 27, 2019
c34aa13
Add yarn.lock to .gitignore (#7789)
lukyth Oct 27, 2019
165765d
chore: Fix broken link for CRA deployment (#7897)
haruelrovix Oct 29, 2019
2c45a3c
chore: Fix broken link for e2e README (#7896)
haruelrovix Oct 29, 2019
2de57fe
Add @testing-library to the default templates (#7881)
kentcdodds Oct 29, 2019
b4fe788
Add numeric separator support (#7817)
tharun208 Oct 30, 2019
b68c777
Update open (#7910)
andriijas Oct 31, 2019
6d6dfa9
Mark TypeScript as an optional peer dependency (#7860)
dstaley Oct 31, 2019
9750738
Add restoreMocks to supported jest config keys (#7921)
ianschmitz Nov 3, 2019
d46da89
fix seperators typo (#7932)
donavon Nov 5, 2019
10daea2
No spinning React logo if `prefers-reduced-motion` (#7931)
donavon Nov 6, 2019
0c9fa8d
Made PRs welcome badge point to contributors guide (#7792)
jamesgeorge007 Nov 6, 2019
8a1ee2f
Make JavaScript and TypeScript templates consistent (#7944)
suprj Nov 7, 2019
211694a
Fix CI (#7951)
ianschmitz Nov 9, 2019
d12b4b6
Add optional chaining and nullish coalescing operators support (#7438)
renatoagds Nov 9, 2019
5cdc3cc
Add tests for optional chaining and null coalescing (#7952)
ianschmitz Nov 9, 2019
f01bfac
Upgrade jest-watch-typeahead (#7956)
Andarist Nov 10, 2019
30b491b
Fix light background in docusaurus night mode (#7936)
heyimalex Nov 13, 2019
915108b
Add placeholders where old template READMEs used to be (#7972)
iansu Nov 13, 2019
9df95df
Temporarily disable GitHub Actions (#7978)
iansu Nov 14, 2019
3d6d0a1
Prepare 3.3.0 beta
iansu Nov 14, 2019
58b4738
Bump dependencies (#7986)
ianschmitz Nov 16, 2019
e7cdde6
Support scoped templates (#7991)
klasbj Nov 18, 2019
3aaa3fa
Add contributors section to readme (#7995)
ianschmitz Nov 18, 2019
4b4f3f2
added e2e test for checking typescript template with unsupported node…
awaseem Nov 18, 2019
df5088d
Unpin dependencies in react-app-polyfill (#7999)
ianschmitz Nov 19, 2019
23d5776
Add scripts support to templates (#7989)
mrmckeb Nov 19, 2019
4604c5e
Override no-unused-expressions with the typescript-eslint version (#8…
maxdavidson Nov 20, 2019
5d24a5e
Prefix apple-touch-icon links with PUBLIC_URL. (#8005)
benblank Nov 24, 2019
82009f5
Bump webpack-dev-server (#7988)
ianschmitz Nov 24, 2019
1a66971
Bump dependencies (#8024)
ianschmitz Nov 24, 2019
99d71f3
Re-enable GitHub Actions (#8029)
iansu Nov 25, 2019
821fe6b
Update CHANGELOG
iansu Nov 27, 2019
6a3ccc3
Update CODEOWNERS
iansu Nov 27, 2019
fffc777
Remove no-unexpected-multiline rule (#8039)
iansu Nov 28, 2019
f6ba862
Add TypeScript peer dependency to react-scripts (#8038)
iansu Nov 28, 2019
29c5e55
Update template docs (#8050)
mrmckeb Nov 29, 2019
9654bef
Prepare 3.3.0 release
iansu Dec 4, 2019
0b45600
Update CHANGELOG
iansu Dec 4, 2019
9a817dd
Publish
iansu Dec 5, 2019
9f4cb4f
webpackHotDev now uses wss when https is used (#8079)
mikecaulley Dec 5, 2019
2ace7c2
Add custom-templates to docs sidebar (#8077)
ianschmitz Dec 5, 2019
8330e7c
Fix typo in CHANGELOG.md (#8080)
Trontor Dec 6, 2019
7317251
Merge remote-tracking branch 'upstream/master' into upstream
adammockor Dec 6, 2019
27f0c0f
Merge branch 'upstream' into feat/cra-update
adammockor Dec 6, 2019
ff03090
fix Manifest entries
adammockor Dec 6, 2019
9e517b5
update react-scripts dependencies
adammockor Dec 6, 2019
89e4fd2
add typesript-eslint to eslint-config peer depndencies
adammockor Dec 6, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .alexignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build

CHANGELOG*
CODE_OF_CONDUCT.md
18 changes: 18 additions & 0 deletions .alexrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"allow": [
"attacks",
"colors",
"conservative",
"crashes",
"executed",
"executes",
"execution",
"failed",
"hook",
"host-hostess",
"hostesses-hosts",
"invalid",
"remain",
"watchman-watchwoman"
]
}
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
packages/ @bugzpodder @ianschmitz @iansu @mrmckeb @petetnt
packages/ @ianschmitz @iansu @mrmckeb @petetnt
docusaurus/ @amyrlam @iansu
13 changes: 13 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Build

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install
run: yarn --no-progress --non-interactive --no-lockfile
- name: Build
run: yarn build
13 changes: 13 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Lint

on: [push]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install
run: yarn --no-progress --non-interactive --no-lockfile
- name: Alex
run: yarn alex
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ yarn-debug.log*
yarn-error.log*
/.changelog
.npm/
yarn.lock
12 changes: 6 additions & 6 deletions CHANGELOG-1.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -1577,20 +1577,20 @@ Unhandled Promise rejections will now crash tests. You can fix them by explicitl
After the regular update procedure above, add these line to `<head>` in `public/index.html`:

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

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

```html
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
```

Then create a file called `public/manifest.json` that looks like this:
Expand Down
54 changes: 27 additions & 27 deletions azure-pipelines-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,35 @@ parameters:
name: ''
testScript: ''
configurations:
LinuxNode8: { vmImage: 'ubuntu-16.04', nodeVersion: 8.x }
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
WindowsNode8: { vmImage: 'vs2017-win2016', nodeVersion: 8.x }
WindowsNode10: { vmImage: 'vs2017-win2016', nodeVersion: 10.x }
LinuxNode8: { vmImage: 'ubuntu-16.04', nodeVersion: 8.x }
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
# WindowsNode8: { vmImage: 'vs2017-win2016', nodeVersion: 8.x }
# WindowsNode10: { vmImage: 'vs2017-win2016', nodeVersion: 10.x }

jobs:
- job: ${{ parameters.name }}
strategy:
matrix:
${{ insert }}: ${{ parameters.configurations }}
pool:
vmImage: $(vmImage)
steps:
- script: |
git config --global core.autocrlf false
git config --global user.name "Create React App"
git config --global user.email "cra@email.com"
displayName: 'Initialize Git config'
- job: ${{ parameters.name }}
strategy:
matrix:
${{ insert }}: ${{ parameters.configurations }}
pool:
vmImage: $(vmImage)
steps:
- script: |
git config --global core.autocrlf false
git config --global user.name "Create React App"
git config --global user.email "cra@email.com"
displayName: 'Initialize Git config'

- checkout: self
path: create-react-app
- checkout: self
path: create-react-app

- task: NodeTool@0
inputs:
versionSpec: $(nodeVersion)
displayName: 'Install Node.js'
- task: NodeTool@0
inputs:
versionSpec: $(nodeVersion)
displayName: 'Install Node.js'

- script: yarn --frozen-lockfile
displayName: 'Run yarn'
- script: yarn --frozen-lockfile
displayName: 'Run yarn'

- bash: ${{ parameters.testScript }}
displayName: 'Run tests'
- bash: ${{ parameters.testScript }}
displayName: 'Run tests'
120 changes: 67 additions & 53 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#

trigger:
- master
- master

variables:
CI: true
Expand All @@ -14,65 +14,79 @@ variables:
VSTS_OVERWRITE_TEMP: True
# 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.
VERDACCIO_PACKAGE: https://github.com/willsmythe/verdaccio/releases/download/create-react-app/verdaccio-4.0.0-alpha.8.tgz
CRA_INTERNAL_TEST: true

# ******************************************************************************
# Simple test suite
# ******************************************************************************
jobs:
- template: azure-pipelines-test-job.yml
parameters:
name: Simple
testScript: tasks/e2e-simple.sh
- template: azure-pipelines-test-job.yml
parameters:
name: Simple
testScript: tasks/e2e-simple.sh

# ******************************************************************************
# Installs test suite
# ******************************************************************************
- template: azure-pipelines-test-job.yml
parameters:
name: Installs
testScript: tasks/e2e-installs.sh
# ******************************************************************************
# Installs test suite
# ******************************************************************************
- template: azure-pipelines-test-job.yml
parameters:
name: Installs
testScript: tasks/e2e-installs.sh

# ******************************************************************************
# Kitchensink test suite
# ******************************************************************************
- template: azure-pipelines-test-job.yml
parameters:
name: Kitchensink
testScript: tasks/e2e-kitchensink.sh
# ******************************************************************************
# Kitchensink test suite
# ******************************************************************************
- template: azure-pipelines-test-job.yml
parameters:
name: Kitchensink
testScript: tasks/e2e-kitchensink.sh

# ******************************************************************************
# Kitchensink Eject test suite
# ******************************************************************************
- template: azure-pipelines-test-job.yml
parameters:
name: KitchensinkEject
testScript: tasks/e2e-kitchensink-eject.sh
# ******************************************************************************
# Kitchensink Eject test suite
# ******************************************************************************
- template: azure-pipelines-test-job.yml
parameters:
name: KitchensinkEject
testScript: tasks/e2e-kitchensink-eject.sh

# ******************************************************************************
# Behavior test suite
# ******************************************************************************
- template: azure-pipelines-test-job.yml
parameters:
name: Behavior
testScript: tasks/e2e-behavior.sh
configurations:
LinuxNode8: { vmImage: 'ubuntu-16.04', nodeVersion: 8.x }
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
WindowsNode8: { vmImage: 'vs2017-win2016', nodeVersion: 8.x }
WindowsNode10: { vmImage: 'vs2017-win2016', nodeVersion: 10.x }
MacNode8: { vmImage: 'macOS-10.13', nodeVersion: 8.x }
MacNode10: { vmImage: 'macOS-10.13', nodeVersion: 10.x }
# ******************************************************************************
# Behavior test suite
# ******************************************************************************
- template: azure-pipelines-test-job.yml
parameters:
name: Behavior
testScript: tasks/e2e-behavior.sh
configurations:
LinuxNode8: { vmImage: 'ubuntu-16.04', nodeVersion: 8.x }
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
# WindowsNode8: { vmImage: 'vs2017-win2016', nodeVersion: 8.x }
# WindowsNode10: { vmImage: 'vs2017-win2016', nodeVersion: 10.x }
MacNode8: { vmImage: 'macOS-10.13', nodeVersion: 8.x }
MacNode10: { vmImage: 'macOS-10.13', nodeVersion: 10.x }

# ******************************************************************************
# Old Node test suite
# ******************************************************************************
- job: OldNode
pool:
vmImage: ubuntu-16.04
steps:
- task: NodeTool@0
inputs:
versionSpec: 6.x
displayName: 'Install Node.js 6.x'
- bash: tasks/e2e-old-node.sh
displayName: 'Run tests'
# ******************************************************************************
# Old Node test suite
# ******************************************************************************
- job: OldNode
pool:
vmImage: ubuntu-16.04
steps:
- task: NodeTool@0
inputs:
versionSpec: 6.x
displayName: 'Install Node.js 6.x'
- bash: tasks/e2e-old-node.sh
displayName: 'Run tests'
# ******************************************************************************
# Unsupported Node with TypeScript flag
# ******************************************************************************
- job: UnsupportedNodeWithTypeScript
pool:
vmImage: ubuntu-16.04
steps:
- task: NodeTool@0
inputs:
versionSpec: 8.9.x
displayName: 'Install Node.js 8.9.x'
- bash: tasks/e2e-typescript-unsupported-node.sh
displayName: 'Run unsupported TypeScript test'
5 changes: 3 additions & 2 deletions docusaurus/docs/adding-bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import 'bootstrap/dist/css/bootstrap.css';

> Note: this feature is available with `react-scripts@2.0.0` and higher.

Sometimes you might need to tweak the visual styles of Bootstrap (or equivalent package).<br>
Sometimes you might need to tweak the visual styles of Bootstrap (or equivalent package).

As of `react-scripts@2.0.0` you can import `.scss` files. This makes it possible to use a package's built-in Sass variables for global style preferences.

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

Alternatively you may use `yarn`::
Alternatively you may use `yarn`:

```sh
yarn add node-sass
Expand Down
7 changes: 4 additions & 3 deletions docusaurus/docs/adding-custom-environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ Your project can consume variables declared in your environment as if they were
>
> Environment variables are embedded into the build, meaning anyone can view them by inspecting your app's files.

**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.
**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.

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

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`.

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

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.

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

These variables will act as the defaults if the machine does not explicitly set them.<br>
These variables will act as the defaults if the machine does not explicitly set them.

Please refer to the [dotenv documentation](https://github.com/motdotla/dotenv) for more details.

> Note: If you are defining environment variables for development, your CI and/or hosting platform will most likely need
Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/adding-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ make sure to add the following line to your `.flowconfig` to make Flow aware of

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

To learn more about Flow, check out [its documentation](https://flow.org/).
9 changes: 5 additions & 4 deletions docusaurus/docs/adding-images-fonts-and-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ This works in CSS too:
}
```

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

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

**It is not required for React** but many people enjoy it (and React Native uses a similar mechanism for images).<br>
**It is not required for React** but many people enjoy it (and React Native uses a similar mechanism for images).

An alternative way of handling static assets is described in the next section.

## Adding SVGs
Expand All @@ -58,6 +59,6 @@ const App = () => (
);
```

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

> **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.
> **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.
2 changes: 1 addition & 1 deletion docusaurus/docs/adding-relay.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: adding-relay
title: Adding Relay
---

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

To add it, run:

Expand Down
Loading