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

Merge with facebook/create-react-app/master #8

Closed
wants to merge 83 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
79dbc33
Update template tests (#8705)
MichaelDeBoey Mar 24, 2020
edc671e
Bump TypeScript template to 3.8 (#8713)
braedongough Mar 27, 2020
bc41892
Add .cjs and .mjs files support to test runner (#8768)
ai Apr 4, 2020
56d34c0
Use simplified import of @testing-library/jest-dom (#8763)
Dremora Apr 4, 2020
c7352c7
Include absoluteRuntime in babel preset docs (#5847)
iddan Apr 4, 2020
4cbb003
Specify what files are served form a bare local copy (#8749)
challet Apr 4, 2020
e0b179c
fix: handle templates without main package field (#8734)
mrmckeb Apr 4, 2020
c5b96c2
Add experimental react-refresh support (#8582)
charrondev Apr 6, 2020
53cace5
Add setupTests.js to the list of generated files (#8791)
MostafaNawara Apr 7, 2020
f0f4d5b
Simplify wording in setting-up-your-editor.md (#8684)
coryhouse Apr 7, 2020
d80e533
Update url to see prettier in action (#8610)
M165437 Apr 7, 2020
a4fa63f
Bump acorn from 6.4.0 to 6.4.1 in /docusaurus/website (#8656)
dependabot[bot] Apr 7, 2020
e89f153
Don't use webpack multi entry unnecessarily (#8834)
sebmarkbage Apr 15, 2020
855a984
Widen eslint-config-react-app peer dependency versions (#8892)
NMinhNguyen Apr 27, 2020
3771237
Revert "Replace favicon in templates (#8194)" (#8925)
gaearon Apr 28, 2020
9cc1bdf
Minor/patch dependency upgrades (#8947)
ianschmitz May 3, 2020
9904075
Upgrade to Jest 25 (#8362)
skovhus May 4, 2020
8b0d21f
Drop Node 8 support (#8948)
ianschmitz May 4, 2020
fa93437
Bump React Hooks ESLint plugin to 4.0.0 (#8939)
gaearon May 4, 2020
99f1b6b
Update build script deployment URL (#8651)
StenAL May 4, 2020
2975939
Do not check for interactive session to shut down dev server (#8845)
jeremywadsack May 4, 2020
b37cff9
Support source maps for scss in dev environments (#8638)
MKorostoff May 4, 2020
790fba9
Skip stdin resuming to support lerna parallel (#8700)
hieuxlu May 4, 2020
4974a20
Set resetMocks to true by default in jest config (#7899)
alexkrolick May 4, 2020
3c2f2d4
Add import/no-anonymous-default-export lint rule (#8926)
shakib609 May 4, 2020
5d437b8
Upgrade testing-library packages (#8406)
gnapse May 4, 2020
5a019e6
Bump style-loader to 1.2.1 (#8891)
chybisov May 4, 2020
2473a73
Support devDependencies in templates (#8838)
mrmckeb May 4, 2020
62e8e3d
fix react-refresh babel plugin not applied (#8952)
tanhauhau May 4, 2020
6a7aaa2
Add a VSCode tip in the CSS reset section (#8246)
maazadeeb May 5, 2020
408c065
Add back in --stats output from webpack. (#8790)
samccone May 5, 2020
1f81469
Fix --use-pnp for Yarn 2 (#8460)
nickserv May 5, 2020
6b28c60
Replace period in CSS Module classnames (#8492)
evankennedy May 5, 2020
9123aae
Move shortlinks to cra.link (#8957)
iansu May 5, 2020
0cfccd8
Remove outdated comment (#8858)
availchet May 8, 2020
a0b3753
bump webpack-dev-server to 3.11.0 (#8975)
mhassan1 May 8, 2020
f5c3bdb
Dependency major version upgrades (#8950)
ianschmitz May 13, 2020
d97fbad
Update packages (#9081)
ianschmitz May 29, 2020
26a1c7f
Fix dotenv file loading order (#9037)
Timer May 29, 2020
285f9cb
feat: remove typescript flag and NODE_PATH support (#8934)
mrmckeb May 29, 2020
461775a
Update question issue template
iansu May 30, 2020
78e13b0
Update getting-started.md to match templates (#9089)
josenriagu May 31, 2020
c87ab79
Upgrade to Jest 26 (#8955)
ianschmitz Jun 1, 2020
538d527
feat(react-scripts): allow testMatch for jest config (#9114)
favna Jun 6, 2020
fa648da
Add support for absolute paths when using url() in CSS (#7937)
atlanteh Jun 7, 2020
2814124
Upgrade dependencies (#9132)
ianschmitz Jun 10, 2020
a2dac9e
Fix typo in docs (#9135)
sonicdoe Jun 10, 2020
8fda779
Add performance relayer + documentation (web-vitals) (#9116)
housseindjirdeh Jun 11, 2020
b389928
Update deployment docs for Azure Static Web Apps (#9042)
burkeholland Jun 14, 2020
41a1088
Replace Spectrum links with GitHub Discussions (#9102)
iansu Jun 14, 2020
71facad
Use process.execPath to spawn node subprocess (#8694)
anuraaga Jun 20, 2020
697dffe
Upgrade dependencies (#9196)
ianschmitz Jun 20, 2020
fdbde1f
Bump version of Verdaccio (#7787)
ianschmitz Jun 20, 2020
6223fd9
Support ESLint 7.x (#8978)
MichaelDeBoey Jun 23, 2020
abe2369
Fix chai URL (#8895)
BMorearty Jun 26, 2020
2da5517
Explain how to uninstall create-react-app globally (#9244)
nickserv Jul 2, 2020
759696d
Upgrade dependencies (#9317)
ianschmitz Jul 16, 2020
8e720ae
Switch to the Workbox InjectManifest plugin (#9205)
jeffposnick Jul 22, 2020
d1f32c4
Upgrade refresh plugin (#9348)
ianschmitz Jul 22, 2020
2bef8a5
feat: Update ESLint dependencies (#9251)
MichaelDeBoey Jul 22, 2020
bdae9b6
Remove server worker registration from default templates (#9349)
iansu Jul 23, 2020
a01b1c5
Clarify wording in adding TypeScript to existing project (#9231)
merelinguist Jul 27, 2020
66bf7df
feat: better refresh plugin integration (#9375)
pmmmwh Jul 28, 2020
a79d8b8
feat: exit on outdated create-react-app version (#9359)
mrmckeb Jul 29, 2020
7ab0116
Prepare 4.0.0 alpha release
iansu Jul 30, 2020
58db16b
Updated README.md Templates to Follow ESLint Markdown Rules (#9241)
Aug 1, 2020
de27bcf
[Doc] fix React Testing Library example (#9245)
sakit0 Aug 1, 2020
1a6ef92
Update running-tests.md (#9380)
andycanderson Aug 1, 2020
aeaf575
Add Fast Refresh warning when using React < 16.10 (#9350)
iansu Aug 2, 2020
5bd6e73
Publish refreshOverlayInterop with react-dev-utils (#9390)
klinem Aug 2, 2020
2c2e224
fix: remove deprecated rule (#9401)
ljosberinn Aug 2, 2020
ebab256
clean formatMessage usage (#9059)
chenxsan Aug 5, 2020
3cf2b06
feat: Update testing-library dependencies to latest (#9252)
MichaelDeBoey Aug 5, 2020
f86cf44
fix: use default modules option from `preset-env` (#9374)
JLHwung Aug 5, 2020
42dcf79
Bump immer version (#8933)
staff0rd Aug 5, 2020
6cd3826
Upgrade whatwg-fetch (#9392)
Lapz Aug 5, 2020
5036825
Fix template name handling (#9412)
iansu Aug 5, 2020
3d74b79
Prepare 4.0.0 alpha release
iansu Aug 5, 2020
c8ea284
chore: update to jest@26.3 (#9461)
SimenB Aug 11, 2020
5e41ca0
Create SECURITY.md
gaearon Aug 11, 2020
5e703a5
Add 3.4.2 to changelog
gaearon Aug 11, 2020
8e761d1
Add 3.4.3 to the changelog
gaearon Aug 12, 2020
f8320e4
Merge with 'master'
calebmshafer Aug 16, 2020
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ about: Get help with Create React App
labels: 'needs triage'
---

If you have a general question about Create React App or about building an app with Create React App we encourage you to post on our Spectrum community instead of this issue tracker. The maintainers and other community members can provide help and answer your questions there: https://spectrum.chat/create-react-app
If you have a general question about Create React App or about building an app with Create React App we encourage you to post in GitHub Discussions instead of this issue tracker. The maintainers and other community members can provide help and answer your questions there: https://github.com/facebook/create-react-app/discussions

If you're looking for general information on using React, the React docs have a list of resources: https://reactjs.org/community/support.html

Expand Down
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"arrowParens": "avoid",
"trailingComma": "es5",
"singleQuote": true,
"semi": true
Expand Down
833 changes: 447 additions & 386 deletions CHANGELOG-0.x.md

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
## 3.4.3 (2020-08-12)

v3.4.2 release bumps `terser-webpack-plugin` to a version for which `npm audit` does not report a vulnerability. Note that **this vulnerability did not affect Create React App projects**, so this change is only necessary to satisfy auditing tools.

### Migrating from 3.4.2 to 3.4.3

Inside any created project that has not been ejected, run:

```sh
npm install --save --save-exact react-scripts@3.4.3
```

or

```sh
yarn add --exact react-scripts@3.4.3
```

## 3.4.2 (2020-08-11)

v3.4.2 release bumps `webpack-dev-server` to a version for which `npm audit` does not report a vulnerability. Note that **this vulnerability did not affect Create React App projects**, so this change is only necessary to satisfy auditing tools.

### Migrating from 3.4.1 to 3.4.2

Inside any created project that has not been ejected, run:

```sh
npm install --save --save-exact react-scripts@3.4.2
```

or

```sh
yarn add --exact react-scripts@3.4.2
```

## 3.4.1 (2020-03-20)

v3.4.1 is a maintenance release that includes minor bug fixes and documentation updates including upgrading Babel to fix a bug in the 7.8 release line. This release also brings support for TypeScript 3.8.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ All functionality must be retained (and configuration given to the user) if they

2. Run `yarn` in the root `create-react-app` folder.

Once it is done, you can modify any file locally and run `yarn start`, `yarn test` or `yarn build` like you can in a generated project.
Once it is done, you can modify any file locally and run `yarn start`, `yarn test` or `yarn build` like you can in a generated project. It will serve the application from the files located in `packages/cra-template/template`.

If you want to try out the end-to-end flow with the global CLI, you can do this too:

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Create React apps with no build configuration.

Create React App works on macOS, Windows, and Linux.<br>
If something doesn’t work, please [file an issue](https://github.com/facebook/create-react-app/issues/new).<br>
If you have questions or need help, please ask in our [Spectrum](https://spectrum.chat/create-react-app) community.
If you have questions or need help, please ask in [GitHub Discussions](https://github.com/facebook/create-react-app/discussions).

## Quick Overview

Expand All @@ -17,7 +17,7 @@ cd my-app
npm start
```

If you've previously installed `create-react-app` globally via `npm install -g create-react-app`, we recommend you uninstall the package using `npm uninstall -g create-react-app` to ensure that npx always uses the latest version.
If you've previously installed `create-react-app` globally via `npm install -g create-react-app`, we recommend you uninstall the package using `npm uninstall -g create-react-app` or `yarn global remove create-react-app` to ensure that npx always uses the latest version.

_([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))_

Expand Down Expand Up @@ -86,6 +86,7 @@ my-app
├── index.js
├── logo.svg
└── serviceWorker.js
└── setupTests.js
```

No configuration or complicated folder structures, only the files you need to build your app.<br>
Expand Down
7 changes: 7 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Reporting Security Issues

If you believe you have found a security vulnerability in Create React App, we encourage you to let us know right away. We will investigate all legitimate reports and do our best to quickly fix the problem.

Please refer to the following page for our responsible disclosure policy, reward guidelines, and those things that should not be reported:

https://www.facebook.com/whitehat
4 changes: 1 addition & 3 deletions azure-pipelines-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ 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 }
LinuxNode12: { vmImage: 'ubuntu-16.04', nodeVersion: 12.x }

jobs:
- job: ${{ parameters.name }}
Expand Down
31 changes: 8 additions & 23 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ variables:
NPM_CONFIG_CACHE: $(Build.SourcesDirectory)/../npm-cache
# Sets TEMP to be on the same drive as the cloned source on Windows. This avoids test scripts that "cd" into a directory under TEMP from failing because this directory is on a different drive from the current directory.
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

# ******************************************************************************
Expand Down Expand Up @@ -57,36 +55,23 @@ jobs:
name: Behavior
testScript: tasks/e2e-behavior.sh
configurations:
LinuxNode8: { vmImage: 'ubuntu-18.04', nodeVersion: 8.x }
LinuxNode10: { vmImage: 'ubuntu-18.04', nodeVersion: 10.x }
# WindowsNode8: { vmImage: 'vs2017-win2016', nodeVersion: 8.x }
# WindowsNode10: { vmImage: 'vs2017-win2016', nodeVersion: 10.x }
MacNode8: { vmImage: 'macOS-10.15', nodeVersion: 8.x }
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
LinuxNode12: { vmImage: 'ubuntu-16.04', nodeVersion: 12.x }
WindowsNode10: { vmImage: 'windows-2019', nodeVersion: 10.x }
WindowsNode12: { vmImage: 'windows-2019', nodeVersion: 12.x }
MacNode10: { vmImage: 'macOS-10.15', nodeVersion: 10.x }
MacNode12: { vmImage: 'macOS-10.15', nodeVersion: 12.x }

# ******************************************************************************
# Old Node test suite
# ******************************************************************************
- job: OldNode
pool:
vmImage: ubuntu-16.04
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: 6.x
displayName: 'Install Node.js 6.x'
versionSpec: 8.x
displayName: 'Install Node.js 8.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'
2 changes: 2 additions & 0 deletions docusaurus/docs/adding-css-reset.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ To start using it, add `@import-normalize;` anywhere in your CSS file(s). You on
/* rest of app styles */
```

> **Tip**: If you see an "_Unknown at rule @import-normalize css(unknownAtRules)_" warning in VSCode, change the `css.lint.unknownAtRules` setting to `ignore`.

You can control which parts of [normalize.css] to use via your project's [browserslist].

Results when [browserslist] is `last 3 versions`:
Expand Down
4 changes: 2 additions & 2 deletions docusaurus/docs/adding-custom-environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ REACT_APP_NOT_SECRET_CODE=abcdef

Files on the left have more priority than files on the right:

- `npm start`: `.env.development.local`, `.env.development`, `.env.local`, `.env`
- `npm run build`: `.env.production.local`, `.env.production`, `.env.local`, `.env`
- `npm start`: `.env.development.local`, `.env.local`, `.env.development`, `.env`
- `npm run build`: `.env.production.local`, `.env.local`, `.env.production`, `.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.
Expand Down
6 changes: 3 additions & 3 deletions docusaurus/docs/adding-typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ npx create-react-app my-app --template typescript
yarn create react-app my-app --template typescript
```

> If you've previously installed `create-react-app` globally via `npm install -g create-react-app`, we recommend you uninstall the package using `npm uninstall -g create-react-app` to ensure that `npx` always uses the latest version.
> If you've previously installed `create-react-app` globally via `npm install -g create-react-app`, we recommend you uninstall the package using `npm uninstall -g create-react-app` or `yarn global remove create-react-app` to ensure that `npx` always uses the latest version.
>
> Global installs of `create-react-app` are no longer supported.

To add [TypeScript](https://www.typescriptlang.org/) to a Create React App project, first install it:
To add [TypeScript](https://www.typescriptlang.org/) to an existing Create React App project, first install it:

```sh
npm install --save typescript @types/node @types/react @types/react-dom @types/jest
Expand All @@ -47,7 +47,7 @@ You are not required to make a [`tsconfig.json` file](https://www.typescriptlang

## Troubleshooting

If your project is not created with TypeScript enabled, npx may be using a cached version of `create-react-app`. Remove previously installed versions with `npm uninstall -g create-react-app` (see [#6119](https://github.com/facebook/create-react-app/issues/6119#issuecomment-451614035)).
If your project is not created with TypeScript enabled, npx may be using a cached version of `create-react-app`. Remove previously installed versions with `npm uninstall -g create-react-app` or `yarn global remove create-react-app` (see [#6119](https://github.com/facebook/create-react-app/issues/6119#issuecomment-451614035)).

If you are currently using [create-react-app-typescript](https://github.com/wmonk/create-react-app-typescript/), see [this blog post](https://vincenttunru.com/migrate-create-react-app-typescript-to-create-react-app/) for instructions on how to migrate to Create React App.

Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/advanced-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ You can adjust various development and production settings by setting environmen
| REACT_EDITOR | ✅ Used | 🚫 Ignored | When an app crashes in development, you will see an error overlay with clickable stack trace. When you click on it, Create React App will try to determine the editor you are using based on currently running processes, and open the relevant source file. You can [send a pull request to detect your editor of choice](https://github.com/facebook/create-react-app/issues/2636). Setting this environment variable overrides the automatic detection. If you do it, make sure your systems [PATH](<https://en.wikipedia.org/wiki/PATH_(variable)>) environment variable points to your editor’s bin folder. You can also set it to `none` to disable it completely. |
| 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. |
| 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. |
| NODE_PATH | ✅ Used | ✅ Used | Same as [`NODE_PATH` in Node.js](https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders), but only relative folders are allowed. Can be handy for emulating a monorepo setup by setting `NODE_PATH=src`. |
| 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. |
| IMAGE_INLINE_SIZE_LIMIT | 🚫 Ignored | ✅ 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. |
| EXTEND_ESLINT | ✅ Used | ✅ Used | When set to `true`, user provided ESLint configs will be used by `eslint-loader`. Note that any rules set to `"error"` will stop the application from building. |
| 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. |
| 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. |
2 changes: 1 addition & 1 deletion docusaurus/docs/custom-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ You can add whatever files you want in here, but you must have at least the file

This is the configuration file for your template. As this is a new feature, more options will be added over time. For now, only a `package` key is supported.

The `package` key lets you provide any keys/values that you want added to the new project's `package.json`, such as dependencies (only dependencies are supported for now) and any custom scripts that your template relies on.
The `package` key lets you provide any keys/values that you want added to the new project's `package.json`, such as dependencies and any custom scripts that your template relies on.

Below is an example `template.json` file:

Expand Down
Loading