diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..6313b56c578 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f51aebeac2d..f0e8f10f061 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,2 +1,2 @@ packages/ @ianschmitz @iansu @mrmckeb @petetnt -docusaurus/ @amyrlam @iansu +docusaurus/ @ianschmitz @iansu @mrmckeb diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index 147ea1dc458..e547baf9d3f 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -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 diff --git a/.github/stale.yml b/.github/stale.yml index 9dafb647ef1..91807e989b9 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -9,20 +9,20 @@ daysUntilClose: 5 # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable exemptLabels: - - "contributions: claimed" - - "contributions: up for grabs!" - - "good first issue" - - "issue: announcement" - - "issue: bug" - - "issue: needs investigation" - - "issue: proposal" - - "tag: breaking change" - - "tag: bug fix" - - "tag: documentation" - - "tag: enhancement" - - "tag: internal" - - "tag: new feature" - - "tag: underlying tools" + - 'contributions: claimed' + - 'contributions: up for grabs!' + - 'good first issue' + - 'issue: announcement' + - 'issue: bug' + - 'issue: needs investigation' + - 'issue: proposal' + - 'tag: breaking change' + - 'tag: bug fix' + - 'tag: documentation' + - 'tag: enhancement' + - 'tag: internal' + - 'tag: new feature' + - 'tag: underlying tools' # Set to true to ignore issues in a project (defaults to false) exemptProjects: true diff --git a/.prettierrc b/.prettierrc index 8ff820d3bc0..7a7fd85ee2a 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,5 @@ { - "trailingComma": "es5", + "arrowParens": "avoid", "singleQuote": true, "semi": true } diff --git a/CHANGELOG-3.x.md b/CHANGELOG-3.x.md new file mode 100644 index 00000000000..f73718f970c --- /dev/null +++ b/CHANGELOG-3.x.md @@ -0,0 +1,1324 @@ +## 3.4.4 (2020-10-20) + +v3.4.4 release bumps `resolve-url-loader` 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.3 to 3.4.4 + +Inside any created project that has not been ejected, run: + +```sh +npm install --save --save-exact react-scripts@3.4.4 +``` + +or + +```sh +yarn add --exact react-scripts@3.4.4 +``` + +## 3.4.3 (2020-08-12) + +v3.4.3 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. + +#### :bug: Bug Fix + +- `react-scripts` + - [#8276](https://github.com/facebook/create-react-app/pull/8276) Use native ESLint behaviour when extending ([@mrmckeb](https://github.com/mrmckeb)) + - [#7203](https://github.com/facebook/create-react-app/pull/7203) Closes webpack dev server and exits process on "end" stdin ([@kelseyleftwich](https://github.com/kelseyleftwich)) +- `babel-preset-react-app` + - [#8526](https://github.com/facebook/create-react-app/pull/8526) Fix optional chaining and nullish coalescing support ([@ianschmitz](https://github.com/ianschmitz)) +- `cra-template`, `eslint-config-react-app`, `react-scripts` + - [#7790](https://github.com/facebook/create-react-app/pull/7790) Widen eslint-config-react-app peer dependency versions ([@lukyth](https://github.com/lukyth)) + +#### :nail_care: Enhancement + +- `cra-template-typescript`, `cra-template` + - [#8558](https://github.com/facebook/create-react-app/pull/8558) Add React.StrictMode to default templates ([@connkat](https://github.com/connkat)) +- `react-scripts` + - [#8539](https://github.com/facebook/create-react-app/pull/8539) allow specification of package.main in template.json ([@EvanBoyle](https://github.com/EvanBoyle)) + +#### :memo: Documentation + +- Other + - [#8515](https://github.com/facebook/create-react-app/pull/8515) Fix proxying API request docs ([@hjr3](https://github.com/hjr3)) + - [#8561](https://github.com/facebook/create-react-app/pull/8561) Indicate that the file structure is the template's ([@Vinnl](https://github.com/Vinnl)) +- `react-scripts` + - [#8276](https://github.com/facebook/create-react-app/pull/8276) Use native ESLint behaviour when extending ([@mrmckeb](https://github.com/mrmckeb)) + +#### :hammer: Underlying Tools + +- `babel-preset-react-app`, `create-react-app`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#8681](https://github.com/facebook/create-react-app/pull/8681) Update to Babel 7.9 ([@ianschmitz](https://github.com/ianschmitz)) + - [#8620](https://github.com/facebook/create-react-app/pull/8620) Bump dependencies ([@ianschmitz](https://github.com/ianschmitz)) +- `react-scripts` + - [#8509](https://github.com/facebook/create-react-app/pull/8509) Bumps pnp-webpack-plugin ([@arcanis](https://github.com/arcanis)) + +#### Committers: 9 + +- Brody McKee ([@mrmckeb](https://github.com/mrmckeb)) +- Evan Boyle ([@EvanBoyle](https://github.com/EvanBoyle)) +- Herman J. Radtke III ([@hjr3](https://github.com/hjr3)) +- Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz)) +- Kanitkorn Sujautra ([@lukyth](https://github.com/lukyth)) +- KatCon ([@connkat](https://github.com/connkat)) +- Kelsey Leftwich ([@kelseyleftwich](https://github.com/kelseyleftwich)) +- Maël Nison ([@arcanis](https://github.com/arcanis)) +- Vincent ([@Vinnl](https://github.com/Vinnl)) + +### Migrating from 3.4.0 to 3.4.1 + +Inside any created project that has not been ejected, run: + +```sh +npm install --save --save-exact react-scripts@3.4.1 +``` + +or + +```sh +yarn add --exact react-scripts@3.4.1 +``` + +## 3.4.0 (2020-02-14) + +v3.4.0 is a minor release that adds new features, including support for SSL and setting `PUBLIC_URL` in development. It also includes a fix for Hot Module Reloading with CSS Modules as well as other bug fixes. + +#### :bug: Bug Fix + +- `react-scripts` + - [#8378](https://github.com/facebook/create-react-app/pull/8378) Downgrade style-loader to v0.23.1 due to CSS modules hot reload not working with v1.0.0 and above ([@chybisov](https://github.com/chybisov)) +- `create-react-app`, `react-dev-utils`, `react-error-overlay` + - [#8439](https://github.com/facebook/create-react-app/pull/8439) Downgrade chalk for ie 11 support ([@ianschmitz](https://github.com/ianschmitz)) +- `react-dev-utils` + - [#8292](https://github.com/facebook/create-react-app/pull/8292) Fixes unchecked access to 'deploy' script on build ([@renato-bohler](https://github.com/renato-bohler)) +- `cra-template-typescript`, `cra-template` + - [#8272](https://github.com/facebook/create-react-app/pull/8272) Handle service worker error in Firefox ([@rosinghal](https://github.com/rosinghal)) +- `cra-template-typescript` + - [#8403](https://github.com/facebook/create-react-app/pull/8403) Fix robots.txt for TS ([@Kamahl19](https://github.com/Kamahl19)) + +#### :nail_care: Enhancement + +- `react-dev-utils`, `react-scripts` + - [#8442](https://github.com/facebook/create-react-app/pull/8442) fix(react-scripts): do not redirect served path if request may proxy ([@iamandrewluca](https://github.com/iamandrewluca)) + - [#7259](https://github.com/facebook/create-react-app/pull/7259) feat(react-scripts): allow PUBLIC_URL in develoment mode ([@iamandrewluca](https://github.com/iamandrewluca)) + - [#7750](https://github.com/facebook/create-react-app/pull/7750) Enable custom sockjs pathname for hot reloading server. ([@heygrady](https://github.com/heygrady)) +- `cra-template-typescript` + - [#8412](https://github.com/facebook/create-react-app/pull/8412) Change arrow functions to function declarations ([@lewislbr](https://github.com/lewislbr)) +- `cra-template-typescript`, `cra-template` + - [#8272](https://github.com/facebook/create-react-app/pull/8272) Handle service worker error in Firefox ([@rosinghal](https://github.com/rosinghal)) +- `react-scripts` + - [#5845](https://github.com/facebook/create-react-app/pull/5845) Add option to provide custom ssl certificates during development ([@alexbrazier](https://github.com/alexbrazier)) + +#### :memo: Documentation + +- `cra-template-typescript`, `cra-template`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#8475](https://github.com/facebook/create-react-app/pull/8475) Correct webpack name casing ([@lewislbr](https://github.com/lewislbr)) +- Other + - [#8437](https://github.com/facebook/create-react-app/pull/8437) Fix navbar line break in header ([@esvyridov](https://github.com/esvyridov)) + - [#8299](https://github.com/facebook/create-react-app/pull/8299) Update public folder usage docs to clarify globals ([@keevan](https://github.com/keevan)) + - [#8390](https://github.com/facebook/create-react-app/pull/8390) setupTestFrameworkScriptFile is deprecated ([@JimmyLv](https://github.com/JimmyLv)) + +#### :hammer: Underlying Tools + +- `react-dev-utils` + - [#8459](https://github.com/facebook/create-react-app/pull/8459) update open to v7.0.2 ([@vince1995](https://github.com/vince1995)) + - [#7948](https://github.com/facebook/create-react-app/pull/7948) Support JetBrains Rider IDE as an editor ([@djpowell](https://github.com/djpowell)) + - [#8367](https://github.com/facebook/create-react-app/pull/8367) Wider Chromium support for openBrowser ([@handeyeco](https://github.com/handeyeco)) +- `react-scripts` + - [#8282](https://github.com/facebook/create-react-app/pull/8282) Run git init before template dependencies are installed ([@lukaszfiszer](https://github.com/lukaszfiszer)) +- Other + - [#8402](https://github.com/facebook/create-react-app/pull/8402) fix(test): force install npm in e2e-behaviour ([@iamandrewluca](https://github.com/iamandrewluca)) + +#### Committers: 18 + +- Alex Brazier ([@alexbrazier](https://github.com/alexbrazier)) +- Andrew Luca ([@iamandrewluca](https://github.com/iamandrewluca)) +- Cassidy Williams ([@cassidoo](https://github.com/cassidoo)) +- Christopher Button ([@devgeist](https://github.com/devgeist)) +- David Powell ([@djpowell](https://github.com/djpowell)) +- Eugene Chybisov ([@chybisov](https://github.com/chybisov)) +- Eugene Sviridov ([@esvyridov](https://github.com/esvyridov)) +- Grady Kuhnline ([@heygrady](https://github.com/heygrady)) +- Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz)) +- Kevin Pham ([@keevan](https://github.com/keevan)) +- Lewis Llobera ([@lewislbr](https://github.com/lewislbr)) +- Martin Litvaj ([@Kamahl19](https://github.com/Kamahl19)) +- Matthew Curtis ([@handeyeco](https://github.com/handeyeco)) +- Renato Böhler ([@renato-bohler](https://github.com/renato-bohler)) +- Rohit Singhal ([@rosinghal](https://github.com/rosinghal)) +- Vincent Semrau ([@vince1995](https://github.com/vince1995)) +- Łukasz Fiszer ([@lukaszfiszer](https://github.com/lukaszfiszer)) +- 吕立青 ([@JimmyLv](https://github.com/JimmyLv)) + +### Migrating from 3.3.1 to 3.4.0 + +Inside any created project that has not been ejected, run: + +```sh +npm install --save --save-exact react-scripts@3.4.0 +``` + +or + +```sh +yarn add --exact react-scripts@3.4.0 +``` + +## 3.3.1 (2020-01-31) + +v3.3.1 is a maintenance release that includes minor bug fixes and documentation updates. + +#### :bug: Bug Fix + +- `cra-template` + - [#8255](https://github.com/facebook/create-react-app/pull/8255) Add "Disallow:" to robots.txt ([@tomoyaf](https://github.com/tomoyaf)) +- `react-scripts` + - [#8281](https://github.com/facebook/create-react-app/pull/8281) Fix sass importLoaders ([@mariusc23](https://github.com/mariusc23)) + - [#8099](https://github.com/facebook/create-react-app/pull/8099) Add titleProp to SVGR ReactComponent type definition ([@rhnorskov](https://github.com/rhnorskov)) + - [#8028](https://github.com/facebook/create-react-app/pull/8028) fix(react-scripts): proactively append to .gitignore during generation ([@bmuenzenmeyer](https://github.com/bmuenzenmeyer)) + - [#8106](https://github.com/facebook/create-react-app/pull/8106) Fix CSS font-face minification ([@sidonaldson](https://github.com/sidonaldson)) +- `babel-preset-react-app` + - [#8120](https://github.com/facebook/create-react-app/pull/8120) Sync dependencies babel config ([@ianschmitz](https://github.com/ianschmitz)) +- `react-dev-utils` + - [#8116](https://github.com/facebook/create-react-app/pull/8116) Add slashes to WebSocket protocol URL ([@Baael](https://github.com/Baael)) + - [#8079](https://github.com/facebook/create-react-app/pull/8079) webpackHotDevClient now uses wss when https is used ([@mikecaulley](https://github.com/mikecaulley)) + +#### :nail_care: Enhancement + +- `react-error-overlay` + - [#6548](https://github.com/facebook/create-react-app/pull/6548) Add helpful message to the footer ([@pyrogenic](https://github.com/pyrogenic)) +- `cra-template-typescript` + - [#8177](https://github.com/facebook/create-react-app/pull/8177) Remove React.FC from Typescript template ([@Retsam](https://github.com/Retsam)) +- `cra-template-typescript`, `cra-template`, `react-scripts` + - [#8219](https://github.com/facebook/create-react-app/pull/8219) Add template support for any package.json keys (#8082) ([@tomvalorsa](https://github.com/tomvalorsa)) +- `create-react-app` + - [#8298](https://github.com/facebook/create-react-app/pull/8298) Support shorthand scoped templates ([@kevin940726](https://github.com/kevin940726)) + - [#8168](https://github.com/facebook/create-react-app/pull/8168) Add current version and bin location to --info output ([@heyimalex](https://github.com/heyimalex)) +- `cra-template-typescript`, `cra-template` + - [#8194](https://github.com/facebook/create-react-app/pull/8194) Replace favicon in templates ([@heyimalex](https://github.com/heyimalex)) +- `eslint-config-react-app` + - [#7803](https://github.com/facebook/create-react-app/pull/7803) Remove error for @typescript-eslint/no-namespace ([@szhu](https://github.com/szhu)) + +#### :memo: Documentation + +- Other + - [#8380](https://github.com/facebook/create-react-app/pull/8380) docs: Add troubleshooting documentation on ENOSPC ([@huchenme](https://github.com/huchenme)) + - [#8394](https://github.com/facebook/create-react-app/pull/8394) Update docs according to lint-staged v10 ([@lukyth](https://github.com/lukyth)) + - [#8307](https://github.com/facebook/create-react-app/pull/8307) Remove outdated docs regarding vscode eslint extension and typescript autofix ([@alex-vukovity-cko](https://github.com/alex-vukovity-cko)) + - [#8247](https://github.com/facebook/create-react-app/pull/8247) Update setting-up-your-editor.md ([@dev-xu](https://github.com/dev-xu)) + - [#8092](https://github.com/facebook/create-react-app/pull/8092) Update custom template docs with instructions for testing custom template locally ([@kevinold](https://github.com/kevinold)) + - [#8293](https://github.com/facebook/create-react-app/pull/8293) Minor grammatical edit ([@egrim](https://github.com/egrim)) + - [#8212](https://github.com/facebook/create-react-app/pull/8212) Little typo ([@sonyarianto](https://github.com/sonyarianto)) + - [#8147](https://github.com/facebook/create-react-app/pull/8147) update PWA docs links to point to template package ([@peet](https://github.com/peet)) + - [#8132](https://github.com/facebook/create-react-app/pull/8132) Add package-runner note to readme ([@JeromeDeLeon](https://github.com/JeromeDeLeon)) + - [#8111](https://github.com/facebook/create-react-app/pull/8111) chore: update docusaurus & tweak site ([@endiliey](https://github.com/endiliey)) + - [#8080](https://github.com/facebook/create-react-app/pull/8080) Fix typo in CHANGELOG.md ([@Trontor](https://github.com/Trontor)) + - [#8077](https://github.com/facebook/create-react-app/pull/8077) Add custom-templates to docs sidebar ([@ianschmitz](https://github.com/ianschmitz)) +- `babel-preset-react-app` + - [#8124](https://github.com/facebook/create-react-app/pull/8124) Fix typo in comment: `?.` is right, `.?` is not ([@vadzim](https://github.com/vadzim)) + +#### :house: Internal + +- `create-react-app` + - [#8178](https://github.com/facebook/create-react-app/pull/8178) Minor refactors in create-react-app ([@heyimalex](https://github.com/heyimalex)) + +#### :hammer: Underlying Tools + +- `babel-preset-react-app`, `create-react-app`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#8353](https://github.com/facebook/create-react-app/pull/8353) Remove outdated babel plugins ([@ianschmitz](https://github.com/ianschmitz)) + - [#8324](https://github.com/facebook/create-react-app/pull/8324) Update Dependencies ([@RDIL](https://github.com/RDIL)) + - [#8122](https://github.com/facebook/create-react-app/pull/8122) Fix CI build ([@ianschmitz](https://github.com/ianschmitz)) +- `react-dev-utils` + - [#8364](https://github.com/facebook/create-react-app/pull/8364) Downgrade open from 7.0.0 to 6.4.0 ([@vince1995](https://github.com/vince1995)) + - [#8163](https://github.com/facebook/create-react-app/pull/8163) Bump pkgUp ([@andriijas](https://github.com/andriijas)) +- `babel-plugin-named-asset-import` + - [#8171](https://github.com/facebook/create-react-app/pull/8171) Bump babel-plugin-tester and fix breaking changes ([@andriijas](https://github.com/andriijas)) +- `create-react-app`, `react-app-polyfill`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#8176](https://github.com/facebook/create-react-app/pull/8176) Bump internal dependencies ([@andriijas](https://github.com/andriijas)) +- `create-react-app`, `react-dev-utils`, `react-error-overlay` + - [#8164](https://github.com/facebook/create-react-app/pull/8164) Bump chalk ([@andriijas](https://github.com/andriijas)) +- `react-error-overlay`, `react-scripts` + - [#8102](https://github.com/facebook/create-react-app/pull/8102) [Security] Update terser webpack plugin ([@RDIL](https://github.com/RDIL)) + +#### Committers: 29 + +- Alex Guerra ([@heyimalex](https://github.com/heyimalex)) +- Alex James Vukovity ([@alex-vukovity-cko](https://github.com/alex-vukovity-cko)) +- Andreas Cederström ([@andriijas](https://github.com/andriijas)) +- Boyuan Xu ([@dev-xu](https://github.com/dev-xu)) +- Brian Muenzenmeyer ([@bmuenzenmeyer](https://github.com/bmuenzenmeyer)) +- Endi ([@endiliey](https://github.com/endiliey)) +- Evan Grim ([@egrim](https://github.com/egrim)) +- Hu Chen ([@huchenme](https://github.com/huchenme)) +- Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz)) +- Jerome De Leon ([@JeromeDeLeon](https://github.com/JeromeDeLeon)) +- Joshua Pollak ([@pyrogenic](https://github.com/pyrogenic)) +- Kai Hao ([@kevin940726](https://github.com/kevin940726)) +- Kanitkorn Sujautra ([@lukyth](https://github.com/lukyth)) +- Kevin Old ([@kevinold](https://github.com/kevinold)) +- Marius Craciunoiu ([@mariusc23](https://github.com/mariusc23)) +- Mike Caulley ([@mikecaulley](https://github.com/mikecaulley)) +- Peet Goddard ([@peet](https://github.com/peet)) +- Rasmus Nørskov ([@rhnorskov](https://github.com/rhnorskov)) +- Reece Dunham ([@RDIL](https://github.com/RDIL)) +- Sean Zhu ([@szhu](https://github.com/szhu)) +- Simon Donaldson ([@sidonaldson](https://github.com/sidonaldson)) +- Sony AK ([@sonyarianto](https://github.com/sonyarianto)) +- Tom Valorsa ([@tomvalorsa](https://github.com/tomvalorsa)) +- Tomoya Fujita ([@tomoyaf](https://github.com/tomoyaf)) +- Vadzim ([@vadzim](https://github.com/vadzim)) +- Vincent Semrau ([@vince1995](https://github.com/vince1995)) +- Wojciech Zieliński ([@Baael](https://github.com/Baael)) +- [@Retsam](https://github.com/Retsam) +- [@Trontor](https://github.com/Trontor) + +### Migrating from 3.3.0 to 3.3.1 + +Inside any created project that has not been ejected, run: + +```sh +npm install --save --save-exact react-scripts@3.3.1 +``` + +or + +```sh +yarn add --exact react-scripts@3.3.1 +``` + +## 3.3.0 (2019-12-04) + +v3.3.0 is a minor release that adds new features, including custom templates and support for the new optional chaining and nullish coalescing operators. + +### Custom Templates + +You can now create a new app using custom templates. + +We've published our existing templates as [`cra-template`](https://github.com/facebook/create-react-app/tree/master/packages/cra-template) and [`cra-template-typescript`](https://github.com/facebook/create-react-app/tree/master/packages/cra-template-typescript), but we expect to see many great templates from the community over the coming weeks. + +The below command shows how you can create a new app with `cra-template-typescript`. + +```sh +npx create-react-app my-app --template typescript +``` + +Note that you can omit the prefix `cra-template-` when specifying which template you would like. For TypeScript users, we're deprecating `--typescript` in favour of `--template typescript`. + +If you don't set a template, we'll create your new app with `cra-template` - which is just a new name for our base template. + +### Optional Chaining and Nullish Coalescing Operators + +We now support the [optional chaining](https://github.com/TC39/proposal-optional-chaining) and [nullish coalescing](https://github.com/tc39/proposal-nullish-coalescing) operators! + +```js +// Optional chaining +a?.(); // undefined if `a` is null/undefined +b?.c; // undefined if `b` is null/undefined + +// Nullish coalescing +undefined ?? 'some other default'; // result: 'some other default' +null ?? 'some other default'; // result: 'some other default' +'' ?? 'some other default'; // result: '' +0 ?? 300; // result: 0 +false ?? true; // result: false +``` + +**If you're using TypeScript, you will need to upgrade your `typescript` dependency to `3.7.0` or later if you wish to use the new operators.** + +**If you're using Visual Studio Code 1.40 (the latest as of this release) or earlier, you will need to configure your editor if you want it to understand the new operators.** + +If you're using TypeScript in your project and have already upgrade its version as described above, then you can [configure VS Code to `Use Workspace Version` of TypeScript](https://code.visualstudio.com/docs/typescript/typescript-compiling#_using-newer-typescript-versions). If your project isn't using TypeScript, you can use the [JavaScript and TypeScript Nightly extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-next) until VS Code releases a newer version including TypeScript `3.7.0` or newer. + +### Numeric Separators + +We've added support for [numeric separators](https://github.com/tc39/proposal-numeric-separator) to improve readability of numeric literals. + +```js +1000000000; // Is this a billion? a hundred millions? Ten millions? +101475938.38; // what scale is this? what power of 10? + +1_000_000_000; // Ah, so a billion +101_475_938.38; // And this is hundreds of millions +``` + +### no-unexpected-multiline + +We've removed this rule as it is not compatible with Prettier. If you rely on this rule you can re-enable it by [extending our ESLint config](https://create-react-app.dev/docs/setting-up-your-editor/#experimental-extending-the-eslint-config) and adding the following: + +```json +{ + "extends": "react-app", + "rules": { + "no-unexpected-multiline": "warn" + } +} +``` + +#### :rocket: New Feature + +- `babel-preset-react-app` + - [#7438](https://github.com/facebook/create-react-app/pull/7438) Add optional chaining and nullish coalescing operators support ([@renatoagds](https://github.com/renatoagds)) +- `babel-preset-react-app`, `react-dev-utils` + - [#7817](https://github.com/facebook/create-react-app/pull/7817) Add numeric separator support ([@tharun208](https://github.com/tharun208)) +- `cra-template-typescript`, `cra-template`, `create-react-app`, `react-scripts` + - [#7716](https://github.com/facebook/create-react-app/pull/7716) Add template support ([@mrmckeb](https://github.com/mrmckeb)) + +#### :boom: Breaking Change + +- `create-react-app`, `react-dev-utils`, `react-scripts` + + - [#7988](https://github.com/facebook/create-react-app/pull/7988) Bump webpack-dev-server ([@ianschmitz](https://github.com/ianschmitz)) + + **NOTE: This is only a breaking change if you're using `react-dev-utils` outside of Create React App.** + +#### :bug: Bug Fix + +- `eslint-config-react-app` + - [#8039](https://github.com/facebook/create-react-app/pull/8039) Remove no-unexpected-multiline rule ([@iansu](https://github.com/iansu)) +- `create-react-app` + - [#7991](https://github.com/facebook/create-react-app/pull/7991) Support templates in scoped packages ([@klasbj](https://github.com/klasbj)) + - [#7839](https://github.com/facebook/create-react-app/pull/7839) added check for typescript template and unsupported node version ([@awaseem](https://github.com/awaseem)) +- `react-scripts` + - [#7860](https://github.com/facebook/create-react-app/pull/7860) Mark TypeScript as an optional peer dependency for react-scripts ([@dstaley](https://github.com/dstaley)) + - [#7822](https://github.com/facebook/create-react-app/pull/7822) Fix absolute paths issue in Jest ([@rovansteen](https://github.com/rovansteen)) + - [#7796](https://github.com/facebook/create-react-app/pull/7796) Fixed process type in TypeScript template. ([@fuszenecker](https://github.com/fuszenecker)) +- `react-dev-utils` + - [#6449](https://github.com/facebook/create-react-app/pull/6449) Edit InterpolateHtmlPlugin hook (#6448) ([@GuiHash](https://github.com/GuiHash)) + +#### :nail_care: Enhancement + +- `cra-template-typescript`, `cra-template` + - [#8005](https://github.com/facebook/create-react-app/pull/8005) Prefix apple-touch-icon links with PUBLIC_URL ([@benblank](https://github.com/benblank)) + - [#7881](https://github.com/facebook/create-react-app/pull/7881) Add @testing-library to the default templates ([@kentcdodds](https://github.com/kentcdodds)) +- `react-scripts` + - [#7989](https://github.com/facebook/create-react-app/pull/7989) Add scripts support to templates ([@mrmckeb](https://github.com/mrmckeb)) + - [#7921](https://github.com/facebook/create-react-app/pull/7921) Add restoreMocks to supported jest config keys ([@ianschmitz](https://github.com/ianschmitz)) + - [#6352](https://github.com/facebook/create-react-app/pull/6352) Add additional information for postcss errors (#6282) ([@buildbreakdo](https://github.com/buildbreakdo)) + - [#6753](https://github.com/facebook/create-react-app/pull/6753) Add Service-Worker header to checkValidServiceWorker ([@darthmaim](https://github.com/darthmaim)) + - [#7832](https://github.com/facebook/create-react-app/pull/7832) feat: add additional Jest keys to whitelist ([@mrmckeb](https://github.com/mrmckeb)) + - [#7022](https://github.com/facebook/create-react-app/pull/7022) Fix node_modules sourcemap config (which will fix VSCode debugging of CRA apps) ([@justingrant](https://github.com/justingrant)) +- `cra-template` + - [#7931](https://github.com/facebook/create-react-app/pull/7931) No spinning React logo if `prefers-reduced-motion` ([@donavon](https://github.com/donavon)) +- `create-react-app`, `react-error-overlay` + - [#7052](https://github.com/facebook/create-react-app/pull/7052) Dark scheme overlay ([@Fabianopb](https://github.com/Fabianopb)) +- `babel-preset-react-app` + - [#7726](https://github.com/facebook/create-react-app/pull/7726) Add babel runtime version to transform-runtime plugin to reduce bundle size ([@topaxi](https://github.com/topaxi)) + +#### :memo: Documentation + +- Other + - [#8050](https://github.com/facebook/create-react-app/pull/8050) Update template docs ([@mrmckeb](https://github.com/mrmckeb)) + - [#7995](https://github.com/facebook/create-react-app/pull/7995) Add contributors section to readme ([@ianschmitz](https://github.com/ianschmitz)) + - [#7896](https://github.com/facebook/create-react-app/pull/7896) chore: Fix broken link for e2e README ([@haruelrovix](https://github.com/haruelrovix)) + - [#7874](https://github.com/facebook/create-react-app/pull/7874) Bump docusaurus 🦖 ([@andriijas](https://github.com/andriijas)) + - [#7819](https://github.com/facebook/create-react-app/pull/7819) 📖 DOC: Improvement ([@waahab](https://github.com/waahab)) + - [#7853](https://github.com/facebook/create-react-app/pull/7853) Update adding-bootstrap.md ([@Xuhao](https://github.com/Xuhao)) + - [#7849](https://github.com/facebook/create-react-app/pull/7849) chore: update README.md gif links ([@cchanxzy](https://github.com/cchanxzy)) + - [#7840](https://github.com/facebook/create-react-app/pull/7840) Link to ASP.NET Core docs ([@Daniel15](https://github.com/Daniel15)) + - [#7841](https://github.com/facebook/create-react-app/pull/7841) Update getting-started.md ([@reactjser](https://github.com/reactjser)) + - [#7809](https://github.com/facebook/create-react-app/pull/7809) Add a note about .eslintignore files being respected ([@seanlaff](https://github.com/seanlaff)) + - [#7686](https://github.com/facebook/create-react-app/pull/7686) Link to React documentation for code splitting ([@Hugodby](https://github.com/Hugodby)) + - [#7785](https://github.com/facebook/create-react-app/pull/7785) Upgrade to docusaurus 2 ([@endiliey](https://github.com/endiliey)) + - [#7824](https://github.com/facebook/create-react-app/pull/7824) Fix grammar error in troubleshooting.md ([@jakeboone02](https://github.com/jakeboone02)) + - [#7823](https://github.com/facebook/create-react-app/pull/7823) Document correct default behavior for HOST var ([@jsejcksn](https://github.com/jsejcksn)) + - [#7815](https://github.com/facebook/create-react-app/pull/7815) Tightens up the TypeScript docs ([@orta](https://github.com/orta)) + - [#7813](https://github.com/facebook/create-react-app/pull/7813) Clarify dynamic import stage in docs ([@aprilandjan](https://github.com/aprilandjan)) +- `react-dev-utils`, `react-scripts` + - [#7972](https://github.com/facebook/create-react-app/pull/7972) Add placeholders where old template READMEs used to be ([@iansu](https://github.com/iansu)) +- `babel-preset-react-app` + - [#7932](https://github.com/facebook/create-react-app/pull/7932) fix seperators typo ([@donavon](https://github.com/donavon)) +- `react-dev-utils` + - [#7897](https://github.com/facebook/create-react-app/pull/7897) chore: Fix broken link for CRA deployment ([@haruelrovix](https://github.com/haruelrovix)) +- `react-scripts` + - [#7852](https://github.com/facebook/create-react-app/pull/7852) Add Alex to lint documentation ([@iansu](https://github.com/iansu)) + - [#7474](https://github.com/facebook/create-react-app/pull/7474) Fix notations of loopback addresses ([@wataash](https://github.com/wataash)) + +#### :house: Internal + +- `react-scripts` + - [#8038](https://github.com/facebook/create-react-app/pull/8038) Add TypeScript peer dependency to react-scripts ([@iansu](https://github.com/iansu)) + - [#7952](https://github.com/facebook/create-react-app/pull/7952) Add tests for optional chaining and null coalescing ([@ianschmitz](https://github.com/ianschmitz)) + - [#7830](https://github.com/facebook/create-react-app/pull/7830) Revert logo in templates ([@iansu](https://github.com/iansu)) +- Other + - [#8029](https://github.com/facebook/create-react-app/pull/8029) Re-enable GitHub Actions ([@iansu](https://github.com/iansu)) + - [#7978](https://github.com/facebook/create-react-app/pull/7978) Temporarily disable GitHub Actions ([@iansu](https://github.com/iansu)) + - [#7789](https://github.com/facebook/create-react-app/pull/7789) Add yarn.lock to .gitignore ([@lukyth](https://github.com/lukyth)) + - [#7878](https://github.com/facebook/create-react-app/pull/7878) Remove alex precommit check ([@iansu](https://github.com/iansu)) + - [#7861](https://github.com/facebook/create-react-app/pull/7861) Add a GitHub Action that runs the build script ([@iansu](https://github.com/iansu)) +- `eslint-config-react-app` + - [#8003](https://github.com/facebook/create-react-app/pull/8003) Use @typescript-eslint/no-unused-expressions to support optional chaining ([@maxdavidson](https://github.com/maxdavidson)) +- `create-react-app` + - [#7844](https://github.com/facebook/create-react-app/pull/7844) added e2e test for checking typescript template with unsupported node ([@awaseem](https://github.com/awaseem)) + - [#7882](https://github.com/facebook/create-react-app/pull/7882) refactor: remove double coerce ([@mrmckeb](https://github.com/mrmckeb)) + - [#7880](https://github.com/facebook/create-react-app/pull/7880) Pass through fully specified template name ([@iansu](https://github.com/iansu)) +- `cra-template-typescript` + - [#7944](https://github.com/facebook/create-react-app/pull/7944) Make base and TypeScript templates consistent ([@suprj](https://github.com/suprj)) +- `create-react-app`, `react-dev-utils`, `react-scripts` + - [#7773](https://github.com/facebook/create-react-app/pull/7773) Temporarily disable Windows in CI ([@ianschmitz](https://github.com/ianschmitz)) + +#### :hammer: Underlying Tools + +- `babel-preset-react-app`, `cra-template-typescript`, `cra-template`, `create-react-app`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#8024](https://github.com/facebook/create-react-app/pull/8024) Bump dependencies ([@ianschmitz](https://github.com/ianschmitz)) +- `create-react-app`, `react-dev-utils`, `react-scripts` + - [#7988](https://github.com/facebook/create-react-app/pull/7988) Bump webpack-dev-server ([@ianschmitz](https://github.com/ianschmitz)) + - [#7876](https://github.com/facebook/create-react-app/pull/7876) Bump styling related loaders ([@andriijas](https://github.com/andriijas)) +- `react-app-polyfill` + - [#7999](https://github.com/facebook/create-react-app/pull/7999) Unpin dependencies in react-app-polyfill ([@ianschmitz](https://github.com/ianschmitz)) +- `babel-preset-react-app`, `react-app-polyfill`, `react-dev-utils`, `react-scripts` + - [#7986](https://github.com/facebook/create-react-app/pull/7986) Bump dependencies ([@ianschmitz](https://github.com/ianschmitz)) +- `react-scripts` + - [#7956](https://github.com/facebook/create-react-app/pull/7956) Upgrade jest-watch-typeahead ([@Andarist](https://github.com/Andarist)) + - [#7870](https://github.com/facebook/create-react-app/pull/7870) Fix eslint complaints in build.js ([@andriijas](https://github.com/andriijas)) + - [#7857](https://github.com/facebook/create-react-app/pull/7857) feat: upgrade terser & enable parallel minification in wsl ([@endiliey](https://github.com/endiliey)) + - [#7856](https://github.com/facebook/create-react-app/pull/7856) Move unused eslint webpack import into @remove-on-eject block ([@mrseanbaines](https://github.com/mrseanbaines)) +- `babel-preset-react-app`, `cra-template-typescript`, `create-react-app`, `react-app-polyfill`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#7951](https://github.com/facebook/create-react-app/pull/7951) Fix CI ([@ianschmitz](https://github.com/ianschmitz)) +- `react-dev-utils` + - [#7910](https://github.com/facebook/create-react-app/pull/7910) Update open ([@andriijas](https://github.com/andriijas)) +- `babel-plugin-named-asset-import`, `babel-preset-react-app`, `react-error-overlay`, `react-scripts` + - [#7814](https://github.com/facebook/create-react-app/pull/7814) Upgrade outdated packages ([@andriijas](https://github.com/andriijas)) +- `react-error-overlay`, `react-scripts` + - [#7875](https://github.com/facebook/create-react-app/pull/7875) Bump react ([@andriijas](https://github.com/andriijas)) + +#### Committers: 42 + +- Abdul Wahab ⚡️ ([@waahab](https://github.com/waahab)) +- Alex Guerra ([@heyimalex](https://github.com/heyimalex)) +- Ali Waseem ([@awaseem](https://github.com/awaseem)) +- Andreas Cederström ([@andriijas](https://github.com/andriijas)) +- Ben Blank ([@benblank](https://github.com/benblank)) +- Brody McKee ([@mrmckeb](https://github.com/mrmckeb)) +- Chun ([@cchanxzy](https://github.com/cchanxzy)) +- Damian Senn ([@topaxi](https://github.com/topaxi)) +- Daniel Lo Nigro ([@Daniel15](https://github.com/Daniel15)) +- Donavon West ([@donavon](https://github.com/donavon)) +- Dylan Staley ([@dstaley](https://github.com/dstaley)) +- Endi ([@endiliey](https://github.com/endiliey)) +- Fabiano Brito ([@Fabianopb](https://github.com/Fabianopb)) +- Guillaume Hertault ([@GuiHash](https://github.com/GuiHash)) +- Havit Rovik ([@haruelrovix](https://github.com/haruelrovix)) +- Hugo David-Boyet ([@Hugodby](https://github.com/Hugodby)) +- Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz)) +- Ian Sutherland ([@iansu](https://github.com/iansu)) +- Jake Boone ([@jakeboone02](https://github.com/jakeboone02)) +- Jesse Jackson ([@jsejcksn](https://github.com/jsejcksn)) +- Jonathan Felchlin ([@GreenGremlin](https://github.com/GreenGremlin)) +- Joshua Robinson ([@buildbreakdo](https://github.com/buildbreakdo)) +- Justin Grant ([@justingrant](https://github.com/justingrant)) +- Kanitkorn Sujautra ([@lukyth](https://github.com/lukyth)) +- Kent C. Dodds ([@kentcdodds](https://github.com/kentcdodds)) +- Klas Björkqvist ([@klasbj](https://github.com/klasbj)) +- Mateusz Burzyński ([@Andarist](https://github.com/Andarist)) +- Max Davidson ([@maxdavidson](https://github.com/maxdavidson)) +- May ([@aprilandjan](https://github.com/aprilandjan)) +- Orta ([@orta](https://github.com/orta)) +- RJ ([@suprj](https://github.com/suprj)) +- Renato Augusto Gama dos Santos ([@renatoagds](https://github.com/renatoagds)) +- Robert FUSZENECKER ([@fuszenecker](https://github.com/fuszenecker)) +- Robert van Steen ([@rovansteen](https://github.com/rovansteen)) +- Sean Baines ([@mrseanbaines](https://github.com/mrseanbaines)) +- Sean Lafferty ([@seanlaff](https://github.com/seanlaff)) +- Tharun Rajendran ([@tharun208](https://github.com/tharun208)) +- Tomáš Hübelbauer ([@TomasHubelbauer](https://github.com/TomasHubelbauer)) +- Wataru Ashihara ([@wataash](https://github.com/wataash)) +- Xuhao ([@Xuhao](https://github.com/Xuhao)) +- [@reactjser](https://github.com/reactjser) +- darthmaim ([@darthmaim](https://github.com/darthmaim)) + +### Migrating from 3.2.0 to 3.3.0 + +Inside any created project that has not been ejected, run: + +```sh +npm install --save --save-exact react-scripts@3.3.0 +``` + +or + +```sh +yarn add --exact react-scripts@3.3.0 +``` + +## 3.2.0 (2019-10-03) + +v3.2.0 is a minor release that adds support for production profiling and ignoring TypeScript type errors to make migrating JavaScript projects to TypeScript easier. It also includes other minor bug fixes and documentation updates. + +#### :rocket: New Feature + +- `react-scripts` + - [#7737](https://github.com/facebook/create-react-app/pull/7737) Support production profiling with React Developer Tools ([@JacobMGEvans](https://github.com/JacobMGEvans)) +- `react-dev-utils`, `react-scripts` + - [#6931](https://github.com/facebook/create-react-app/pull/6931) Adds TSC_COMPILE_ON_ERROR env var... ([@kylebebak](https://github.com/kylebebak)) + +#### :bug: Bug Fix + +- `react-scripts` + - [#7754](https://github.com/facebook/create-react-app/pull/7754) Fix linting error when using rest props ([@alexandrtovmach](https://github.com/alexandrtovmach)) +- `react-app-polyfill` + - [#7205](https://github.com/facebook/create-react-app/pull/7205) Guard polyfills against window possibly being undefined ([@jxom](https://github.com/jxom)) + +#### :nail_care: Enhancement + +- `react-scripts` + - [#7687](https://github.com/facebook/create-react-app/pull/7687) Use installing package manager in README ([@ashr81](https://github.com/ashr81)) + - [#7755](https://github.com/facebook/create-react-app/pull/7755) Support setting baseUrl to root directory ([@rovansteen](https://github.com/rovansteen)) + - [#7530](https://github.com/facebook/create-react-app/pull/7530) only load eslint config when EXTEND_ESLINT environment variable is specified/ do not swallow eslint config errors ([@n1ru4l](https://github.com/n1ru4l)) + - [#7742](https://github.com/facebook/create-react-app/pull/7742) set output.globalObject to 'this' ([@kentcdodds](https://github.com/kentcdodds)) + - [#7721](https://github.com/facebook/create-react-app/pull/7721) Add "entrypoints" key to asset manifest ([@samuelmeuli](https://github.com/samuelmeuli)) + - [#7562](https://github.com/facebook/create-react-app/pull/7562) enable .eslintignore again ([@igtm](https://github.com/igtm)) +- `react-dev-utils` + - [#6980](https://github.com/facebook/create-react-app/pull/6980) Stop hiding the column number of ESLint errors ([@justingrant](https://github.com/justingrant)) + +#### :memo: Documentation + +- [#7302](https://github.com/facebook/create-react-app/pull/7302) docs: note that 2 to 3 migration may require deletion of node_modules ([@kimpers](https://github.com/kimpers)) +- [#7757](https://github.com/facebook/create-react-app/pull/7757) Documentation typo fix: accessbile→accessible ([@tomer](https://github.com/tomer)) +- [#7601](https://github.com/facebook/create-react-app/pull/7601) [Documentation] Updated list of supported Jest config overrides ([@neilbryson](https://github.com/neilbryson)) +- [#7705](https://github.com/facebook/create-react-app/pull/7705) Update runtime chunk name separator in docs ([@samuelmeuli](https://github.com/samuelmeuli)) + +#### :house: Internal + +- `react-scripts` + - [#7752](https://github.com/facebook/create-react-app/pull/7752) Fix wrong letter casing ([@lewislbr](https://github.com/lewislbr)) +- `react-dev-utils`, `react-scripts` + - [#7707](https://github.com/facebook/create-react-app/pull/7707) Remove 'shortcut' link type before 'icon' ([@lewislbr](https://github.com/lewislbr)) + +#### :hammer: Underlying Tools + +- `react-scripts` + - [#7729](https://github.com/facebook/create-react-app/pull/7729) Remove switch case ([@andrelmlins](https://github.com/andrelmlins)) + +#### Committers: 19 + +- Alexandr Tovmach ([@alexandrtovmach](https://github.com/alexandrtovmach)) +- André Lins ([@andrelmlins](https://github.com/andrelmlins)) +- Ashrith Reddy ([@ashr81](https://github.com/ashr81)) +- Federico Zivolo ([@FezVrasta](https://github.com/FezVrasta)) +- Iguchi Tomokatsu ([@igtm](https://github.com/igtm)) +- Jacob M-G Evans ([@JacobMGEvans](https://github.com/JacobMGEvans)) +- Jake Moxey ([@jxom](https://github.com/jxom)) +- Justin Grant ([@justingrant](https://github.com/justingrant)) +- Kent C. Dodds ([@kentcdodds](https://github.com/kentcdodds)) +- Kim Persson ([@kimpers](https://github.com/kimpers)) +- Kyle Bebak ([@kylebebak](https://github.com/kylebebak)) +- Laurin Quast ([@n1ru4l](https://github.com/n1ru4l)) +- Lewis Llobera ([@lewislbr](https://github.com/lewislbr)) +- Rakan Nimer ([@rakannimer](https://github.com/rakannimer)) +- Reece Dunham ([@RDIL](https://github.com/RDIL)) +- Robert van Steen ([@rovansteen](https://github.com/rovansteen)) +- Samuel Meuli ([@samuelmeuli](https://github.com/samuelmeuli)) +- Tomer Cohen ([@tomer](https://github.com/tomer)) +- neilbryson ([@neilbryson](https://github.com/neilbryson)) + +### Migrating from 3.1.2 to 3.2.0 + +Inside any created project that has not been ejected, run: + +```sh +npm install --save --save-exact react-scripts@3.2.0 +``` + +or + +```sh +yarn add --exact react-scripts@3.2.0 +``` + +## 3.1.2 (2019-09-19) + +v3.1.2 is a maintenance release that includes minor bug fixes and documentation updates. + +#### :bug: Bug Fix + +- `react-scripts` + - [#7679](https://github.com/facebook/create-react-app/pull/7679) Change runtime chunk name separator from tilde to dash ([@javadoug](https://github.com/javadoug)) + - [#7538](https://github.com/facebook/create-react-app/pull/7538) Explicitly checking that EXTEND_ESLINT is true ([@BrockWills](https://github.com/BrockWills)) +- `babel-preset-react-app`, `react-error-overlay`, `react-scripts` + - [#7662](https://github.com/facebook/create-react-app/pull/7662) Fix build ([@ianschmitz](https://github.com/ianschmitz)) + +#### :nail_care: Enhancement + +- `react-scripts` + - [#7704](https://github.com/facebook/create-react-app/pull/7704) Add new logo ([@iansu](https://github.com/iansu)) + - [#7587](https://github.com/facebook/create-react-app/pull/7587) Minor performance improvements ([@deftomat](https://github.com/deftomat)) + - [#7633](https://github.com/facebook/create-react-app/pull/7633) Disable babel-loader's cacheCompression ([@jleclanche](https://github.com/jleclanche)) + +#### :memo: Documentation + +- [#7616](https://github.com/facebook/create-react-app/pull/7616) Update deployment.md with another AWS example ([@AndrewBestbier](https://github.com/AndrewBestbier)) +- [#7663](https://github.com/facebook/create-react-app/pull/7663) Remove --single-quote from prettier examples ([@brlewis](https://github.com/brlewis)) +- [#7659](https://github.com/facebook/create-react-app/pull/7659) Update running-tests.md ([@weyert](https://github.com/weyert)) +- [#7459](https://github.com/facebook/create-react-app/pull/7459) Update troubleshooting.md ([@prevostc](https://github.com/prevostc)) +- [#7650](https://github.com/facebook/create-react-app/pull/7650) Adopt Contributor Covenant ([@iansu](https://github.com/iansu)) +- [#7620](https://github.com/facebook/create-react-app/pull/7620) cleanup-after-each is no longer necessary! ([@iHmD](https://github.com/iHmD)) +- [#7613](https://github.com/facebook/create-react-app/pull/7613) Fix seams between changelog majors ([@emilpalsson](https://github.com/emilpalsson)) +- [#7368](https://github.com/facebook/create-react-app/pull/7368) Correcting proxy sample ([@szabolcs-szilagyi](https://github.com/szabolcs-szilagyi)) +- [#7536](https://github.com/facebook/create-react-app/pull/7536) add a migration step to remove static from robots.txt ([@lookfirst](https://github.com/lookfirst)) +- [#7521](https://github.com/facebook/create-react-app/pull/7521) Show logo for mobile views in create-react-app.dev ([@GrooChu](https://github.com/GrooChu)) + +#### :house: Internal + +- `react-scripts` + - [#7526](https://github.com/facebook/create-react-app/pull/7526) The variable dotenvFiles is never reassigned - use const instead ([@Primajin](https://github.com/Primajin)) + - [#7585](https://github.com/facebook/create-react-app/pull/7585) remove trailing spaces ([@xiaoxiangmoe](https://github.com/xiaoxiangmoe)) + +#### :hammer: Underlying Tools + +- `babel-plugin-named-asset-import`, `confusing-browser-globals`, `react-app-polyfill`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#7681](https://github.com/facebook/create-react-app/pull/7681) Bump dependencies ([@ianschmitz](https://github.com/ianschmitz)) +- `react-scripts` + - [#7531](https://github.com/facebook/create-react-app/pull/7531) Upgrade dotenv-expand to fix issues ([@DominicTobias](https://github.com/DominicTobias)) +- `eslint-config-react-app`, `react-scripts` + - [#7540](https://github.com/facebook/create-react-app/pull/7540) Bump version of @typescript-eslint/\* ([@pierreneter](https://github.com/pierreneter)) + +#### Committers: 20 + +- Andrew ([@AndrewBestbier](https://github.com/AndrewBestbier)) +- Brock Wills ([@BrockWills](https://github.com/BrockWills)) +- Clément Prévost ([@prevostc](https://github.com/prevostc)) +- Dominic Tobias ([@DominicTobias](https://github.com/DominicTobias)) +- Doug Ross ([@javadoug](https://github.com/javadoug)) +- Emil Pålsson ([@emilpalsson](https://github.com/emilpalsson)) +- Federico Zivolo ([@FezVrasta](https://github.com/FezVrasta)) +- Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz)) +- Ian Sutherland ([@iansu](https://github.com/iansu)) +- Jannis Hell ([@Primajin](https://github.com/Primajin)) +- Jerome Leclanche ([@jleclanche](https://github.com/jleclanche)) +- Jon Stevens ([@lookfirst](https://github.com/lookfirst)) +- Sabesh Rajendran ([@GrooChu](https://github.com/GrooChu)) +- Tomáš Szabo ([@deftomat](https://github.com/deftomat)) +- Weyert de Boer ([@weyert](https://github.com/weyert)) +- ZHAO Jinxiang ([@xiaoxiangmoe](https://github.com/xiaoxiangmoe)) +- [@brlewis](https://github.com/brlewis) +- [@iHmD](https://github.com/iHmD) +- [@pierreneter](https://github.com/pierreneter) +- szabi ([@szabolcs-szilagyi](https://github.com/szabolcs-szilagyi)) + +### Migrating from 3.1.1 to 3.1.2 + +Inside any created project that has not been ejected, run: + +```sh +npm install --save --save-exact react-scripts@3.1.2 +``` + +or + +```sh +yarn add --exact react-scripts@3.1.2 +``` + +## 3.1.1 (2019-08-13) + +v3.1.1 is a maintenance release that includes minor bug fixes and documentation updates. + +#### :bug: Bug Fix + +- `react-scripts` + - [#7513](https://github.com/facebook/create-react-app/pull/7513) Fix ESLint 6 support ([@ianschmitz](https://github.com/ianschmitz)) + - [#7508](https://github.com/facebook/create-react-app/pull/7508) Don't block static files in robots.txt ([@iansu](https://github.com/iansu)) + +#### :nail_care: Enhancement + +- `eslint-config-react-app` + - [#7393](https://github.com/facebook/create-react-app/pull/7393) Ignore "jsx-a11y/aria-role" for React components ([@deftomat](https://github.com/deftomat)) + +#### :memo: Documentation + +- [#7527](https://github.com/facebook/create-react-app/pull/7527) Update Netlify config ([@iansu](https://github.com/iansu)) +- [#7500](https://github.com/facebook/create-react-app/pull/7500) Add links to Spectrum in README and docs ([@iansu](https://github.com/iansu)) + +#### Committers: 3 + +- Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz)) +- Ian Sutherland ([@iansu](https://github.com/iansu)) +- Tomáš Szabo ([@deftomat](https://github.com/deftomat)) + +### Migrating from 3.1.0 to 3.1.1 + +Optionally remove `Disallow: /static/` from `public/robots.txt` if you want to allow your images and other static files to be indexed by search engines [#7508](https://github.com/facebook/create-react-app/pull/7508) + +Inside any created project that has not been ejected, run: + +```sh +npm install --save --save-exact react-scripts@3.1.1 +``` + +or + +```sh +yarn add --exact react-scripts@3.1.1 +``` + +## 3.1.0 (2019-08-09) + +v3.1.0 is a minor release that adds ESLint 6 support as well as experimental support for extended and customizing the ESLint config along with other minor bug fixes and documentation updates. The upgrade to ESLint 6 is a breaking change _only_ if you're using `eslint-config-react-app` or `react-error-overlay` outside of Create React App. + +# Highlights + +- ESLint 6: #7415 +- Experimental ESLint config customization: #7036 +- More Jest config options: #6055 +- Option to configure or disable image inlining: #6060 + +#### :rocket: New Feature + +- `eslint-config-react-app`, `react-error-overlay`, `react-scripts` + - [#7415](https://github.com/facebook/create-react-app/pull/7415) Add ESLint 6 support ([@mrmckeb](https://github.com/mrmckeb)) +- `eslint-config-react-app`, `react-scripts` + - [#7036](https://github.com/facebook/create-react-app/pull/7036) Add ESLint extend support to eslint-loader ([@mrmckeb](https://github.com/mrmckeb)) +- `react-dev-utils` + - [#7277](https://github.com/facebook/create-react-app/pull/7277) Handle browser arguments ([@arvigeus](https://github.com/arvigeus)) +- `react-scripts` + - [#6060](https://github.com/facebook/create-react-app/pull/6060) Add environment variable to control image inlining threshold ([@peterbe](https://github.com/peterbe)) + - [#6055](https://github.com/facebook/create-react-app/pull/6055) Support for graceful extension of Jest config ([@jamesmfriedman](https://github.com/jamesmfriedman)) + +#### :boom: Breaking Change + +- `eslint-config-react-app`, `react-error-overlay`, `react-scripts` + - [#7415](https://github.com/facebook/create-react-app/pull/7415) Add ESLint 6 support ([@mrmckeb](https://github.com/mrmckeb)) + +#### :bug: Bug Fix + +- `react-dev-utils` + - [#7444](https://github.com/facebook/create-react-app/pull/7444) Fix for #6720: HMR not working in Firefox if proxy option present ([@dmile](https://github.com/dmile)) +- `react-scripts` + - [#5829](https://github.com/facebook/create-react-app/pull/5829) Resolve relative paths for preprocessor styles ([@iamandrewluca](https://github.com/iamandrewluca)) + - [#7433](https://github.com/facebook/create-react-app/pull/7433) Add explicit check for --watchAll=false ([@mrmckeb](https://github.com/mrmckeb)) + - [#7378](https://github.com/facebook/create-react-app/pull/7378) Update url-loader to 2.0.1 ([@heyimalex](https://github.com/heyimalex)) +- `eslint-config-react-app` + - [#7230](https://github.com/facebook/create-react-app/pull/7230) jsx-no-duplicate-props ignore case fix ([@rommguy](https://github.com/rommguy)) + - [#7219](https://github.com/facebook/create-react-app/pull/7219) fix: eslintrc overrides key should be an array, not object ([@ivan-aksamentov](https://github.com/ivan-aksamentov)) + - [#7079](https://github.com/facebook/create-react-app/pull/7079) Adjust typescript-eslint to not warn about typedefs when used before defined ([@vincentjames501](https://github.com/vincentjames501)) +- `react-error-overlay`, `react-scripts` + - [#7257](https://github.com/facebook/create-react-app/pull/7257) Upgrade webpack to 4.35.0 to fix dynamic import issue ([@iansu](https://github.com/iansu)) + +#### :nail_care: Enhancement + +- `react-scripts` + - [#7497](https://github.com/facebook/create-react-app/pull/7497) add readonly modifier for css module ([@xiaoxiangmoe](https://github.com/xiaoxiangmoe)) + - [#7496](https://github.com/facebook/create-react-app/pull/7496) bump sass-loader ([@xiaoxiangmoe](https://github.com/xiaoxiangmoe)) + - [#7176](https://github.com/facebook/create-react-app/pull/7176) Fix RegExp from navigateFallbackBlacklist (workbox) ([@nuragic](https://github.com/nuragic)) + - [#7080](https://github.com/facebook/create-react-app/pull/7080) Support configuring coveragePathIgnorePatterns ([@kentcdodds](https://github.com/kentcdodds)) + - [#7482](https://github.com/facebook/create-react-app/pull/7482) 100% lighthouse score for progressive web app ([@dscanlan](https://github.com/dscanlan)) + - [#5951](https://github.com/facebook/create-react-app/pull/5951) Set jsonpFunction by default ([@sibiraj-s](https://github.com/sibiraj-s)) + - [#7472](https://github.com/facebook/create-react-app/pull/7472) Typescript init: suggest `jsx: "react"` in tsconfig ([@kingdaro](https://github.com/kingdaro)) + - [#7118](https://github.com/facebook/create-react-app/pull/7118) Append title element to SVG component via title prop ([@sudkumar](https://github.com/sudkumar)) +- `react-dev-utils` + - [#7028](https://github.com/facebook/create-react-app/pull/7028) Add vscodium to the editor list ([@leonardodino](https://github.com/leonardodino)) + - [#7277](https://github.com/facebook/create-react-app/pull/7277) Handle browser arguments ([@arvigeus](https://github.com/arvigeus)) +- `eslint-config-react-app`, `react-error-overlay`, `react-scripts` + - [#7415](https://github.com/facebook/create-react-app/pull/7415) Add ESLint 6 support ([@mrmckeb](https://github.com/mrmckeb)) +- `eslint-config-react-app` + - [#7179](https://github.com/facebook/create-react-app/pull/7179) Disabled Typescript no-undef rule per typescript-eslint #477 ([@andyhopp](https://github.com/andyhopp)) +- `create-react-app` + - [#6941](https://github.com/facebook/create-react-app/pull/6941) Fix compatibility of create-react-app to Node.js v0.10+ ([@tobiasbueschel](https://github.com/tobiasbueschel)) + +#### :memo: Documentation + +- Other + - [#7488](https://github.com/facebook/create-react-app/pull/7488) Adjusted deployment documentation for ZEIT Now ([@leo](https://github.com/leo)) + - [#7462](https://github.com/facebook/create-react-app/pull/7462) Added dependencies to bootstrap article when using custom SCSS. ([@eclectic-coding](https://github.com/eclectic-coding)) + - [#7340](https://github.com/facebook/create-react-app/pull/7340) Update testing-library related npm package names in README ([@balazsorban44](https://github.com/balazsorban44)) + - [#7423](https://github.com/facebook/create-react-app/pull/7423) Add question issue template ([@iansu](https://github.com/iansu)) + - [#7260](https://github.com/facebook/create-react-app/pull/7260) Docs: remove an outdated TypeScript-related note ([@MidnightDesign](https://github.com/MidnightDesign)) + - [#7372](https://github.com/facebook/create-react-app/pull/7372) proposal dynamic import are stage 4 ([@gespispace](https://github.com/gespispace)) + - [#7374](https://github.com/facebook/create-react-app/pull/7374) docs(svg): add tip for title props accessibility ([@sudkumar](https://github.com/sudkumar)) + - [#7182](https://github.com/facebook/create-react-app/pull/7182) Update minimum Node versions in docs ([@JESii](https://github.com/JESii)) + - [#7317](https://github.com/facebook/create-react-app/pull/7317) Fix typo ([@mvasin](https://github.com/mvasin)) + - [#7262](https://github.com/facebook/create-react-app/pull/7262) Docs: replace the command line to install relay/macro ([@soufDev](https://github.com/soufDev)) + - [#7170](https://github.com/facebook/create-react-app/pull/7170) Update deprecated package reference ([@bnewcomb](https://github.com/bnewcomb)) + - [#7133](https://github.com/facebook/create-react-app/pull/7133) Make the OOM abreviation more clear ([@tlehtimaki](https://github.com/tlehtimaki)) + - [#7086](https://github.com/facebook/create-react-app/pull/7086) Improve breaking changes info for CRA 3.0.0 ([@falldowngoboone](https://github.com/falldowngoboone)) + - [#7059](https://github.com/facebook/create-react-app/pull/7059) Correct spelling of browserslist ([@amyrlam](https://github.com/amyrlam)) + - [#7039](https://github.com/facebook/create-react-app/pull/7039) docs: fix env-cmd example in deployment section ([@VMois](https://github.com/VMois)) + - [#7041](https://github.com/facebook/create-react-app/pull/7041) Updates the relay docs ([@orta](https://github.com/orta)) +- `eslint-config-react-app` + - [#7451](https://github.com/facebook/create-react-app/pull/7451) Update README for ESLint config ([@mrmckeb](https://github.com/mrmckeb)) + - [#7274](https://github.com/facebook/create-react-app/pull/7274) Update peer dependencies ([@ThewBear](https://github.com/ThewBear)) +- `react-error-overlay`, `react-scripts` + - [#7355](https://github.com/facebook/create-react-app/pull/7355) Fix typos ([@minho42](https://github.com/minho42)) + +#### :house: Internal + +- `babel-preset-react-app` + - [#5818](https://github.com/facebook/create-react-app/pull/5818) Remove unused dependencies in babel-preset-react-app ([@iansu](https://github.com/iansu)) + - [#7208](https://github.com/facebook/create-react-app/pull/7208) Use correct babel transform for dynamic import in dependencies ([@jamesknelson](https://github.com/jamesknelson)) +- `react-scripts` + - [#7433](https://github.com/facebook/create-react-app/pull/7433) Add explicit check for --watchAll=false ([@mrmckeb](https://github.com/mrmckeb)) + - [#6877](https://github.com/facebook/create-react-app/pull/6877) Upgrade svgr to 4.2.0 ([@iansu](https://github.com/iansu)) +- Other + - [#7385](https://github.com/facebook/create-react-app/pull/7385) Attempt at fixing CI issue on windows ([@heyimalex](https://github.com/heyimalex)) + - [#7269](https://github.com/facebook/create-react-app/pull/7269) Update issue templates ([@mrmckeb](https://github.com/mrmckeb)) + - [#7220](https://github.com/facebook/create-react-app/pull/7220) Disable Travis build ([@ianschmitz](https://github.com/ianschmitz)) + - [#7096](https://github.com/facebook/create-react-app/pull/7096) Add Azure DevOps build pipeline ([@ianschmitz](https://github.com/ianschmitz)) + - [#6858](https://github.com/facebook/create-react-app/pull/6858) Add test to make sure .d.ts files are ignored when checking for TypeScript ([@iansu](https://github.com/iansu)) +- `react-error-overlay`, `react-scripts` + - [#7355](https://github.com/facebook/create-react-app/pull/7355) Fix typos ([@minho42](https://github.com/minho42)) + +#### :hammer: Underlying Tools + +- `babel-plugin-named-asset-import`, `babel-preset-react-app`, `confusing-browser-globals`, `create-react-app`, `react-app-polyfill`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#7473](https://github.com/facebook/create-react-app/pull/7473) Bump dependencies ([@ianschmitz](https://github.com/ianschmitz)) +- `eslint-config-react-app`, `react-error-overlay`, `react-scripts` + - [#7415](https://github.com/facebook/create-react-app/pull/7415) Add ESLint 6 support ([@mrmckeb](https://github.com/mrmckeb)) +- `eslint-config-react-app`, `react-scripts` + - [#7036](https://github.com/facebook/create-react-app/pull/7036) Add ESLint extend support to eslint-loader ([@mrmckeb](https://github.com/mrmckeb)) +- `react-scripts` + - [#7118](https://github.com/facebook/create-react-app/pull/7118) Append title element to SVG component via title prop ([@sudkumar](https://github.com/sudkumar)) + - [#7222](https://github.com/facebook/create-react-app/pull/7222) Update @typescript-eslint package versions ([@ianschmitz](https://github.com/ianschmitz)) + - [#7131](https://github.com/facebook/create-react-app/pull/7131) Update fsevents dependency version ([@eps1lon](https://github.com/eps1lon)) +- `react-dev-utils` + - [#7058](https://github.com/facebook/create-react-app/pull/7058) fix: Replaced opn (deprecated) with open ([@jamesgeorge007](https://github.com/jamesgeorge007)) + +#### Committers: 46 + +- Adeel Imran ([@adeelibr](https://github.com/adeelibr)) +- Alex Guerra ([@heyimalex](https://github.com/heyimalex)) +- Amy Lam ([@amyrlam](https://github.com/amyrlam)) +- Andrea Puddu ([@nuragic](https://github.com/nuragic)) +- Andrew Luca ([@iamandrewluca](https://github.com/iamandrewluca)) +- Andy Hopper ([@andyhopp](https://github.com/andyhopp)) +- Balázs Orbán ([@balazsorban44](https://github.com/balazsorban44)) +- Ben Newcomb ([@bnewcomb](https://github.com/bnewcomb)) +- Brian Muenzenmeyer ([@bmuenzenmeyer](https://github.com/bmuenzenmeyer)) +- Brody McKee ([@mrmckeb](https://github.com/mrmckeb)) +- Chuck ([@eclectic-coding](https://github.com/eclectic-coding)) +- Darius Tall ([@kingdaro](https://github.com/kingdaro)) +- Dmitry Lepskiy ([@dmile](https://github.com/dmile)) +- Guy Romm ([@rommguy](https://github.com/rommguy)) +- Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz)) +- Ian Sutherland ([@iansu](https://github.com/iansu)) +- Igor Muchychka ([@mucsi96](https://github.com/mucsi96)) +- Ivan Aksamentov ([@ivan-aksamentov](https://github.com/ivan-aksamentov)) +- Ivan Pegashev ([@gespispace](https://github.com/gespispace)) +- Jack Cross ([@crosscompile](https://github.com/crosscompile)) +- James Friedman ([@jamesmfriedman](https://github.com/jamesmfriedman)) +- James George ([@jamesgeorge007](https://github.com/jamesgeorge007)) +- James K Nelson ([@jamesknelson](https://github.com/jamesknelson)) +- Jon Seidel ([@JESii](https://github.com/JESii)) +- Kent C. Dodds ([@kentcdodds](https://github.com/kentcdodds)) +- Leo Lamprecht ([@leo](https://github.com/leo)) +- Leonardo Dino ([@leonardodino](https://github.com/leonardodino)) +- Mikhail Vasin ([@mvasin](https://github.com/mvasin)) +- Min ho Kim ([@minho42](https://github.com/minho42)) +- Nikolay Stoynov ([@arvigeus](https://github.com/arvigeus)) +- Orta ([@orta](https://github.com/orta)) +- Peter Bengtsson ([@peterbe](https://github.com/peterbe)) +- Rudolph Gottesheim ([@MidnightDesign](https://github.com/MidnightDesign)) +- Ryan Boone ([@falldowngoboone](https://github.com/falldowngoboone)) +- Ryan Marsh ([@ryanwmarsh](https://github.com/ryanwmarsh)) +- Sebastian Silbermann ([@eps1lon](https://github.com/eps1lon)) +- Sibiraj ([@sibiraj-s](https://github.com/sibiraj-s)) +- Soufiane AIT AKKACHE ([@soufDev](https://github.com/soufDev)) +- Sudhir Mitharwal ([@sudkumar](https://github.com/sudkumar)) +- Thew Dhanat ([@ThewBear](https://github.com/ThewBear)) +- Tobias Büschel ([@tobiasbueschel](https://github.com/tobiasbueschel)) +- Toni ([@tlehtimaki](https://github.com/tlehtimaki)) +- Vincent Pizzo ([@vincentjames501](https://github.com/vincentjames501)) +- Vladyslav Moisieienkov ([@VMois](https://github.com/VMois)) +- ZHAO Jinxiang ([@xiaoxiangmoe](https://github.com/xiaoxiangmoe)) +- dominic scanlan ([@dscanlan](https://github.com/dscanlan)) + +### Migrating from 3.0.1 to 3.1.0 + +Inside any created project that has not been ejected, run: + +```sh +npm install --save --save-exact react-scripts@3.1.0 +``` + +or + +```sh +yarn add --exact react-scripts@3.1.0 +``` + +## 3.0.1 (2019-05-08) + +v3.0.1 is a maintenance release that adjusts some ESLint rules for TypeScript along with other minor bug fixes and documentation updates. + +#### :boom: Breaking Change + +- `babel-preset-react-app` + - [#6887](https://github.com/facebook/create-react-app/pull/6887) Update dependencies of Babel preset with recent changes ([@skoging](https://github.com/skoging)) + +#### :bug: Bug Fix + +- `react-error-overlay`, `react-scripts` + - [#7007](https://github.com/facebook/create-react-app/pull/7007) Unpin `babel-jest` ([@ianschmitz](https://github.com/ianschmitz)) + - [#7002](https://github.com/facebook/create-react-app/pull/7002) Temporary fix for `babel-jest` preflight error ([@ianschmitz](https://github.com/ianschmitz)) +- `eslint-config-react-app` + - [#6987](https://github.com/facebook/create-react-app/pull/6987) Disable `no-dupe-class-members` rule for TypeScript ([@ianschmitz](https://github.com/ianschmitz)) + - [#6862](https://github.com/facebook/create-react-app/pull/6862) Fix `no-useless-constructor` rule in TypeScript ([@ianschmitz](https://github.com/ianschmitz)) +- `eslint-config-react-app`, `react-scripts` + - [#6937](https://github.com/facebook/create-react-app/pull/6937) Disable `default-case` lint rule for TypeScript ([@ianschmitz](https://github.com/ianschmitz)) +- `react-dev-utils` + - [#6876](https://github.com/facebook/create-react-app/pull/6876) Change cssmodule classname hash to use relative paths ([@vg-stan](https://github.com/vg-stan)) + +#### :nail_care: Enhancement + +- `react-dev-utils`, `react-scripts` + - [#6856](https://github.com/facebook/create-react-app/pull/6856) Adds the configuration for PnP/Typescript ([@arcanis](https://github.com/arcanis)) +- `babel-preset-react-app` + - [#6887](https://github.com/facebook/create-react-app/pull/6887) Update dependencies of Babel preset with recent changes ([@skoging](https://github.com/skoging)) +- `react-scripts` + - [#6706](https://github.com/facebook/create-react-app/pull/6706) Generate SVG component name in Jest fileTransform ([@dallonf](https://github.com/dallonf)) + - [#6300](https://github.com/facebook/create-react-app/pull/6300) Remove body padding reset from templates ([@Hurtak](https://github.com/Hurtak)) + +#### :memo: Documentation + +- Other + - [#6979](https://github.com/facebook/create-react-app/pull/6979) Add note to restart the dev server after changing .env file ([@MostafaNawara](https://github.com/MostafaNawara)) + - [#6945](https://github.com/facebook/create-react-app/pull/6945) Add clarifying note to TypeScript docs warning about global install of CRA ([@methodbox](https://github.com/methodbox)) + - [#6898](https://github.com/facebook/create-react-app/pull/6898) Update GraphQL docs ([@nagman](https://github.com/nagman)) + - [#6810](https://github.com/facebook/create-react-app/pull/6810) Call to action button now reacts to being hovered ([@joerez](https://github.com/joerez)) + - [#6881](https://github.com/facebook/create-react-app/pull/6881) Fix typo in deployment docs ([@david-cho-lerat-HL2](https://github.com/david-cho-lerat-HL2)) +- `react-app-polyfill` + - [#6879](https://github.com/facebook/create-react-app/pull/6879) Update README.md ([@david-cho-lerat-HL2](https://github.com/david-cho-lerat-HL2)) + +#### :house: Internal + +- `react-scripts` + - [#6854](https://github.com/facebook/create-react-app/pull/6854) Remove `Object.assign` from `MiniCssExtractPlugin` options ([@swashcap](https://github.com/swashcap)) + +#### Committers: 12 + +- Chris Shaffer ([@methodbox](https://github.com/methodbox)) +- Cory Reed ([@swashcap](https://github.com/swashcap)) +- Dallon Feldner ([@dallonf](https://github.com/dallonf)) +- David Cho-Lerat ([@david-cho-lerat-HL2](https://github.com/david-cho-lerat-HL2)) +- Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz)) +- Joe Rezendes ([@joerez](https://github.com/joerez)) +- Maël Nison ([@arcanis](https://github.com/arcanis)) +- Mostafa Nawara ([@MostafaNawara](https://github.com/MostafaNawara)) +- Petr Huřťák ([@Hurtak](https://github.com/Hurtak)) +- Tore Hammervoll ([@skoging](https://github.com/skoging)) +- [@nagman](https://github.com/nagman) +- [@vg-stan](https://github.com/vg-stan) + +### Migrating from 3.0.0 to 3.0.1 + +Inside any created project that has not been ejected, run: + +```sh +npm install --save --save-exact react-scripts@3.0.1 +``` + +or + +```sh +yarn add --exact react-scripts@3.0.1 +``` + +## 3.0.0 (April 22, 2019) + +Create React App 3.0 brings some exciting new features including support for [Hooks](https://reactjs.org/docs/hooks-intro.html)! + +Thanks to all the maintainers and contributors who worked so hard on this release! :tada: + +# Highlights + +- Jest 24: #6278 +- Hooks support: #5997 +- TypeScript linting: #6513 +- `browserslist` support in @babel/preset-env: #6608 +- Absolute imports using `jsconfig.json`/`tsconfig.json`: #6656 + +# Migrating from 2.1.x to 3.0.0 + +Inside any created project that has not been ejected, run: + +```bash +npm install --save --save-exact react-scripts@3.0.0 +``` + +or + +``` +yarn add --exact react-scripts@3.0.0 +``` + +**NOTE: You may need to delete your `node_modules` folder and reinstall your dependencies by running `yarn` (or `npm install`) if you encounter errors after upgrading.** + +If you previously ejected but now want to upgrade, one common solution is to find the commits where you ejected (and any subsequent commits changing the configuration), revert them, upgrade, and later optionally eject again. It’s also possible that the feature you ejected for is now supported out of the box. + +## Breaking Changes + +Like any major release, `react-scripts@3.0.0` contains a few breaking changes. We expect that they won't affect every user, but we recommend you look over this section to see if something is relevant to you. If we missed something, please file a new issue. + +### Jest 24 + +We've updated from Jest 23 to get the latest improvements in Jest 24. We've noticed some differences in snapshot serialization in Jest 24, so you may need to adjust your tests slightly once you update. You can read more about what's changed in the [Jest 24 blog post](https://jestjs.io/blog/2019/01/25/jest-24-refreshing-polished-typescript-friendly). + +### Hooks support + +We now enforce [Rules of Hooks](https://reactjs.org/docs/hooks-rules.html) with `eslint-plugin-react-hooks`. If you are breaking any of the rules of Hooks this will cause your build to fail. + +### TypeScript linting + +We now lint TypeScript files. You can see the list of [rules we enforce](https://github.com/facebook/create-react-app/blob/eee8491d57d67dd76f0806a7512eaba2ce9c36f0/packages/eslint-config-react-app/index.js#L89:L98) to check if your project is compatible. If you're using Visual Studio Code you can follow our guide to [setup up your editor to display lint warnings](https://facebook.github.io/create-react-app/docs/setting-up-your-editor#displaying-lint-output-in-the-editor). + +### `browserslist` support in @babel/preset-env + +The `browserslist` config in your `package.json` is now used to control the output of your JavaScript files. You can use separate configuration for `development` and `production`. See [here](https://github.com/facebook/create-react-app/blob/b0cbf2caa18ee8267855b14578ebc3dee826f552/packages/react-scripts/package.json#L83-L94) for a good starting point which gives a good development experience, especially when using language features such as async/await, but still provides high compatibility with many browsers in production + +### Remove --no-watch flag + +We've removed the `--no-watch` flag from the `start` script in favor of Jest's own `--watchAll=false`. + +### New structure in `asset-manifest.json` + +All asset paths have been moved under the `files` key in `asset-manifest.json`. + +## New Features + +### using `jsconfig.json`/`tsconfig.json` + +We now support setting `baseUrl` in `jsconfig.json` and `tsconfig.json`. To configure `baseUrl` to point to the `src` directory in your JavaScript project, create a `jsconfig.json` file in your project root: + +```json +{ + "compilerOptions": { + "baseUrl": "src" + }, + "include": ["src"] +} +``` + +If you have a TypeScript project you can configure `baseUrl` the same way in your `tsconfig.json`. + +Currently the only supported options for `baseUrl` are `node_modules` (the default) and `src`. + +### PostCSS Normalize + +You can now include a version of Normalize.css in your project that will use your `browserslist` setting to generate the appropriate styles for your target browsers. To include it simply add `@import-normalize` at the top of one of your CSS files. + +# Detailed Changelog + +#### :rocket: New Feature + +- `react-scripts` + - [#6656](https://github.com/facebook/create-react-app/pull/6656) Set baseUrl from jsconfig.json/tsconfig.json ([@rovansteen](https://github.com/rovansteen)) + - [#5810](https://github.com/facebook/create-react-app/pull/5810) Adds PostCSS Normalize ([@mrchief](https://github.com/mrchief)) +- `babel-plugin-named-asset-import`, `confusing-browser-globals`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#6278](https://github.com/facebook/create-react-app/pull/6278) Update to Jest 24 ([@loryman](https://github.com/loryman)) +- `eslint-config-react-app`, `react-scripts` + - [#6513](https://github.com/facebook/create-react-app/pull/6513) Add TypeScript linting support ([@ianschmitz](https://github.com/ianschmitz)) +- `babel-preset-react-app`, `eslint-config-react-app`, `react-scripts` + - [#5997](https://github.com/facebook/create-react-app/pull/5997) Support React Hooks (#5602) ([@eivind88](https://github.com/eivind88)) +- `babel-preset-react-app`, `react-dev-utils`, `react-scripts` + - [#6608](https://github.com/facebook/create-react-app/pull/6608) Support browserslist in @babel/preset-env ([@ianschmitz](https://github.com/ianschmitz)) + +#### :boom: Breaking Change + +- `react-scripts` + - [#6848](https://github.com/facebook/create-react-app/pull/6848) Remove no-watch flag in favor of watchAll=false ([@bugzpodder](https://github.com/bugzpodder)) + - [#6821](https://github.com/facebook/create-react-app/pull/6821) Add custom function to generate asset manifest ([@iansu](https://github.com/iansu)) + - [#6750](https://github.com/facebook/create-react-app/pull/6750) change NODE_ENV and PUBLIC_URL into readonly ([@xiaoxiangmoe](https://github.com/xiaoxiangmoe)) + - [#4176](https://github.com/facebook/create-react-app/pull/4176) Remove --coverage + --watch workaround for the test command ([@stipsan](https://github.com/stipsan)) + - [#6615](https://github.com/facebook/create-react-app/pull/6615) Allow .json type checking ([@ianschmitz](https://github.com/ianschmitz)) + - [#6821](https://github.com/facebook/create-react-app/pull/6821) Add custom function to generate asset manifest ([@iansu](https://github.com/iansu)) +- `babel-preset-react-app`, `react-app-polyfill` + - [#6769](https://github.com/facebook/create-react-app/pull/6769) Update to core-js@3 ([@ianschmitz](https://github.com/ianschmitz)) +- `babel-plugin-named-asset-import`, `confusing-browser-globals`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#6278](https://github.com/facebook/create-react-app/pull/6278) Update to Jest 24 ([@loryman](https://github.com/loryman)) +- `eslint-config-react-app`, `react-scripts` + - [#6513](https://github.com/facebook/create-react-app/pull/6513) Add TypeScript linting support ([@ianschmitz](https://github.com/ianschmitz)) +- `babel-preset-react-app`, `eslint-config-react-app`, `react-scripts` + - [#5997](https://github.com/facebook/create-react-app/pull/5997) Support React Hooks (#5602) ([@eivind88](https://github.com/eivind88)) +- `babel-preset-react-app`, `react-dev-utils`, `react-scripts` + - [#6608](https://github.com/facebook/create-react-app/pull/6608) Support browserslist in @babel/preset-env ([@ianschmitz](https://github.com/ianschmitz)) + +#### :bug: Bug Fix + +- `react-dev-utils` + - [#6735](https://github.com/facebook/create-react-app/pull/6735) InlineChunkHtmlPlugin works with empty publicPath ([@ItalyPaleAle](https://github.com/ItalyPaleAle)) +- `react-scripts` + - [#6732](https://github.com/facebook/create-react-app/pull/6732) fix: terser-webpack-plugin hanging on WSL ([@endiliey](https://github.com/endiliey)) + - [#6610](https://github.com/facebook/create-react-app/pull/6610) Convert JSON.stringify \n to os.EOL ([@MikeBeaton](https://github.com/MikeBeaton)) +- `create-react-app` + - [#6759](https://github.com/facebook/create-react-app/pull/6759) Fix unlogged yarn pnp message ([@heyimalex](https://github.com/heyimalex)) + +#### :nail_care: Enhancement + +- `react-scripts` + - [#6845](https://github.com/facebook/create-react-app/pull/6845) Change CRA version in `react-scripts` eject warning. ([@lffg](https://github.com/lffg)) + - [#6821](https://github.com/facebook/create-react-app/pull/6821) Add custom function to generate asset manifest ([@iansu](https://github.com/iansu)) + - [#6580](https://github.com/facebook/create-react-app/pull/6580) Fix react-scripts peer-deps link local issue ([@transitive-bullshit](https://github.com/transitive-bullshit)) + - [#6746](https://github.com/facebook/create-react-app/pull/6746) Replace deprecated SFC with FunctionComponent in react-app.d.ts ([@iamandrewluca](https://github.com/iamandrewluca)) + - [#6160](https://github.com/facebook/create-react-app/pull/6160) Suggests that tsconfig.json is incorrect only when SyntaxError is caught ([@Andarist](https://github.com/Andarist)) + - [#6696](https://github.com/facebook/create-react-app/pull/6696) Enable futureEmitAssets in webpack config ([@iansu](https://github.com/iansu)) + - [#6669](https://github.com/facebook/create-react-app/pull/6669) Remove unnecessary shrink-to-fit=no meta data ([@abdelrahmanrifai](https://github.com/abdelrahmanrifai)) + - [#5686](https://github.com/facebook/create-react-app/pull/5686) Add empty mock for http2 ([@kjin](https://github.com/kjin)) + - [#5960](https://github.com/facebook/create-react-app/pull/5960) add command to add files to staging after eject ([@clickclickonsal](https://github.com/clickclickonsal)) + - [#6615](https://github.com/facebook/create-react-app/pull/6615) Allow .json type checking ([@ianschmitz](https://github.com/ianschmitz)) + - [#6451](https://github.com/facebook/create-react-app/pull/6451) change class component to function component ([@xiaoxiangmoe](https://github.com/xiaoxiangmoe)) +- `babel-plugin-named-asset-import`, `babel-preset-react-app`, `confusing-browser-globals`, `create-react-app`, `eslint-config-react-app`, `react-app-polyfill`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#6826](https://github.com/facebook/create-react-app/pull/6826) Add directory details to packages/\* package.json ([@feelepxyz](https://github.com/feelepxyz)) +- `babel-preset-react-app`, `react-app-polyfill` + - [#6769](https://github.com/facebook/create-react-app/pull/6769) Update to core-js@3 ([@ianschmitz](https://github.com/ianschmitz)) +- `create-react-app` + - [#6770](https://github.com/facebook/create-react-app/pull/6770) Warn when using react-scripts-ts ([@ianschmitz](https://github.com/ianschmitz)) +- `react-dev-utils` + - [#5821](https://github.com/facebook/create-react-app/pull/5821) Add wait: false to options object for opn ([@evalexpr](https://github.com/evalexpr)) + - [#6502](https://github.com/facebook/create-react-app/pull/6502) Enable click to go to error in console part 2! ([@johnnyreilly](https://github.com/johnnyreilly)) + +#### :memo: Documentation + +- Other + - [#6847](https://github.com/facebook/create-react-app/pull/6847) Add baseUrl documentation ([@ianschmitz](https://github.com/ianschmitz)) + - [#6801](https://github.com/facebook/create-react-app/pull/6801) Copy fixes in adding Bootstrap docs ([@panckreous](https://github.com/panckreous)) + - [#6820](https://github.com/facebook/create-react-app/pull/6820) Fix docs about minimum React version for SVG component support ([@iansu](https://github.com/iansu)) + - [#6817](https://github.com/facebook/create-react-app/pull/6817) Add link to TypeScript page in Getting Started ([@ianschmitz](https://github.com/ianschmitz)) + - [#6786](https://github.com/facebook/create-react-app/pull/6786) Clarify production build output files documentation ([@bakuzan](https://github.com/bakuzan)) + - [#6783](https://github.com/facebook/create-react-app/pull/6783) Add SVG support dependency note ([@pnarielwala](https://github.com/pnarielwala)) + - [#6772](https://github.com/facebook/create-react-app/pull/6772) Update link to React Testing Library docs ([@fjoshuajr](https://github.com/fjoshuajr)) + - [#6695](https://github.com/facebook/create-react-app/pull/6695) Add Render deployment section ([@anurag](https://github.com/anurag)) + - [#6082](https://github.com/facebook/create-react-app/pull/6082) Add explanation for adding everything as dependencies to docs ([@mikeattara](https://github.com/mikeattara)) + - [#5481](https://github.com/facebook/create-react-app/pull/5481) Document .graphql and .gql file loading with graphql.macro ([@petetnt](https://github.com/petetnt)) + - [#6491](https://github.com/facebook/create-react-app/pull/6491) Update advanced-configuration.md ([@stephengodderidge](https://github.com/stephengodderidge)) + - [#6208](https://github.com/facebook/create-react-app/pull/6208) Add deployment instructions with AWS Amplify ([@swaminator](https://github.com/swaminator)) + - [#6374](https://github.com/facebook/create-react-app/pull/6374) Add note about npx caching and link to #6119 ([@TaylorBriggs](https://github.com/TaylorBriggs)) + - [#6386](https://github.com/facebook/create-react-app/pull/6386) Revert removal of newlines from html in docs ([@JBallin](https://github.com/JBallin)) +- `react-scripts` + - [#6848](https://github.com/facebook/create-react-app/pull/6848) Remove no-watch flag in favor of watchAll=false ([@bugzpodder](https://github.com/bugzpodder)) + - [#6775](https://github.com/facebook/create-react-app/pull/6775) Fix code comment typo ([@bestseob93](https://github.com/bestseob93)) + +#### :house: Internal + +- Other + - [#6829](https://github.com/facebook/create-react-app/pull/6829) Upgrade to Lerna v3 ([@iansu](https://github.com/iansu)) + - [#6762](https://github.com/facebook/create-react-app/pull/6762) Add temporary workaround for Babel dependency issues in kitchensink-eject test suite ([@iansu](https://github.com/iansu)) + - [#6757](https://github.com/facebook/create-react-app/pull/6757) Add temporary workaround for Babel dependency issues in installs test suite ([@iansu](https://github.com/iansu)) + - [#6700](https://github.com/facebook/create-react-app/pull/6700) Kill verdaccio in CI tasks cleanup ([@santoshyadav198613](https://github.com/santoshyadav198613)) + - [#6690](https://github.com/facebook/create-react-app/pull/6690) Remove duplicate url key in siteConfig ([@charpeni](https://github.com/charpeni)) +- `react-scripts` + - [#6313](https://github.com/facebook/create-react-app/pull/6313) Update testMatch to also be compatible with Jest 24 ([@ngbrown](https://github.com/ngbrown)) + - [#4176](https://github.com/facebook/create-react-app/pull/4176) Remove --coverage + --watch workaround for the test command ([@stipsan](https://github.com/stipsan)) + - [#6655](https://github.com/facebook/create-react-app/pull/6655) Change app component declaration from arrow function to regular function ([@iansu](https://github.com/iansu)) + - [#6625](https://github.com/facebook/create-react-app/pull/6625) change named import into default import ([@xiaoxiangmoe](https://github.com/xiaoxiangmoe)) + - [#6621](https://github.com/facebook/create-react-app/pull/6621) make compiler a const not a let ([@Primajin](https://github.com/Primajin)) +- `babel-plugin-named-asset-import`, `confusing-browser-globals`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#6654](https://github.com/facebook/create-react-app/pull/6654) Cleanup Jest config ([@ianschmitz](https://github.com/ianschmitz)) +- `react-dev-utils` + - [#6674](https://github.com/facebook/create-react-app/pull/6674) Remove unused eslint comment ([@mohitsinghs](https://github.com/mohitsinghs)) +- `eslint-config-react-app` + - [#6662](https://github.com/facebook/create-react-app/pull/6662) Sync version of babel-eslint in eslint-config-react-app for react-scripts V3 ([@dalcib](https://github.com/dalcib)) + +#### :hammer: Underlying Tools + +- `react-scripts` + - [#6843](https://github.com/facebook/create-react-app/pull/6843) Update fsevents dependency version ([@FrancoisRmn](https://github.com/FrancoisRmn)) + - [#6725](https://github.com/facebook/create-react-app/pull/6725) Update to workbox-webpack-plugin v4 ([@r0ughnex](https://github.com/r0ughnex)) + - [#6361](https://github.com/facebook/create-react-app/pull/6361) Updating html-webpack-plugin dep ([@Aftabnack](https://github.com/Aftabnack)) + - [#6483](https://github.com/facebook/create-react-app/pull/6483) Update webpack-dev-server to 3.2.1 ([@ThePrez](https://github.com/ThePrez)) +- `babel-plugin-named-asset-import`, `babel-preset-react-app`, `confusing-browser-globals`, `create-react-app`, `eslint-config-react-app`, `react-app-polyfill`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#6840](https://github.com/facebook/create-react-app/pull/6840) Relax ESLint version range ([@ianschmitz](https://github.com/ianschmitz)) +- `babel-preset-react-app` + - [#6780](https://github.com/facebook/create-react-app/pull/6780) Remove unused babel-loader from babel-preset-react-app ([@tlrobinson](https://github.com/tlrobinson)) +- `babel-preset-react-app`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#6767](https://github.com/facebook/create-react-app/pull/6767) Update dependency versions ([@ianschmitz](https://github.com/ianschmitz)) +- `react-dev-utils` + - [#6739](https://github.com/facebook/create-react-app/pull/6739) Update fork-ts-checker-webpack-plugin out of alpha ([@pelotom](https://github.com/pelotom)) +- `eslint-config-react-app` + - [#6701](https://github.com/facebook/create-react-app/pull/6701) Remove project property from @typescript-eslint/parser options ([@jackwilsdon](https://github.com/jackwilsdon)) +- `eslint-config-react-app`, `react-scripts` + - [#6653](https://github.com/facebook/create-react-app/pull/6653) Unpin eslint-config-react-hooks dependency ([@iansu](https://github.com/iansu)) +- `babel-preset-react-app`, `eslint-config-react-app`, `react-scripts` + - [#5997](https://github.com/facebook/create-react-app/pull/5997) Support React Hooks (#5602) ([@eivind88](https://github.com/eivind88)) +- `babel-preset-react-app`, `create-react-app`, `react-app-polyfill`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#6614](https://github.com/facebook/create-react-app/pull/6614) Upgrade dependencies ([@ianschmitz](https://github.com/ianschmitz)) + +#### Committers: 49 + +- Abdelrahman Rifai ([@abdelrahmanrifai](https://github.com/abdelrahmanrifai)) +- Aftab Khan ([@Aftabnack](https://github.com/Aftabnack)) +- Alessandro (Ale) Segala ([@ItalyPaleAle](https://github.com/ItalyPaleAle)) +- Alex Guerra ([@heyimalex](https://github.com/heyimalex)) +- Andrew Luca ([@iamandrewluca](https://github.com/iamandrewluca)) +- Anurag Goel ([@anurag](https://github.com/anurag)) +- Cody Olsen ([@stipsan](https://github.com/stipsan)) +- Dalci de Jesus Bagolin ([@dalcib](https://github.com/dalcib)) +- Dan ([@panckreous](https://github.com/panckreous)) +- Eivind Arvesen ([@eivind88](https://github.com/eivind88)) +- Endilie Yacop Sucipto ([@endiliey](https://github.com/endiliey)) +- Francisco Joshua ([@fjoshuajr](https://github.com/fjoshuajr)) +- Hrusikesh Panda ([@mrchief](https://github.com/mrchief)) +- Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz)) +- Ian Sutherland ([@iansu](https://github.com/iansu)) +- JBallin ([@JBallin](https://github.com/JBallin)) +- Jack Wilsdon ([@jackwilsdon](https://github.com/jackwilsdon)) +- Jack Zhao ([@bugzpodder](https://github.com/bugzpodder)) +- Jannis Hell ([@Primajin](https://github.com/Primajin)) +- John Reilly ([@johnnyreilly](https://github.com/johnnyreilly)) +- Kelvin Jin ([@kjin](https://github.com/kjin)) +- Lorenzo Rapetti ([@loryman](https://github.com/loryman)) +- Luiz Felipe Gonçalves ([@lffg](https://github.com/lffg)) +- Mateusz Burzyński ([@Andarist](https://github.com/Andarist)) +- Mike Beaton ([@MikeBeaton](https://github.com/MikeBeaton)) +- Mike Perry Y Attara ([@mikeattara](https://github.com/mikeattara)) +- Mohit Singh ([@mohitsinghs](https://github.com/mohitsinghs)) +- Nathan Brown ([@ngbrown](https://github.com/ngbrown)) +- Nicolas Charpentier ([@charpeni](https://github.com/charpeni)) +- Nikhil Swaminathan ([@swaminator](https://github.com/swaminator)) +- Parth Narielwala ([@pnarielwala](https://github.com/pnarielwala)) +- Pete Nykänen ([@petetnt](https://github.com/petetnt)) +- Philip Harrison ([@feelepxyz](https://github.com/feelepxyz)) +- Pradeep Sekar ([@r0ughnex](https://github.com/r0ughnex)) +- Raphael.dev ([@bestseob93](https://github.com/bestseob93)) +- Robert van Steen ([@rovansteen](https://github.com/rovansteen)) +- Romain François ([@FrancoisRmn](https://github.com/FrancoisRmn)) +- Salvador Hernandez ([@clickclickonsal](https://github.com/clickclickonsal)) +- Santosh Yadav ([@santoshyadav198613](https://github.com/santoshyadav198613)) +- Stephen Godderidge ([@stephengodderidge](https://github.com/stephengodderidge)) +- Taylor Briggs ([@TaylorBriggs](https://github.com/TaylorBriggs)) +- Tom Crockett ([@pelotom](https://github.com/pelotom)) +- Tom Robinson ([@tlrobinson](https://github.com/tlrobinson)) +- Travis Fischer ([@transitive-bullshit](https://github.com/transitive-bullshit)) +- Wilkins ([@evalexpr](https://github.com/evalexpr)) +- ZHAO Jinxiang ([@xiaoxiangmoe](https://github.com/xiaoxiangmoe)) +- [@ThePrez](https://github.com/ThePrez) +- [@bakuzan](https://github.com/bakuzan) +- [@frederikhors](https://github.com/frederikhors) + +## Releases Before 3.x + +Please refer to [CHANGELOG-2.x.md](./CHANGELOG-2.x.md) for earlier versions. diff --git a/CHANGELOG.md b/CHANGELOG.md index e78e28f3f06..0c4b9f5372b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,1270 +1,324 @@ -## 3.4.1 (2020-03-20) +## 4.0.0 (2020-10-23) -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. +Create React App 4.0 is a major release with several new features, including support for Fast Refresh! -#### :bug: Bug Fix - -- `react-scripts` - - [#8276](https://github.com/facebook/create-react-app/pull/8276) Use native ESLint behaviour when extending ([@mrmckeb](https://github.com/mrmckeb)) - - [#7203](https://github.com/facebook/create-react-app/pull/7203) Closes webpack dev server and exits process on "end" stdin ([@kelseyleftwich](https://github.com/kelseyleftwich)) -- `babel-preset-react-app` - - [#8526](https://github.com/facebook/create-react-app/pull/8526) Fix optional chaining and nullish coalescing support ([@ianschmitz](https://github.com/ianschmitz)) -- `cra-template`, `eslint-config-react-app`, `react-scripts` - - [#7790](https://github.com/facebook/create-react-app/pull/7790) Widen eslint-config-react-app peer dependency versions ([@lukyth](https://github.com/lukyth)) - -#### :nail_care: Enhancement - -- `cra-template-typescript`, `cra-template` - - [#8558](https://github.com/facebook/create-react-app/pull/8558) Add React.StrictMode to default templates ([@connkat](https://github.com/connkat)) -- `react-scripts` - - [#8539](https://github.com/facebook/create-react-app/pull/8539) allow specification of package.main in template.json ([@EvanBoyle](https://github.com/EvanBoyle)) - -#### :memo: Documentation - -- Other - - [#8515](https://github.com/facebook/create-react-app/pull/8515) Fix proxying API request docs ([@hjr3](https://github.com/hjr3)) - - [#8561](https://github.com/facebook/create-react-app/pull/8561) Indicate that the file structure is the template's ([@Vinnl](https://github.com/Vinnl)) -- `react-scripts` - - [#8276](https://github.com/facebook/create-react-app/pull/8276) Use native ESLint behaviour when extending ([@mrmckeb](https://github.com/mrmckeb)) - -#### :hammer: Underlying Tools - -- `babel-preset-react-app`, `create-react-app`, `react-dev-utils`, `react-error-overlay`, `react-scripts` - - [#8681](https://github.com/facebook/create-react-app/pull/8681) Update to Babel 7.9 ([@ianschmitz](https://github.com/ianschmitz)) - - [#8620](https://github.com/facebook/create-react-app/pull/8620) Bump dependencies ([@ianschmitz](https://github.com/ianschmitz)) -- `react-scripts` - - [#8509](https://github.com/facebook/create-react-app/pull/8509) Bumps pnp-webpack-plugin ([@arcanis](https://github.com/arcanis)) - -#### Committers: 9 - -- Brody McKee ([@mrmckeb](https://github.com/mrmckeb)) -- Evan Boyle ([@EvanBoyle](https://github.com/EvanBoyle)) -- Herman J. Radtke III ([@hjr3](https://github.com/hjr3)) -- Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz)) -- Kanitkorn Sujautra ([@lukyth](https://github.com/lukyth)) -- KatCon ([@connkat](https://github.com/connkat)) -- Kelsey Leftwich ([@kelseyleftwich](https://github.com/kelseyleftwich)) -- Maël Nison ([@arcanis](https://github.com/arcanis)) -- Vincent ([@Vinnl](https://github.com/Vinnl)) - -### Migrating from 3.4.0 to 3.4.1 - -Inside any created project that has not been ejected, run: - -```sh -npm install --save --save-exact react-scripts@3.4.1 -``` - -or +Thanks to all the maintainers and contributors who worked so hard on this release! :raised_hands: -```sh -yarn add --exact react-scripts@3.4.1 -``` - -## 3.4.0 (2020-02-14) - -v3.4.0 is a minor release that adds new features, including support for SSL and setting `PUBLIC_URL` in development. It also includes a fix for Hot Module Reloading with CSS Modules as well as other bug fixes. - -#### :bug: Bug Fix - -- `react-scripts` - - [#8378](https://github.com/facebook/create-react-app/pull/8378) Downgrade style-loader to v0.23.1 due to CSS modules hot reload not working with v1.0.0 and above ([@chybisov](https://github.com/chybisov)) -- `create-react-app`, `react-dev-utils`, `react-error-overlay` - - [#8439](https://github.com/facebook/create-react-app/pull/8439) Downgrade chalk for ie 11 support ([@ianschmitz](https://github.com/ianschmitz)) -- `react-dev-utils` - - [#8292](https://github.com/facebook/create-react-app/pull/8292) Fixes unchecked access to 'deploy' script on build ([@renato-bohler](https://github.com/renato-bohler)) -- `cra-template-typescript`, `cra-template` - - [#8272](https://github.com/facebook/create-react-app/pull/8272) Handle service worker error in Firefox ([@rosinghal](https://github.com/rosinghal)) -- `cra-template-typescript` - - [#8403](https://github.com/facebook/create-react-app/pull/8403) Fix robots.txt for TS ([@Kamahl19](https://github.com/Kamahl19)) - -#### :nail_care: Enhancement - -- `react-dev-utils`, `react-scripts` - - [#8442](https://github.com/facebook/create-react-app/pull/8442) fix(react-scripts): do not redirect served path if request may proxy ([@iamandrewluca](https://github.com/iamandrewluca)) - - [#7259](https://github.com/facebook/create-react-app/pull/7259) feat(react-scripts): allow PUBLIC_URL in develoment mode ([@iamandrewluca](https://github.com/iamandrewluca)) - - [#7750](https://github.com/facebook/create-react-app/pull/7750) Enable custom sockjs pathname for hot reloading server. ([@heygrady](https://github.com/heygrady)) -- `cra-template-typescript` - - [#8412](https://github.com/facebook/create-react-app/pull/8412) Change arrow functions to function declarations ([@lewislbr](https://github.com/lewislbr)) -- `cra-template-typescript`, `cra-template` - - [#8272](https://github.com/facebook/create-react-app/pull/8272) Handle service worker error in Firefox ([@rosinghal](https://github.com/rosinghal)) -- `react-scripts` - - [#5845](https://github.com/facebook/create-react-app/pull/5845) Add option to provide custom ssl certificates during development ([@alexbrazier](https://github.com/alexbrazier)) - -#### :memo: Documentation - -- `cra-template-typescript`, `cra-template`, `react-dev-utils`, `react-error-overlay`, `react-scripts` - - [#8475](https://github.com/facebook/create-react-app/pull/8475) Correct webpack name casing ([@lewislbr](https://github.com/lewislbr)) -- Other - - [#8437](https://github.com/facebook/create-react-app/pull/8437) Fix navbar line break in header ([@esvyridov](https://github.com/esvyridov)) - - [#8299](https://github.com/facebook/create-react-app/pull/8299) Update public folder usage docs to clarify globals ([@keevan](https://github.com/keevan)) - - [#8390](https://github.com/facebook/create-react-app/pull/8390) setupTestFrameworkScriptFile is deprecated ([@JimmyLv](https://github.com/JimmyLv)) - -#### :hammer: Underlying Tools - -- `react-dev-utils` - - [#8459](https://github.com/facebook/create-react-app/pull/8459) update open to v7.0.2 ([@vince1995](https://github.com/vince1995)) - - [#7948](https://github.com/facebook/create-react-app/pull/7948) Support JetBrains Rider IDE as an editor ([@djpowell](https://github.com/djpowell)) - - [#8367](https://github.com/facebook/create-react-app/pull/8367) Wider Chromium support for openBrowser ([@handeyeco](https://github.com/handeyeco)) -- `react-scripts` - - [#8282](https://github.com/facebook/create-react-app/pull/8282) Run git init before template dependencies are installed ([@lukaszfiszer](https://github.com/lukaszfiszer)) -- Other - - [#8402](https://github.com/facebook/create-react-app/pull/8402) fix(test): force install npm in e2e-behaviour ([@iamandrewluca](https://github.com/iamandrewluca)) - -#### Committers: 18 +# Highlights -- Alex Brazier ([@alexbrazier](https://github.com/alexbrazier)) -- Andrew Luca ([@iamandrewluca](https://github.com/iamandrewluca)) -- Cassidy Williams ([@cassidoo](https://github.com/cassidoo)) -- Christopher Button ([@devgeist](https://github.com/devgeist)) -- David Powell ([@djpowell](https://github.com/djpowell)) -- Eugene Chybisov ([@chybisov](https://github.com/chybisov)) -- Eugene Sviridov ([@esvyridov](https://github.com/esvyridov)) -- Grady Kuhnline ([@heygrady](https://github.com/heygrady)) -- Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz)) -- Kevin Pham ([@keevan](https://github.com/keevan)) -- Lewis Llobera ([@lewislbr](https://github.com/lewislbr)) -- Martin Litvaj ([@Kamahl19](https://github.com/Kamahl19)) -- Matthew Curtis ([@handeyeco](https://github.com/handeyeco)) -- Renato Böhler ([@renato-bohler](https://github.com/renato-bohler)) -- Rohit Singhal ([@rosinghal](https://github.com/rosinghal)) -- Vincent Semrau ([@vince1995](https://github.com/vince1995)) -- Łukasz Fiszer ([@lukaszfiszer](https://github.com/lukaszfiszer)) -- 吕立青 ([@JimmyLv](https://github.com/JimmyLv)) +- Fast Refresh [#8582](https://github.com/facebook/create-react-app/pull/8582) +- React 17 support + - New JSX transform [#9645](https://github.com/facebook/create-react-app/pull/9645) +- TypeScript 4 support [#9734](https://github.com/facebook/create-react-app/pull/9734) +- ESLint 7 [#8978](https://github.com/facebook/create-react-app/pull/8978) + - New Jest and React Testing Library rules [#8963](https://github.com/facebook/create-react-app/pull/8963) +- Jest 26 [#8955](https://github.com/facebook/create-react-app/pull/8955) +- PWA/workbox improvements + - Switch to the Workbox InjectManifest plugin [#9205](https://github.com/facebook/create-react-app/pull/9205) + - Now its own template so it can be released independently +- Web Vitals support [#9116](https://github.com/facebook/create-react-app/pull/9116) -### Migrating from 3.3.1 to 3.4.0 +# Migrating from 3.4.x to 4.0.0 Inside any created project that has not been ejected, run: -```sh -npm install --save --save-exact react-scripts@3.4.0 +```bash +npm install --save --save-exact react-scripts@4.0.0 ``` or -```sh -yarn add --exact react-scripts@3.4.0 -``` - -## 3.3.1 (2020-01-31) - -v3.3.1 is a maintenance release that includes minor bug fixes and documentation updates. - -#### :bug: Bug Fix - -- `cra-template` - - [#8255](https://github.com/facebook/create-react-app/pull/8255) Add "Disallow:" to robots.txt ([@tomoyaf](https://github.com/tomoyaf)) -- `react-scripts` - - [#8281](https://github.com/facebook/create-react-app/pull/8281) Fix sass importLoaders ([@mariusc23](https://github.com/mariusc23)) - - [#8099](https://github.com/facebook/create-react-app/pull/8099) Add titleProp to SVGR ReactComponent type definition ([@rhnorskov](https://github.com/rhnorskov)) - - [#8028](https://github.com/facebook/create-react-app/pull/8028) fix(react-scripts): proactively append to .gitignore during generation ([@bmuenzenmeyer](https://github.com/bmuenzenmeyer)) - - [#8106](https://github.com/facebook/create-react-app/pull/8106) Fix CSS font-face minification ([@sidonaldson](https://github.com/sidonaldson)) -- `babel-preset-react-app` - - [#8120](https://github.com/facebook/create-react-app/pull/8120) Sync dependencies babel config ([@ianschmitz](https://github.com/ianschmitz)) -- `react-dev-utils` - - [#8116](https://github.com/facebook/create-react-app/pull/8116) Add slashes to WebSocket protocol URL ([@Baael](https://github.com/Baael)) - - [#8079](https://github.com/facebook/create-react-app/pull/8079) webpackHotDevClient now uses wss when https is used ([@mikecaulley](https://github.com/mikecaulley)) - -#### :nail_care: Enhancement - -- `react-error-overlay` - - [#6548](https://github.com/facebook/create-react-app/pull/6548) Add helpful message to the footer ([@pyrogenic](https://github.com/pyrogenic)) -- `cra-template-typescript` - - [#8177](https://github.com/facebook/create-react-app/pull/8177) Remove React.FC from Typescript template ([@Retsam](https://github.com/Retsam)) -- `cra-template-typescript`, `cra-template`, `react-scripts` - - [#8219](https://github.com/facebook/create-react-app/pull/8219) Add template support for any package.json keys (#8082) ([@tomvalorsa](https://github.com/tomvalorsa)) -- `create-react-app` - - [#8298](https://github.com/facebook/create-react-app/pull/8298) Support shorthand scoped templates ([@kevin940726](https://github.com/kevin940726)) - - [#8168](https://github.com/facebook/create-react-app/pull/8168) Add current version and bin location to --info output ([@heyimalex](https://github.com/heyimalex)) -- `cra-template-typescript`, `cra-template` - - [#8194](https://github.com/facebook/create-react-app/pull/8194) Replace favicon in templates ([@heyimalex](https://github.com/heyimalex)) -- `eslint-config-react-app` - - [#7803](https://github.com/facebook/create-react-app/pull/7803) Remove error for @typescript-eslint/no-namespace ([@szhu](https://github.com/szhu)) - -#### :memo: Documentation - -- Other - - [#8380](https://github.com/facebook/create-react-app/pull/8380) docs: Add troubleshooting documentation on ENOSPC ([@huchenme](https://github.com/huchenme)) - - [#8394](https://github.com/facebook/create-react-app/pull/8394) Update docs according to lint-staged v10 ([@lukyth](https://github.com/lukyth)) - - [#8307](https://github.com/facebook/create-react-app/pull/8307) Remove outdated docs regarding vscode eslint extension and typescript autofix ([@alex-vukovity-cko](https://github.com/alex-vukovity-cko)) - - [#8247](https://github.com/facebook/create-react-app/pull/8247) Update setting-up-your-editor.md ([@dev-xu](https://github.com/dev-xu)) - - [#8092](https://github.com/facebook/create-react-app/pull/8092) Update custom template docs with instructions for testing custom template locally ([@kevinold](https://github.com/kevinold)) - - [#8293](https://github.com/facebook/create-react-app/pull/8293) Minor grammatical edit ([@egrim](https://github.com/egrim)) - - [#8212](https://github.com/facebook/create-react-app/pull/8212) Little typo ([@sonyarianto](https://github.com/sonyarianto)) - - [#8147](https://github.com/facebook/create-react-app/pull/8147) update PWA docs links to point to template package ([@peet](https://github.com/peet)) - - [#8132](https://github.com/facebook/create-react-app/pull/8132) Add package-runner note to readme ([@JeromeDeLeon](https://github.com/JeromeDeLeon)) - - [#8111](https://github.com/facebook/create-react-app/pull/8111) chore: update docusaurus & tweak site ([@endiliey](https://github.com/endiliey)) - - [#8080](https://github.com/facebook/create-react-app/pull/8080) Fix typo in CHANGELOG.md ([@Trontor](https://github.com/Trontor)) - - [#8077](https://github.com/facebook/create-react-app/pull/8077) Add custom-templates to docs sidebar ([@ianschmitz](https://github.com/ianschmitz)) -- `babel-preset-react-app` - - [#8124](https://github.com/facebook/create-react-app/pull/8124) Fix typo in comment: `?.` is right, `.?` is not ([@vadzim](https://github.com/vadzim)) - -#### :house: Internal - -- `create-react-app` - - [#8178](https://github.com/facebook/create-react-app/pull/8178) Minor refactors in create-react-app ([@heyimalex](https://github.com/heyimalex)) - -#### :hammer: Underlying Tools - -- `babel-preset-react-app`, `create-react-app`, `react-dev-utils`, `react-error-overlay`, `react-scripts` - - [#8353](https://github.com/facebook/create-react-app/pull/8353) Remove outdated babel plugins ([@ianschmitz](https://github.com/ianschmitz)) - - [#8324](https://github.com/facebook/create-react-app/pull/8324) Update Dependencies ([@RDIL](https://github.com/RDIL)) - - [#8122](https://github.com/facebook/create-react-app/pull/8122) Fix CI build ([@ianschmitz](https://github.com/ianschmitz)) -- `react-dev-utils` - - [#8364](https://github.com/facebook/create-react-app/pull/8364) Downgrade open from 7.0.0 to 6.4.0 ([@vince1995](https://github.com/vince1995)) - - [#8163](https://github.com/facebook/create-react-app/pull/8163) Bump pkgUp ([@andriijas](https://github.com/andriijas)) -- `babel-plugin-named-asset-import` - - [#8171](https://github.com/facebook/create-react-app/pull/8171) Bump babel-plugin-tester and fix breaking changes ([@andriijas](https://github.com/andriijas)) -- `create-react-app`, `react-app-polyfill`, `react-dev-utils`, `react-error-overlay`, `react-scripts` - - [#8176](https://github.com/facebook/create-react-app/pull/8176) Bump internal dependencies ([@andriijas](https://github.com/andriijas)) -- `create-react-app`, `react-dev-utils`, `react-error-overlay` - - [#8164](https://github.com/facebook/create-react-app/pull/8164) Bump chalk ([@andriijas](https://github.com/andriijas)) -- `react-error-overlay`, `react-scripts` - - [#8102](https://github.com/facebook/create-react-app/pull/8102) [Security] Update terser webpack plugin ([@RDIL](https://github.com/RDIL)) - -#### Committers: 29 - -- Alex Guerra ([@heyimalex](https://github.com/heyimalex)) -- Alex James Vukovity ([@alex-vukovity-cko](https://github.com/alex-vukovity-cko)) -- Andreas Cederström ([@andriijas](https://github.com/andriijas)) -- Boyuan Xu ([@dev-xu](https://github.com/dev-xu)) -- Brian Muenzenmeyer ([@bmuenzenmeyer](https://github.com/bmuenzenmeyer)) -- Endi ([@endiliey](https://github.com/endiliey)) -- Evan Grim ([@egrim](https://github.com/egrim)) -- Hu Chen ([@huchenme](https://github.com/huchenme)) -- Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz)) -- Jerome De Leon ([@JeromeDeLeon](https://github.com/JeromeDeLeon)) -- Joshua Pollak ([@pyrogenic](https://github.com/pyrogenic)) -- Kai Hao ([@kevin940726](https://github.com/kevin940726)) -- Kanitkorn Sujautra ([@lukyth](https://github.com/lukyth)) -- Kevin Old ([@kevinold](https://github.com/kevinold)) -- Marius Craciunoiu ([@mariusc23](https://github.com/mariusc23)) -- Mike Caulley ([@mikecaulley](https://github.com/mikecaulley)) -- Peet Goddard ([@peet](https://github.com/peet)) -- Rasmus Nørskov ([@rhnorskov](https://github.com/rhnorskov)) -- Reece Dunham ([@RDIL](https://github.com/RDIL)) -- Sean Zhu ([@szhu](https://github.com/szhu)) -- Simon Donaldson ([@sidonaldson](https://github.com/sidonaldson)) -- Sony AK ([@sonyarianto](https://github.com/sonyarianto)) -- Tom Valorsa ([@tomvalorsa](https://github.com/tomvalorsa)) -- Tomoya Fujita ([@tomoyaf](https://github.com/tomoyaf)) -- Vadzim ([@vadzim](https://github.com/vadzim)) -- Vincent Semrau ([@vince1995](https://github.com/vince1995)) -- Wojciech Zieliński ([@Baael](https://github.com/Baael)) -- [@Retsam](https://github.com/Retsam) -- [@Trontor](https://github.com/Trontor) - -### Migrating from 3.3.0 to 3.3.1 - -Inside any created project that has not been ejected, run: - -```sh -npm install --save --save-exact react-scripts@3.3.1 ``` - -or - -```sh -yarn add --exact react-scripts@3.3.1 +yarn add --exact react-scripts@4.0.0 ``` -## 3.3.0 (2019-12-04) - -v3.3.0 is a minor release that adds new features, including custom templates and support for the new optional chaining and nullish coalescing operators. - -### Custom Templates - -You can now create a new app using custom templates. - -We've published our existing templates as [`cra-template`](https://github.com/facebook/create-react-app/tree/master/packages/cra-template) and [`cra-template-typescript`](https://github.com/facebook/create-react-app/tree/master/packages/cra-template-typescript), but we expect to see many great templates from the community over the coming weeks. - -The below command shows how you can create a new app with `cra-template-typescript`. - -```sh -npx create-react-app my-app --template typescript -``` +**NOTE: You may need to delete your `node_modules` folder and reinstall your dependencies by running `yarn` (or `npm install`) if you encounter errors after upgrading.** -Note that you can omit the prefix `cra-template-` when specifying which template you would like. For TypeScript users, we're deprecating `--typescript` in favour of `--template typescript`. +If you previously ejected but now want to upgrade, one common solution is to find the commits where you ejected (and any subsequent commits changing the configuration), revert them, upgrade, and later optionally eject again. It’s also possible that the feature you ejected for is now supported out of the box. -If you don't set a template, we'll create your new app with `cra-template` - which is just a new name for our base template. +## Breaking Changes -### Optional Chaining and Nullish Coalescing Operators +Like any major release, `react-scripts@4.0.0` contains a number of breaking changes. We expect that they won't affect every user, but we recommend you look over this section to see if something is relevant to you. If we missed something, please file a new issue. -We now support the [optional chaining](https://github.com/TC39/proposal-optional-chaining) and [nullish coalescing](https://github.com/tc39/proposal-nullish-coalescing) operators! +### ESLint -```js -// Optional chaining -a?.(); // undefined if `a` is null/undefined -b?.c; // undefined if `b` is null/undefined +We've upgraded to ESLint 7 and added many new rules including some for Jest and React Testing Library as well as the `import/no-anonymous-default-export` rule. We've also upgraded `eslint-plugin-hooks` to version 4.0.0 and removed the `EXTEND_ESLINT` flag as it is no longer required to customize the ESLint config. -// Nullish coalescing -undefined ?? 'some other default'; // result: 'some other default' -null ?? 'some other default'; // result: 'some other default' -'' ?? 'some other default'; // result: '' -0 ?? 300; // result: 0 -false ?? true; // result: false -``` +### Jest -**If you're using TypeScript, you will need to upgrade your `typescript` dependency to `3.7.0` or later if you wish to use the new operators.** +We've upgraded to Jest 26 and now set `resetMocks` to `true` by default in the Jest config. -**If you're using Visual Studio Code 1.40 (the latest as of this release) or earlier, you will need to configure your editor if you want it to understand the new operators.** +### Service workers -If you're using TypeScript in your project and have already upgrade its version as described above, then you can [configure VS Code to `Use Workspace Version` of TypeScript](https://code.visualstudio.com/docs/typescript/typescript-compiling#_using-newer-typescript-versions). If your project isn't using TypeScript, you can use the [JavaScript and TypeScript Nightly extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-next) until VS Code releases a newer version including TypeScript `3.7.0` or newer. +We've switched to the Workbox InjectManifest plugin and moved the PWA templates into their own [repository](https://github.com/cra-template/pwa). -### Numeric Separators +### Removed `typescript` flag and `NODE_PATH` support -We've added support for [numeric separators](https://github.com/tc39/proposal-numeric-separator) to improve readability of numeric literals. +We've removed the deprecated `typescript` flag when creating a new app. Use `--template typescript` instead. We've also dropped deprecated `NODE_PATH` flag as this has been replaced by setting the base path in `jsconfig.json`. -```js -1000000000; // Is this a billion? a hundred millions? Ten millions? -101475938.38; // what scale is this? what power of 10? +### Fix dotenv file loading order -1_000_000_000; // Ah, so a billion -101_475_938.38; // And this is hundreds of millions -``` +We've changed the loading order of env files to match the `dotenv` specification. See #9037 for more details. -### no-unexpected-multiline +### Dropped Node 8 support -We've removed this rule as it is not compatible with Prettier. If you rely on this rule you can re-enable it by [extending our ESLint config](https://create-react-app.dev/docs/setting-up-your-editor/#experimental-extending-the-eslint-config) and adding the following: +Node 8 reached End-of-Life at the end of 2019 and is no longer supported. -```json -{ - "extends": "react-app", - "rules": { - "no-unexpected-multiline": "warn" - } -} -``` +# Detailed Changelog #### :rocket: New Feature -- `babel-preset-react-app` - - [#7438](https://github.com/facebook/create-react-app/pull/7438) Add optional chaining and nullish coalescing operators support ([@renatoagds](https://github.com/renatoagds)) -- `babel-preset-react-app`, `react-dev-utils` - - [#7817](https://github.com/facebook/create-react-app/pull/7817) Add numeric separator support ([@tharun208](https://github.com/tharun208)) -- `cra-template-typescript`, `cra-template`, `create-react-app`, `react-scripts` - - [#7716](https://github.com/facebook/create-react-app/pull/7716) Add template support ([@mrmckeb](https://github.com/mrmckeb)) - -#### :boom: Breaking Change - -- `create-react-app`, `react-dev-utils`, `react-scripts` - - - [#7988](https://github.com/facebook/create-react-app/pull/7988) Bump webpack-dev-server ([@ianschmitz](https://github.com/ianschmitz)) - - **NOTE: This is only a breaking change if you're using `react-dev-utils` outside of Create React App.** - -#### :bug: Bug Fix - -- `eslint-config-react-app` - - [#8039](https://github.com/facebook/create-react-app/pull/8039) Remove no-unexpected-multiline rule ([@iansu](https://github.com/iansu)) -- `create-react-app` - - [#7991](https://github.com/facebook/create-react-app/pull/7991) Support templates in scoped packages ([@klasbj](https://github.com/klasbj)) - - [#7839](https://github.com/facebook/create-react-app/pull/7839) added check for typescript template and unsupported node version ([@awaseem](https://github.com/awaseem)) -- `react-scripts` - - [#7860](https://github.com/facebook/create-react-app/pull/7860) Mark TypeScript as an optional peer dependency for react-scripts ([@dstaley](https://github.com/dstaley)) - - [#7822](https://github.com/facebook/create-react-app/pull/7822) Fix absolute paths issue in Jest ([@rovansteen](https://github.com/rovansteen)) - - [#7796](https://github.com/facebook/create-react-app/pull/7796) Fixed process type in TypeScript template. ([@fuszenecker](https://github.com/fuszenecker)) -- `react-dev-utils` - - [#6449](https://github.com/facebook/create-react-app/pull/6449) Edit InterpolateHtmlPlugin hook (#6448) ([@GuiHash](https://github.com/GuiHash)) - -#### :nail_care: Enhancement - -- `cra-template-typescript`, `cra-template` - - [#8005](https://github.com/facebook/create-react-app/pull/8005) Prefix apple-touch-icon links with PUBLIC_URL ([@benblank](https://github.com/benblank)) - - [#7881](https://github.com/facebook/create-react-app/pull/7881) Add @testing-library to the default templates ([@kentcdodds](https://github.com/kentcdodds)) -- `react-scripts` - - [#7989](https://github.com/facebook/create-react-app/pull/7989) Add scripts support to templates ([@mrmckeb](https://github.com/mrmckeb)) - - [#7921](https://github.com/facebook/create-react-app/pull/7921) Add restoreMocks to supported jest config keys ([@ianschmitz](https://github.com/ianschmitz)) - - [#6352](https://github.com/facebook/create-react-app/pull/6352) Add additional information for postcss errors (#6282) ([@buildbreakdo](https://github.com/buildbreakdo)) - - [#6753](https://github.com/facebook/create-react-app/pull/6753) Add Service-Worker header to checkValidServiceWorker ([@darthmaim](https://github.com/darthmaim)) - - [#7832](https://github.com/facebook/create-react-app/pull/7832) feat: add additional Jest keys to whitelist ([@mrmckeb](https://github.com/mrmckeb)) - - [#7022](https://github.com/facebook/create-react-app/pull/7022) Fix node_modules sourcemap config (which will fix VSCode debugging of CRA apps) ([@justingrant](https://github.com/justingrant)) -- `cra-template` - - [#7931](https://github.com/facebook/create-react-app/pull/7931) No spinning React logo if `prefers-reduced-motion` ([@donavon](https://github.com/donavon)) -- `create-react-app`, `react-error-overlay` - - [#7052](https://github.com/facebook/create-react-app/pull/7052) Dark scheme overlay ([@Fabianopb](https://github.com/Fabianopb)) -- `babel-preset-react-app` - - [#7726](https://github.com/facebook/create-react-app/pull/7726) Add babel runtime version to transform-runtime plugin to reduce bundle size ([@topaxi](https://github.com/topaxi)) - -#### :memo: Documentation - -- Other - - [#8050](https://github.com/facebook/create-react-app/pull/8050) Update template docs ([@mrmckeb](https://github.com/mrmckeb)) - - [#7995](https://github.com/facebook/create-react-app/pull/7995) Add contributors section to readme ([@ianschmitz](https://github.com/ianschmitz)) - - [#7896](https://github.com/facebook/create-react-app/pull/7896) chore: Fix broken link for e2e README ([@haruelrovix](https://github.com/haruelrovix)) - - [#7874](https://github.com/facebook/create-react-app/pull/7874) Bump docusaurus 🦖 ([@andriijas](https://github.com/andriijas)) - - [#7819](https://github.com/facebook/create-react-app/pull/7819) 📖 DOC: Improvement ([@waahab](https://github.com/waahab)) - - [#7853](https://github.com/facebook/create-react-app/pull/7853) Update adding-bootstrap.md ([@Xuhao](https://github.com/Xuhao)) - - [#7849](https://github.com/facebook/create-react-app/pull/7849) chore: update README.md gif links ([@cchanxzy](https://github.com/cchanxzy)) - - [#7840](https://github.com/facebook/create-react-app/pull/7840) Link to ASP.NET Core docs ([@Daniel15](https://github.com/Daniel15)) - - [#7841](https://github.com/facebook/create-react-app/pull/7841) Update getting-started.md ([@reactjser](https://github.com/reactjser)) - - [#7809](https://github.com/facebook/create-react-app/pull/7809) Add a note about .eslintignore files being respected ([@seanlaff](https://github.com/seanlaff)) - - [#7686](https://github.com/facebook/create-react-app/pull/7686) Link to React documentation for code splitting ([@Hugodby](https://github.com/Hugodby)) - - [#7785](https://github.com/facebook/create-react-app/pull/7785) Upgrade to docusaurus 2 ([@endiliey](https://github.com/endiliey)) - - [#7824](https://github.com/facebook/create-react-app/pull/7824) Fix grammar error in troubleshooting.md ([@jakeboone02](https://github.com/jakeboone02)) - - [#7823](https://github.com/facebook/create-react-app/pull/7823) Document correct default behavior for HOST var ([@jsejcksn](https://github.com/jsejcksn)) - - [#7815](https://github.com/facebook/create-react-app/pull/7815) Tightens up the TypeScript docs ([@orta](https://github.com/orta)) - - [#7813](https://github.com/facebook/create-react-app/pull/7813) Clarify dynamic import stage in docs ([@aprilandjan](https://github.com/aprilandjan)) -- `react-dev-utils`, `react-scripts` - - [#7972](https://github.com/facebook/create-react-app/pull/7972) Add placeholders where old template READMEs used to be ([@iansu](https://github.com/iansu)) -- `babel-preset-react-app` - - [#7932](https://github.com/facebook/create-react-app/pull/7932) fix seperators typo ([@donavon](https://github.com/donavon)) -- `react-dev-utils` - - [#7897](https://github.com/facebook/create-react-app/pull/7897) chore: Fix broken link for CRA deployment ([@haruelrovix](https://github.com/haruelrovix)) -- `react-scripts` - - [#7852](https://github.com/facebook/create-react-app/pull/7852) Add Alex to lint documentation ([@iansu](https://github.com/iansu)) - - [#7474](https://github.com/facebook/create-react-app/pull/7474) Fix notations of loopback addresses ([@wataash](https://github.com/wataash)) - -#### :house: Internal - +- `eslint-config-react-app`, `react-error-overlay`, `react-scripts` + - [#8963](https://github.com/facebook/create-react-app/pull/8963) feat(eslint-config-react-app): Add jest & testing-library rules ([@MichaelDeBoey](https://github.com/MichaelDeBoey)) - `react-scripts` - - [#8038](https://github.com/facebook/create-react-app/pull/8038) Add TypeScript peer dependency to react-scripts ([@iansu](https://github.com/iansu)) - - [#7952](https://github.com/facebook/create-react-app/pull/7952) Add tests for optional chaining and null coalescing ([@ianschmitz](https://github.com/ianschmitz)) - - [#7830](https://github.com/facebook/create-react-app/pull/7830) Revert logo in templates ([@iansu](https://github.com/iansu)) -- Other - - [#8029](https://github.com/facebook/create-react-app/pull/8029) Re-enable GitHub Actions ([@iansu](https://github.com/iansu)) - - [#7978](https://github.com/facebook/create-react-app/pull/7978) Temporarily disable GitHub Actions ([@iansu](https://github.com/iansu)) - - [#7789](https://github.com/facebook/create-react-app/pull/7789) Add yarn.lock to .gitignore ([@lukyth](https://github.com/lukyth)) - - [#7878](https://github.com/facebook/create-react-app/pull/7878) Remove alex precommit check ([@iansu](https://github.com/iansu)) - - [#7861](https://github.com/facebook/create-react-app/pull/7861) Add a GitHub Action that runs the build script ([@iansu](https://github.com/iansu)) -- `eslint-config-react-app` - - [#8003](https://github.com/facebook/create-react-app/pull/8003) Use @typescript-eslint/no-unused-expressions to support optional chaining ([@maxdavidson](https://github.com/maxdavidson)) + - [#9611](https://github.com/facebook/create-react-app/pull/9611) Add AVIF image support ([@Hongbo-Miao](https://github.com/Hongbo-Miao)) + - [#9114](https://github.com/facebook/create-react-app/pull/9114) Allow testMatch for jest config ([@Favna](https://github.com/Favna)) + - [#8790](https://github.com/facebook/create-react-app/pull/8790) Add back in --stats output from webpack. ([@samccone](https://github.com/samccone)) + - [#8838](https://github.com/facebook/create-react-app/pull/8838) Support devDependencies in templates ([@mrmckeb](https://github.com/mrmckeb)) - `create-react-app` - - [#7844](https://github.com/facebook/create-react-app/pull/7844) added e2e test for checking typescript template with unsupported node ([@awaseem](https://github.com/awaseem)) - - [#7882](https://github.com/facebook/create-react-app/pull/7882) refactor: remove double coerce ([@mrmckeb](https://github.com/mrmckeb)) - - [#7880](https://github.com/facebook/create-react-app/pull/7880) Pass through fully specified template name ([@iansu](https://github.com/iansu)) -- `cra-template-typescript` - - [#7944](https://github.com/facebook/create-react-app/pull/7944) Make base and TypeScript templates consistent ([@suprj](https://github.com/suprj)) -- `create-react-app`, `react-dev-utils`, `react-scripts` - - [#7773](https://github.com/facebook/create-react-app/pull/7773) Temporarily disable Windows in CI ([@ianschmitz](https://github.com/ianschmitz)) - -#### :hammer: Underlying Tools - -- `babel-preset-react-app`, `cra-template-typescript`, `cra-template`, `create-react-app`, `react-dev-utils`, `react-error-overlay`, `react-scripts` - - [#8024](https://github.com/facebook/create-react-app/pull/8024) Bump dependencies ([@ianschmitz](https://github.com/ianschmitz)) -- `create-react-app`, `react-dev-utils`, `react-scripts` - - [#7988](https://github.com/facebook/create-react-app/pull/7988) Bump webpack-dev-server ([@ianschmitz](https://github.com/ianschmitz)) - - [#7876](https://github.com/facebook/create-react-app/pull/7876) Bump styling related loaders ([@andriijas](https://github.com/andriijas)) -- `react-app-polyfill` - - [#7999](https://github.com/facebook/create-react-app/pull/7999) Unpin dependencies in react-app-polyfill ([@ianschmitz](https://github.com/ianschmitz)) -- `babel-preset-react-app`, `react-app-polyfill`, `react-dev-utils`, `react-scripts` - - [#7986](https://github.com/facebook/create-react-app/pull/7986) Bump dependencies ([@ianschmitz](https://github.com/ianschmitz)) -- `react-scripts` - - [#7956](https://github.com/facebook/create-react-app/pull/7956) Upgrade jest-watch-typeahead ([@Andarist](https://github.com/Andarist)) - - [#7870](https://github.com/facebook/create-react-app/pull/7870) Fix eslint complaints in build.js ([@andriijas](https://github.com/andriijas)) - - [#7857](https://github.com/facebook/create-react-app/pull/7857) feat: upgrade terser & enable parallel minification in wsl ([@endiliey](https://github.com/endiliey)) - - [#7856](https://github.com/facebook/create-react-app/pull/7856) Move unused eslint webpack import into @remove-on-eject block ([@mrseanbaines](https://github.com/mrseanbaines)) -- `babel-preset-react-app`, `cra-template-typescript`, `create-react-app`, `react-app-polyfill`, `react-dev-utils`, `react-error-overlay`, `react-scripts` - - [#7951](https://github.com/facebook/create-react-app/pull/7951) Fix CI ([@ianschmitz](https://github.com/ianschmitz)) -- `react-dev-utils` - - [#7910](https://github.com/facebook/create-react-app/pull/7910) Update open ([@andriijas](https://github.com/andriijas)) -- `babel-plugin-named-asset-import`, `babel-preset-react-app`, `react-error-overlay`, `react-scripts` - - [#7814](https://github.com/facebook/create-react-app/pull/7814) Upgrade outdated packages ([@andriijas](https://github.com/andriijas)) -- `react-error-overlay`, `react-scripts` - - [#7875](https://github.com/facebook/create-react-app/pull/7875) Bump react ([@andriijas](https://github.com/andriijas)) - -#### Committers: 42 - -- Abdul Wahab ⚡️ ([@waahab](https://github.com/waahab)) -- Alex Guerra ([@heyimalex](https://github.com/heyimalex)) -- Ali Waseem ([@awaseem](https://github.com/awaseem)) -- Andreas Cederström ([@andriijas](https://github.com/andriijas)) -- Ben Blank ([@benblank](https://github.com/benblank)) -- Brody McKee ([@mrmckeb](https://github.com/mrmckeb)) -- Chun ([@cchanxzy](https://github.com/cchanxzy)) -- Damian Senn ([@topaxi](https://github.com/topaxi)) -- Daniel Lo Nigro ([@Daniel15](https://github.com/Daniel15)) -- Donavon West ([@donavon](https://github.com/donavon)) -- Dylan Staley ([@dstaley](https://github.com/dstaley)) -- Endi ([@endiliey](https://github.com/endiliey)) -- Fabiano Brito ([@Fabianopb](https://github.com/Fabianopb)) -- Guillaume Hertault ([@GuiHash](https://github.com/GuiHash)) -- Havit Rovik ([@haruelrovix](https://github.com/haruelrovix)) -- Hugo David-Boyet ([@Hugodby](https://github.com/Hugodby)) -- Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz)) -- Ian Sutherland ([@iansu](https://github.com/iansu)) -- Jake Boone ([@jakeboone02](https://github.com/jakeboone02)) -- Jesse Jackson ([@jsejcksn](https://github.com/jsejcksn)) -- Jonathan Felchlin ([@GreenGremlin](https://github.com/GreenGremlin)) -- Joshua Robinson ([@buildbreakdo](https://github.com/buildbreakdo)) -- Justin Grant ([@justingrant](https://github.com/justingrant)) -- Kanitkorn Sujautra ([@lukyth](https://github.com/lukyth)) -- Kent C. Dodds ([@kentcdodds](https://github.com/kentcdodds)) -- Klas Björkqvist ([@klasbj](https://github.com/klasbj)) -- Mateusz Burzyński ([@Andarist](https://github.com/Andarist)) -- Max Davidson ([@maxdavidson](https://github.com/maxdavidson)) -- May ([@aprilandjan](https://github.com/aprilandjan)) -- Orta ([@orta](https://github.com/orta)) -- RJ ([@suprj](https://github.com/suprj)) -- Renato Augusto Gama dos Santos ([@renatoagds](https://github.com/renatoagds)) -- Robert FUSZENECKER ([@fuszenecker](https://github.com/fuszenecker)) -- Robert van Steen ([@rovansteen](https://github.com/rovansteen)) -- Sean Baines ([@mrseanbaines](https://github.com/mrseanbaines)) -- Sean Lafferty ([@seanlaff](https://github.com/seanlaff)) -- Tharun Rajendran ([@tharun208](https://github.com/tharun208)) -- Tomáš Hübelbauer ([@TomasHubelbauer](https://github.com/TomasHubelbauer)) -- Wataru Ashihara ([@wataash](https://github.com/wataash)) -- Xuhao ([@Xuhao](https://github.com/Xuhao)) -- [@reactjser](https://github.com/reactjser) -- darthmaim ([@darthmaim](https://github.com/darthmaim)) - -### Migrating from 3.2.0 to 3.3.0 - -Inside any created project that has not been ejected, run: - -```sh -npm install --save --save-exact react-scripts@3.3.0 -``` - -or - -```sh -yarn add --exact react-scripts@3.3.0 -``` - -## 3.2.0 (2019-10-03) - -v3.2.0 is a minor release that adds support for production profiling and ignoring TypeScript type errors to make migrating JavaScript projects to TypeScript easier. It also includes other minor bug fixes and documentation updates. - -#### :rocket: New Feature - -- `react-scripts` - - [#7737](https://github.com/facebook/create-react-app/pull/7737) Support production profiling with React Developer Tools ([@JacobMGEvans](https://github.com/JacobMGEvans)) -- `react-dev-utils`, `react-scripts` - - [#6931](https://github.com/facebook/create-react-app/pull/6931) Adds TSC_COMPILE_ON_ERROR env var... ([@kylebebak](https://github.com/kylebebak)) - -#### :bug: Bug Fix - -- `react-scripts` - - [#7754](https://github.com/facebook/create-react-app/pull/7754) Fix linting error when using rest props ([@alexandrtovmach](https://github.com/alexandrtovmach)) -- `react-app-polyfill` - - [#7205](https://github.com/facebook/create-react-app/pull/7205) Guard polyfills against window possibly being undefined ([@jxom](https://github.com/jxom)) - -#### :nail_care: Enhancement - -- `react-scripts` - - [#7687](https://github.com/facebook/create-react-app/pull/7687) Use installing package manager in README ([@ashr81](https://github.com/ashr81)) - - [#7755](https://github.com/facebook/create-react-app/pull/7755) Support setting baseUrl to root directory ([@rovansteen](https://github.com/rovansteen)) - - [#7530](https://github.com/facebook/create-react-app/pull/7530) only load eslint config when EXTEND_ESLINT environment variable is specified/ do not swallow eslint config errors ([@n1ru4l](https://github.com/n1ru4l)) - - [#7742](https://github.com/facebook/create-react-app/pull/7742) set output.globalObject to 'this' ([@kentcdodds](https://github.com/kentcdodds)) - - [#7721](https://github.com/facebook/create-react-app/pull/7721) Add "entrypoints" key to asset manifest ([@samuelmeuli](https://github.com/samuelmeuli)) - - [#7562](https://github.com/facebook/create-react-app/pull/7562) enable .eslintignore again ([@igtm](https://github.com/igtm)) -- `react-dev-utils` - - [#6980](https://github.com/facebook/create-react-app/pull/6980) Stop hiding the column number of ESLint errors ([@justingrant](https://github.com/justingrant)) - -#### :memo: Documentation - -- [#7302](https://github.com/facebook/create-react-app/pull/7302) docs: note that 2 to 3 migration may require deletion of node_modules ([@kimpers](https://github.com/kimpers)) -- [#7757](https://github.com/facebook/create-react-app/pull/7757) Documentation typo fix: accessbile→accessible ([@tomer](https://github.com/tomer)) -- [#7601](https://github.com/facebook/create-react-app/pull/7601) [Documentation] Updated list of supported Jest config overrides ([@neilbryson](https://github.com/neilbryson)) -- [#7705](https://github.com/facebook/create-react-app/pull/7705) Update runtime chunk name separator in docs ([@samuelmeuli](https://github.com/samuelmeuli)) - -#### :house: Internal - -- `react-scripts` - - [#7752](https://github.com/facebook/create-react-app/pull/7752) Fix wrong letter casing ([@lewislbr](https://github.com/lewislbr)) + - [#9359](https://github.com/facebook/create-react-app/pull/9359) feat: exit on outdated create-react-app version ([@mrmckeb](https://github.com/mrmckeb)) +- `cra-template-typescript`, `cra-template`, `react-scripts` + - [#9205](https://github.com/facebook/create-react-app/pull/9205) Switch to the Workbox InjectManifest plugin ([@jeffposnick](https://github.com/jeffposnick)) - `react-dev-utils`, `react-scripts` - - [#7707](https://github.com/facebook/create-react-app/pull/7707) Remove 'shortcut' link type before 'icon' ([@lewislbr](https://github.com/lewislbr)) - -#### :hammer: Underlying Tools - -- `react-scripts` - - [#7729](https://github.com/facebook/create-react-app/pull/7729) Remove switch case ([@andrelmlins](https://github.com/andrelmlins)) - -#### Committers: 19 - -- Alexandr Tovmach ([@alexandrtovmach](https://github.com/alexandrtovmach)) -- André Lins ([@andrelmlins](https://github.com/andrelmlins)) -- Ashrith Reddy ([@ashr81](https://github.com/ashr81)) -- Federico Zivolo ([@FezVrasta](https://github.com/FezVrasta)) -- Iguchi Tomokatsu ([@igtm](https://github.com/igtm)) -- Jacob M-G Evans ([@JacobMGEvans](https://github.com/JacobMGEvans)) -- Jake Moxey ([@jxom](https://github.com/jxom)) -- Justin Grant ([@justingrant](https://github.com/justingrant)) -- Kent C. Dodds ([@kentcdodds](https://github.com/kentcdodds)) -- Kim Persson ([@kimpers](https://github.com/kimpers)) -- Kyle Bebak ([@kylebebak](https://github.com/kylebebak)) -- Laurin Quast ([@n1ru4l](https://github.com/n1ru4l)) -- Lewis Llobera ([@lewislbr](https://github.com/lewislbr)) -- Rakan Nimer ([@rakannimer](https://github.com/rakannimer)) -- Reece Dunham ([@RDIL](https://github.com/RDIL)) -- Robert van Steen ([@rovansteen](https://github.com/rovansteen)) -- Samuel Meuli ([@samuelmeuli](https://github.com/samuelmeuli)) -- Tomer Cohen ([@tomer](https://github.com/tomer)) -- neilbryson ([@neilbryson](https://github.com/neilbryson)) - -### Migrating from 3.1.2 to 3.2.0 - -Inside any created project that has not been ejected, run: - -```sh -npm install --save --save-exact react-scripts@3.2.0 -``` - -or - -```sh -yarn add --exact react-scripts@3.2.0 -``` - -## 3.1.2 (2019-09-19) - -v3.1.2 is a maintenance release that includes minor bug fixes and documentation updates. - -#### :bug: Bug Fix - -- `react-scripts` - - [#7679](https://github.com/facebook/create-react-app/pull/7679) Change runtime chunk name separator from tilde to dash ([@javadoug](https://github.com/javadoug)) - - [#7538](https://github.com/facebook/create-react-app/pull/7538) Explicitly checking that EXTEND_ESLINT is true ([@BrockWills](https://github.com/BrockWills)) -- `babel-preset-react-app`, `react-error-overlay`, `react-scripts` - - [#7662](https://github.com/facebook/create-react-app/pull/7662) Fix build ([@ianschmitz](https://github.com/ianschmitz)) - -#### :nail_care: Enhancement - -- `react-scripts` - - [#7704](https://github.com/facebook/create-react-app/pull/7704) Add new logo ([@iansu](https://github.com/iansu)) - - [#7587](https://github.com/facebook/create-react-app/pull/7587) Minor performance improvements ([@deftomat](https://github.com/deftomat)) - - [#7633](https://github.com/facebook/create-react-app/pull/7633) Disable babel-loader's cacheCompression ([@jleclanche](https://github.com/jleclanche)) - -#### :memo: Documentation - -- [#7616](https://github.com/facebook/create-react-app/pull/7616) Update deployment.md with another AWS example ([@AndrewBestbier](https://github.com/AndrewBestbier)) -- [#7663](https://github.com/facebook/create-react-app/pull/7663) Remove --single-quote from prettier examples ([@brlewis](https://github.com/brlewis)) -- [#7659](https://github.com/facebook/create-react-app/pull/7659) Update running-tests.md ([@weyert](https://github.com/weyert)) -- [#7459](https://github.com/facebook/create-react-app/pull/7459) Update troubleshooting.md ([@prevostc](https://github.com/prevostc)) -- [#7650](https://github.com/facebook/create-react-app/pull/7650) Adopt Contributor Covenant ([@iansu](https://github.com/iansu)) -- [#7620](https://github.com/facebook/create-react-app/pull/7620) cleanup-after-each is no longer necessary! ([@iHmD](https://github.com/iHmD)) -- [#7613](https://github.com/facebook/create-react-app/pull/7613) Fix seams between changelog majors ([@emilpalsson](https://github.com/emilpalsson)) -- [#7368](https://github.com/facebook/create-react-app/pull/7368) Correcting proxy sample ([@szabolcs-szilagyi](https://github.com/szabolcs-szilagyi)) -- [#7536](https://github.com/facebook/create-react-app/pull/7536) add a migration step to remove static from robots.txt ([@lookfirst](https://github.com/lookfirst)) -- [#7521](https://github.com/facebook/create-react-app/pull/7521) Show logo for mobile views in create-react-app.dev ([@GrooChu](https://github.com/GrooChu)) - -#### :house: Internal - -- `react-scripts` - - [#7526](https://github.com/facebook/create-react-app/pull/7526) The variable dotenvFiles is never reassigned - use const instead ([@Primajin](https://github.com/Primajin)) - - [#7585](https://github.com/facebook/create-react-app/pull/7585) remove trailing spaces ([@xiaoxiangmoe](https://github.com/xiaoxiangmoe)) - -#### :hammer: Underlying Tools - -- `babel-plugin-named-asset-import`, `confusing-browser-globals`, `react-app-polyfill`, `react-dev-utils`, `react-error-overlay`, `react-scripts` - - [#7681](https://github.com/facebook/create-react-app/pull/7681) Bump dependencies ([@ianschmitz](https://github.com/ianschmitz)) -- `react-scripts` - - [#7531](https://github.com/facebook/create-react-app/pull/7531) Upgrade dotenv-expand to fix issues ([@DominicTobias](https://github.com/DominicTobias)) -- `eslint-config-react-app`, `react-scripts` - - [#7540](https://github.com/facebook/create-react-app/pull/7540) Bump version of @typescript-eslint/\* ([@pierreneter](https://github.com/pierreneter)) - -#### Committers: 20 - -- Andrew ([@AndrewBestbier](https://github.com/AndrewBestbier)) -- Brock Wills ([@BrockWills](https://github.com/BrockWills)) -- Clément Prévost ([@prevostc](https://github.com/prevostc)) -- Dominic Tobias ([@DominicTobias](https://github.com/DominicTobias)) -- Doug Ross ([@javadoug](https://github.com/javadoug)) -- Emil Pålsson ([@emilpalsson](https://github.com/emilpalsson)) -- Federico Zivolo ([@FezVrasta](https://github.com/FezVrasta)) -- Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz)) -- Ian Sutherland ([@iansu](https://github.com/iansu)) -- Jannis Hell ([@Primajin](https://github.com/Primajin)) -- Jerome Leclanche ([@jleclanche](https://github.com/jleclanche)) -- Jon Stevens ([@lookfirst](https://github.com/lookfirst)) -- Sabesh Rajendran ([@GrooChu](https://github.com/GrooChu)) -- Tomáš Szabo ([@deftomat](https://github.com/deftomat)) -- Weyert de Boer ([@weyert](https://github.com/weyert)) -- ZHAO Jinxiang ([@xiaoxiangmoe](https://github.com/xiaoxiangmoe)) -- [@brlewis](https://github.com/brlewis) -- [@iHmD](https://github.com/iHmD) -- [@pierreneter](https://github.com/pierreneter) -- szabi ([@szabolcs-szilagyi](https://github.com/szabolcs-szilagyi)) - -### Migrating from 3.1.1 to 3.1.2 - -Inside any created project that has not been ejected, run: - -```sh -npm install --save --save-exact react-scripts@3.1.2 -``` - -or - -```sh -yarn add --exact react-scripts@3.1.2 -``` - -## 3.1.1 (2019-08-13) - -v3.1.1 is a maintenance release that includes minor bug fixes and documentation updates. - -#### :bug: Bug Fix - -- `react-scripts` - - [#7513](https://github.com/facebook/create-react-app/pull/7513) Fix ESLint 6 support ([@ianschmitz](https://github.com/ianschmitz)) - - [#7508](https://github.com/facebook/create-react-app/pull/7508) Don't block static files in robots.txt ([@iansu](https://github.com/iansu)) - -#### :nail_care: Enhancement - -- `eslint-config-react-app` - - [#7393](https://github.com/facebook/create-react-app/pull/7393) Ignore "jsx-a11y/aria-role" for React components ([@deftomat](https://github.com/deftomat)) - -#### :memo: Documentation - -- [#7527](https://github.com/facebook/create-react-app/pull/7527) Update Netlify config ([@iansu](https://github.com/iansu)) -- [#7500](https://github.com/facebook/create-react-app/pull/7500) Add links to Spectrum in README and docs ([@iansu](https://github.com/iansu)) - -#### Committers: 3 - -- Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz)) -- Ian Sutherland ([@iansu](https://github.com/iansu)) -- Tomáš Szabo ([@deftomat](https://github.com/deftomat)) - -### Migrating from 3.1.0 to 3.1.1 - -Optionally remove `Disallow: /static/` from `public/robots.txt` if you want to allow your images and other static files to be indexed by search engines [#7508](https://github.com/facebook/create-react-app/pull/7508) - -Inside any created project that has not been ejected, run: - -```sh -npm install --save --save-exact react-scripts@3.1.1 -``` - -or - -```sh -yarn add --exact react-scripts@3.1.1 -``` - -## 3.1.0 (2019-08-09) - -v3.1.0 is a minor release that adds ESLint 6 support as well as experimental support for extended and customizing the ESLint config along with other minor bug fixes and documentation updates. The upgrade to ESLint 6 is a breaking change _only_ if you're using `eslint-config-react-app` or `react-error-overlay` outside of Create React App. - -# Highlights - -- ESLint 6: #7415 -- Experimental ESLint config customization: #7036 -- More Jest config options: #6055 -- Option to configure or disable image inlining: #6060 - -#### :rocket: New Feature - -- `eslint-config-react-app`, `react-error-overlay`, `react-scripts` - - [#7415](https://github.com/facebook/create-react-app/pull/7415) Add ESLint 6 support ([@mrmckeb](https://github.com/mrmckeb)) -- `eslint-config-react-app`, `react-scripts` - - [#7036](https://github.com/facebook/create-react-app/pull/7036) Add ESLint extend support to eslint-loader ([@mrmckeb](https://github.com/mrmckeb)) -- `react-dev-utils` - - [#7277](https://github.com/facebook/create-react-app/pull/7277) Handle browser arguments ([@arvigeus](https://github.com/arvigeus)) -- `react-scripts` - - [#6060](https://github.com/facebook/create-react-app/pull/6060) Add environment variable to control image inlining threshold ([@peterbe](https://github.com/peterbe)) - - [#6055](https://github.com/facebook/create-react-app/pull/6055) Support for graceful extension of Jest config ([@jamesmfriedman](https://github.com/jamesmfriedman)) + - [#8582](https://github.com/facebook/create-react-app/pull/8582) Add experimental react-refresh support ([@charrondev](https://github.com/charrondev)) #### :boom: Breaking Change - `eslint-config-react-app`, `react-error-overlay`, `react-scripts` - - [#7415](https://github.com/facebook/create-react-app/pull/7415) Add ESLint 6 support ([@mrmckeb](https://github.com/mrmckeb)) - -#### :bug: Bug Fix - -- `react-dev-utils` - - [#7444](https://github.com/facebook/create-react-app/pull/7444) Fix for #6720: HMR not working in Firefox if proxy option present ([@dmile](https://github.com/dmile)) -- `react-scripts` - - [#5829](https://github.com/facebook/create-react-app/pull/5829) Resolve relative paths for preprocessor styles ([@iamandrewluca](https://github.com/iamandrewluca)) - - [#7433](https://github.com/facebook/create-react-app/pull/7433) Add explicit check for --watchAll=false ([@mrmckeb](https://github.com/mrmckeb)) - - [#7378](https://github.com/facebook/create-react-app/pull/7378) Update url-loader to 2.0.1 ([@heyimalex](https://github.com/heyimalex)) + - [#8963](https://github.com/facebook/create-react-app/pull/8963) feat(eslint-config-react-app): Add jest & testing-library rules ([@MichaelDeBoey](https://github.com/MichaelDeBoey)) + - [#8978](https://github.com/facebook/create-react-app/pull/8978) Support ESLint 7.x ([@MichaelDeBoey](https://github.com/MichaelDeBoey)) +- `cra-template-typescript`, `cra-template`, `eslint-config-react-app`, `react-error-overlay`, `react-scripts` + - [#9587](https://github.com/facebook/create-react-app/pull/9587) Remove EXTEND_ESLINT and add Jest rules ([@mrmckeb](https://github.com/mrmckeb)) - `eslint-config-react-app` - - [#7230](https://github.com/facebook/create-react-app/pull/7230) jsx-no-duplicate-props ignore case fix ([@rommguy](https://github.com/rommguy)) - - [#7219](https://github.com/facebook/create-react-app/pull/7219) fix: eslintrc overrides key should be an array, not object ([@ivan-aksamentov](https://github.com/ivan-aksamentov)) - - [#7079](https://github.com/facebook/create-react-app/pull/7079) Adjust typescript-eslint to not warn about typedefs when used before defined ([@vincentjames501](https://github.com/vincentjames501)) -- `react-error-overlay`, `react-scripts` - - [#7257](https://github.com/facebook/create-react-app/pull/7257) Upgrade webpack to 4.35.0 to fix dynamic import issue ([@iansu](https://github.com/iansu)) - -#### :nail_care: Enhancement - -- `react-scripts` - - [#7497](https://github.com/facebook/create-react-app/pull/7497) add readonly modifier for css module ([@xiaoxiangmoe](https://github.com/xiaoxiangmoe)) - - [#7496](https://github.com/facebook/create-react-app/pull/7496) bump sass-loader ([@xiaoxiangmoe](https://github.com/xiaoxiangmoe)) - - [#7176](https://github.com/facebook/create-react-app/pull/7176) Fix RegExp from navigateFallbackBlacklist (workbox) ([@nuragic](https://github.com/nuragic)) - - [#7080](https://github.com/facebook/create-react-app/pull/7080) Support configuring coveragePathIgnorePatterns ([@kentcdodds](https://github.com/kentcdodds)) - - [#7482](https://github.com/facebook/create-react-app/pull/7482) 100% lighthouse score for progressive web app ([@dscanlan](https://github.com/dscanlan)) - - [#5951](https://github.com/facebook/create-react-app/pull/5951) Set jsonpFunction by default ([@sibiraj-s](https://github.com/sibiraj-s)) - - [#7472](https://github.com/facebook/create-react-app/pull/7472) Typescript init: suggest `jsx: "react"` in tsconfig ([@kingdaro](https://github.com/kingdaro)) - - [#7118](https://github.com/facebook/create-react-app/pull/7118) Append title element to SVG component via title prop ([@sudkumar](https://github.com/sudkumar)) -- `react-dev-utils` - - [#7028](https://github.com/facebook/create-react-app/pull/7028) Add vscodium to the editor list ([@leonardodino](https://github.com/leonardodino)) - - [#7277](https://github.com/facebook/create-react-app/pull/7277) Handle browser arguments ([@arvigeus](https://github.com/arvigeus)) -- `eslint-config-react-app`, `react-error-overlay`, `react-scripts` - - [#7415](https://github.com/facebook/create-react-app/pull/7415) Add ESLint 6 support ([@mrmckeb](https://github.com/mrmckeb)) -- `eslint-config-react-app` - - [#7179](https://github.com/facebook/create-react-app/pull/7179) Disabled Typescript no-undef rule per typescript-eslint #477 ([@andyhopp](https://github.com/andyhopp)) + - [#9401](https://github.com/facebook/create-react-app/pull/9401) fix: remove deprecated rule ([@ljosberinn](https://github.com/ljosberinn)) - `create-react-app` - - [#6941](https://github.com/facebook/create-react-app/pull/6941) Fix compatibility of create-react-app to Node.js v0.10+ ([@tobiasbueschel](https://github.com/tobiasbueschel)) - -#### :memo: Documentation - -- Other - - [#7488](https://github.com/facebook/create-react-app/pull/7488) Adjusted deployment documentation for ZEIT Now ([@leo](https://github.com/leo)) - - [#7462](https://github.com/facebook/create-react-app/pull/7462) Added dependencies to bootstrap article when using custom SCSS. ([@eclectic-coding](https://github.com/eclectic-coding)) - - [#7340](https://github.com/facebook/create-react-app/pull/7340) Update testing-library related npm package names in README ([@balazsorban44](https://github.com/balazsorban44)) - - [#7423](https://github.com/facebook/create-react-app/pull/7423) Add question issue template ([@iansu](https://github.com/iansu)) - - [#7260](https://github.com/facebook/create-react-app/pull/7260) Docs: remove an outdated TypeScript-related note ([@MidnightDesign](https://github.com/MidnightDesign)) - - [#7372](https://github.com/facebook/create-react-app/pull/7372) proposal dynamic import are stage 4 ([@gespispace](https://github.com/gespispace)) - - [#7374](https://github.com/facebook/create-react-app/pull/7374) docs(svg): add tip for title props accessibility ([@sudkumar](https://github.com/sudkumar)) - - [#7182](https://github.com/facebook/create-react-app/pull/7182) Update minimum Node versions in docs ([@JESii](https://github.com/JESii)) - - [#7317](https://github.com/facebook/create-react-app/pull/7317) Fix typo ([@mvasin](https://github.com/mvasin)) - - [#7262](https://github.com/facebook/create-react-app/pull/7262) Docs: replace the command line to install relay/macro ([@soufDev](https://github.com/soufDev)) - - [#7170](https://github.com/facebook/create-react-app/pull/7170) Update deprecated package reference ([@bnewcomb](https://github.com/bnewcomb)) - - [#7133](https://github.com/facebook/create-react-app/pull/7133) Make the OOM abreviation more clear ([@tlehtimaki](https://github.com/tlehtimaki)) - - [#7086](https://github.com/facebook/create-react-app/pull/7086) Improve breaking changes info for CRA 3.0.0 ([@falldowngoboone](https://github.com/falldowngoboone)) - - [#7059](https://github.com/facebook/create-react-app/pull/7059) Correct spelling of browserslist ([@amyrlam](https://github.com/amyrlam)) - - [#7039](https://github.com/facebook/create-react-app/pull/7039) docs: fix env-cmd example in deployment section ([@VMois](https://github.com/VMois)) - - [#7041](https://github.com/facebook/create-react-app/pull/7041) Updates the relay docs ([@orta](https://github.com/orta)) -- `eslint-config-react-app` - - [#7451](https://github.com/facebook/create-react-app/pull/7451) Update README for ESLint config ([@mrmckeb](https://github.com/mrmckeb)) - - [#7274](https://github.com/facebook/create-react-app/pull/7274) Update peer dependencies ([@ThewBear](https://github.com/ThewBear)) -- `react-error-overlay`, `react-scripts` - - [#7355](https://github.com/facebook/create-react-app/pull/7355) Fix typos ([@minho42](https://github.com/minho42)) - -#### :house: Internal - -- `babel-preset-react-app` - - [#5818](https://github.com/facebook/create-react-app/pull/5818) Remove unused dependencies in babel-preset-react-app ([@iansu](https://github.com/iansu)) - - [#7208](https://github.com/facebook/create-react-app/pull/7208) Use correct babel transform for dynamic import in dependencies ([@jamesknelson](https://github.com/jamesknelson)) -- `react-scripts` - - [#7433](https://github.com/facebook/create-react-app/pull/7433) Add explicit check for --watchAll=false ([@mrmckeb](https://github.com/mrmckeb)) - - [#6877](https://github.com/facebook/create-react-app/pull/6877) Upgrade svgr to 4.2.0 ([@iansu](https://github.com/iansu)) -- Other - - [#7385](https://github.com/facebook/create-react-app/pull/7385) Attempt at fixing CI issue on windows ([@heyimalex](https://github.com/heyimalex)) - - [#7269](https://github.com/facebook/create-react-app/pull/7269) Update issue templates ([@mrmckeb](https://github.com/mrmckeb)) - - [#7220](https://github.com/facebook/create-react-app/pull/7220) Disable Travis build ([@ianschmitz](https://github.com/ianschmitz)) - - [#7096](https://github.com/facebook/create-react-app/pull/7096) Add Azure DevOps build pipeline ([@ianschmitz](https://github.com/ianschmitz)) - - [#6858](https://github.com/facebook/create-react-app/pull/6858) Add test to make sure .d.ts files are ignored when checking for TypeScript ([@iansu](https://github.com/iansu)) -- `react-error-overlay`, `react-scripts` - - [#7355](https://github.com/facebook/create-react-app/pull/7355) Fix typos ([@minho42](https://github.com/minho42)) - -#### :hammer: Underlying Tools - -- `babel-plugin-named-asset-import`, `babel-preset-react-app`, `confusing-browser-globals`, `create-react-app`, `react-app-polyfill`, `react-dev-utils`, `react-error-overlay`, `react-scripts` - - [#7473](https://github.com/facebook/create-react-app/pull/7473) Bump dependencies ([@ianschmitz](https://github.com/ianschmitz)) -- `eslint-config-react-app`, `react-error-overlay`, `react-scripts` - - [#7415](https://github.com/facebook/create-react-app/pull/7415) Add ESLint 6 support ([@mrmckeb](https://github.com/mrmckeb)) + - [#9359](https://github.com/facebook/create-react-app/pull/9359) feat: exit on outdated create-react-app version ([@mrmckeb](https://github.com/mrmckeb)) +- `cra-template-typescript`, `cra-template`, `react-scripts` + - [#9205](https://github.com/facebook/create-react-app/pull/9205) Switch to the Workbox InjectManifest plugin ([@jeffposnick](https://github.com/jeffposnick)) +- `babel-plugin-named-asset-import`, `confusing-browser-globals`, `create-react-app`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#8955](https://github.com/facebook/create-react-app/pull/8955) Upgrade to Jest 26 ([@ianschmitz](https://github.com/ianschmitz)) +- `create-react-app`, `react-scripts` + - [#8934](https://github.com/facebook/create-react-app/pull/8934) feat: remove typescript flag and NODE_PATH support ([@mrmckeb](https://github.com/mrmckeb)) +- `react-scripts` + - [#9037](https://github.com/facebook/create-react-app/pull/9037) Fix dotenv file loading order ([@Timer](https://github.com/Timer)) + - [#7899](https://github.com/facebook/create-react-app/pull/7899) Set resetMocks to true by default in jest config ([@alexkrolick](https://github.com/alexkrolick)) +- `babel-plugin-named-asset-import`, `babel-preset-react-app`, `create-react-app`, `react-app-polyfill`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#8950](https://github.com/facebook/create-react-app/pull/8950) Dependency major version upgrades ([@ianschmitz](https://github.com/ianschmitz)) - `eslint-config-react-app`, `react-scripts` - - [#7036](https://github.com/facebook/create-react-app/pull/7036) Add ESLint extend support to eslint-loader ([@mrmckeb](https://github.com/mrmckeb)) -- `react-scripts` - - [#7118](https://github.com/facebook/create-react-app/pull/7118) Append title element to SVG component via title prop ([@sudkumar](https://github.com/sudkumar)) - - [#7222](https://github.com/facebook/create-react-app/pull/7222) Update @typescript-eslint package versions ([@ianschmitz](https://github.com/ianschmitz)) - - [#7131](https://github.com/facebook/create-react-app/pull/7131) Update fsevents dependency version ([@eps1lon](https://github.com/eps1lon)) -- `react-dev-utils` - - [#7058](https://github.com/facebook/create-react-app/pull/7058) fix: Replaced opn (deprecated) with open ([@jamesgeorge007](https://github.com/jamesgeorge007)) - -#### Committers: 46 - -- Adeel Imran ([@adeelibr](https://github.com/adeelibr)) -- Alex Guerra ([@heyimalex](https://github.com/heyimalex)) -- Amy Lam ([@amyrlam](https://github.com/amyrlam)) -- Andrea Puddu ([@nuragic](https://github.com/nuragic)) -- Andrew Luca ([@iamandrewluca](https://github.com/iamandrewluca)) -- Andy Hopper ([@andyhopp](https://github.com/andyhopp)) -- Balázs Orbán ([@balazsorban44](https://github.com/balazsorban44)) -- Ben Newcomb ([@bnewcomb](https://github.com/bnewcomb)) -- Brian Muenzenmeyer ([@bmuenzenmeyer](https://github.com/bmuenzenmeyer)) -- Brody McKee ([@mrmckeb](https://github.com/mrmckeb)) -- Chuck ([@eclectic-coding](https://github.com/eclectic-coding)) -- Darius Tall ([@kingdaro](https://github.com/kingdaro)) -- Dmitry Lepskiy ([@dmile](https://github.com/dmile)) -- Guy Romm ([@rommguy](https://github.com/rommguy)) -- Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz)) -- Ian Sutherland ([@iansu](https://github.com/iansu)) -- Igor Muchychka ([@mucsi96](https://github.com/mucsi96)) -- Ivan Aksamentov ([@ivan-aksamentov](https://github.com/ivan-aksamentov)) -- Ivan Pegashev ([@gespispace](https://github.com/gespispace)) -- Jack Cross ([@crosscompile](https://github.com/crosscompile)) -- James Friedman ([@jamesmfriedman](https://github.com/jamesmfriedman)) -- James George ([@jamesgeorge007](https://github.com/jamesgeorge007)) -- James K Nelson ([@jamesknelson](https://github.com/jamesknelson)) -- Jon Seidel ([@JESii](https://github.com/JESii)) -- Kent C. Dodds ([@kentcdodds](https://github.com/kentcdodds)) -- Leo Lamprecht ([@leo](https://github.com/leo)) -- Leonardo Dino ([@leonardodino](https://github.com/leonardodino)) -- Mikhail Vasin ([@mvasin](https://github.com/mvasin)) -- Min ho Kim ([@minho42](https://github.com/minho42)) -- Nikolay Stoynov ([@arvigeus](https://github.com/arvigeus)) -- Orta ([@orta](https://github.com/orta)) -- Peter Bengtsson ([@peterbe](https://github.com/peterbe)) -- Rudolph Gottesheim ([@MidnightDesign](https://github.com/MidnightDesign)) -- Ryan Boone ([@falldowngoboone](https://github.com/falldowngoboone)) -- Ryan Marsh ([@ryanwmarsh](https://github.com/ryanwmarsh)) -- Sebastian Silbermann ([@eps1lon](https://github.com/eps1lon)) -- Sibiraj ([@sibiraj-s](https://github.com/sibiraj-s)) -- Soufiane AIT AKKACHE ([@soufDev](https://github.com/soufDev)) -- Sudhir Mitharwal ([@sudkumar](https://github.com/sudkumar)) -- Thew Dhanat ([@ThewBear](https://github.com/ThewBear)) -- Tobias Büschel ([@tobiasbueschel](https://github.com/tobiasbueschel)) -- Toni ([@tlehtimaki](https://github.com/tlehtimaki)) -- Vincent Pizzo ([@vincentjames501](https://github.com/vincentjames501)) -- Vladyslav Moisieienkov ([@VMois](https://github.com/VMois)) -- ZHAO Jinxiang ([@xiaoxiangmoe](https://github.com/xiaoxiangmoe)) -- dominic scanlan ([@dscanlan](https://github.com/dscanlan)) - -### Migrating from 3.0.1 to 3.1.0 - -Inside any created project that has not been ejected, run: - -```sh -npm install --save --save-exact react-scripts@3.1.0 -``` - -or - -```sh -yarn add --exact react-scripts@3.1.0 -``` - -## 3.0.1 (2019-05-08) - -v3.0.1 is a maintenance release that adjusts some ESLint rules for TypeScript along with other minor bug fixes and documentation updates. - -#### :boom: Breaking Change - -- `babel-preset-react-app` - - [#6887](https://github.com/facebook/create-react-app/pull/6887) Update dependencies of Babel preset with recent changes ([@skoging](https://github.com/skoging)) + - [#8926](https://github.com/facebook/create-react-app/pull/8926) Add import/no-anonymous-default-export lint rule ([@shakib609](https://github.com/shakib609)) + - [#8939](https://github.com/facebook/create-react-app/pull/8939) Bump React Hooks ESLint plugin to 4.0.0 ([@gaearon](https://github.com/gaearon)) +- `cra-template-typescript`, `cra-template`, `create-react-app`, `react-app-polyfill`, `react-dev-utils`, `react-scripts` + - [#8948](https://github.com/facebook/create-react-app/pull/8948) Drop Node 8 support ([@ianschmitz](https://github.com/ianschmitz)) +- `babel-plugin-named-asset-import`, `babel-preset-react-app`, `confusing-browser-globals`, `cra-template-typescript`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#8362](https://github.com/facebook/create-react-app/pull/8362) Upgrade to Jest 25 ([@skovhus](https://github.com/skovhus)) #### :bug: Bug Fix -- `react-error-overlay`, `react-scripts` - - [#7007](https://github.com/facebook/create-react-app/pull/7007) Unpin `babel-jest` ([@ianschmitz](https://github.com/ianschmitz)) - - [#7002](https://github.com/facebook/create-react-app/pull/7002) Temporary fix for `babel-jest` preflight error ([@ianschmitz](https://github.com/ianschmitz)) -- `eslint-config-react-app` - - [#6987](https://github.com/facebook/create-react-app/pull/6987) Disable `no-dupe-class-members` rule for TypeScript ([@ianschmitz](https://github.com/ianschmitz)) - - [#6862](https://github.com/facebook/create-react-app/pull/6862) Fix `no-useless-constructor` rule in TypeScript ([@ianschmitz](https://github.com/ianschmitz)) -- `eslint-config-react-app`, `react-scripts` - - [#6937](https://github.com/facebook/create-react-app/pull/6937) Disable `default-case` lint rule for TypeScript ([@ianschmitz](https://github.com/ianschmitz)) -- `react-dev-utils` - - [#6876](https://github.com/facebook/create-react-app/pull/6876) Change cssmodule classname hash to use relative paths ([@vg-stan](https://github.com/vg-stan)) - -#### :nail_care: Enhancement - -- `react-dev-utils`, `react-scripts` - - [#6856](https://github.com/facebook/create-react-app/pull/6856) Adds the configuration for PnP/Typescript ([@arcanis](https://github.com/arcanis)) -- `babel-preset-react-app` - - [#6887](https://github.com/facebook/create-react-app/pull/6887) Update dependencies of Babel preset with recent changes ([@skoging](https://github.com/skoging)) - `react-scripts` - - [#6706](https://github.com/facebook/create-react-app/pull/6706) Generate SVG component name in Jest fileTransform ([@dallonf](https://github.com/dallonf)) - - [#6300](https://github.com/facebook/create-react-app/pull/6300) Remove body padding reset from templates ([@Hurtak](https://github.com/Hurtak)) - -#### :memo: Documentation - -- Other - - [#6979](https://github.com/facebook/create-react-app/pull/6979) Add note to restart the dev server after changing .env file ([@MostafaNawara](https://github.com/MostafaNawara)) - - [#6945](https://github.com/facebook/create-react-app/pull/6945) Add clarifying note to TypeScript docs warning about global install of CRA ([@methodbox](https://github.com/methodbox)) - - [#6898](https://github.com/facebook/create-react-app/pull/6898) Update GraphQL docs ([@nagman](https://github.com/nagman)) - - [#6810](https://github.com/facebook/create-react-app/pull/6810) Call to action button now reacts to being hovered ([@joerez](https://github.com/joerez)) - - [#6881](https://github.com/facebook/create-react-app/pull/6881) Fix typo in deployment docs ([@david-cho-lerat-HL2](https://github.com/david-cho-lerat-HL2)) -- `react-app-polyfill` - - [#6879](https://github.com/facebook/create-react-app/pull/6879) Update README.md ([@david-cho-lerat-HL2](https://github.com/david-cho-lerat-HL2)) - -#### :house: Internal - -- `react-scripts` - - [#6854](https://github.com/facebook/create-react-app/pull/6854) Remove `Object.assign` from `MiniCssExtractPlugin` options ([@swashcap](https://github.com/swashcap)) - -#### Committers: 12 - -- Chris Shaffer ([@methodbox](https://github.com/methodbox)) -- Cory Reed ([@swashcap](https://github.com/swashcap)) -- Dallon Feldner ([@dallonf](https://github.com/dallonf)) -- David Cho-Lerat ([@david-cho-lerat-HL2](https://github.com/david-cho-lerat-HL2)) -- Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz)) -- Joe Rezendes ([@joerez](https://github.com/joerez)) -- Maël Nison ([@arcanis](https://github.com/arcanis)) -- Mostafa Nawara ([@MostafaNawara](https://github.com/MostafaNawara)) -- Petr Huřťák ([@Hurtak](https://github.com/Hurtak)) -- Tore Hammervoll ([@skoging](https://github.com/skoging)) -- [@nagman](https://github.com/nagman) -- [@vg-stan](https://github.com/vg-stan) - -### Migrating from 3.0.0 to 3.0.1 - -Inside any created project that has not been ejected, run: - -```sh -npm install --save --save-exact react-scripts@3.0.1 -``` - -or - -```sh -yarn add --exact react-scripts@3.0.1 -``` - -## 3.0.0 (April 22, 2019) - -Create React App 3.0 brings some exciting new features including support for [Hooks](https://reactjs.org/docs/hooks-intro.html)! - -Thanks to all the maintainers and contributors who worked so hard on this release! :tada: - -# Highlights - -- Jest 24: #6278 -- Hooks support: #5997 -- TypeScript linting: #6513 -- `browserslist` support in @babel/preset-env: #6608 -- Absolute imports using `jsconfig.json`/`tsconfig.json`: #6656 - -# Migrating from 2.1.x to 3.0.0 - -Inside any created project that has not been ejected, run: - -```bash -npm install --save --save-exact react-scripts@3.0.0 -``` - -or - -``` -yarn add --exact react-scripts@3.0.0 -``` - -**NOTE: You may need to delete your `node_modules` folder and reinstall your dependencies by running `yarn` (or `npm install`) if you encounter errors after upgrading.** - -If you previously ejected but now want to upgrade, one common solution is to find the commits where you ejected (and any subsequent commits changing the configuration), revert them, upgrade, and later optionally eject again. It’s also possible that the feature you ejected for is now supported out of the box. - -## Breaking Changes - -Like any major release, `react-scripts@3.0.0` contains a few breaking changes. We expect that they won't affect every user, but we recommend you look over this section to see if something is relevant to you. If we missed something, please file a new issue. - -### Jest 24 - -We've updated from Jest 23 to get the latest improvements in Jest 24. We've noticed some differences in snapshot serialization in Jest 24, so you may need to adjust your tests slightly once you update. You can read more about what's changed in the [Jest 24 blog post](https://jestjs.io/blog/2019/01/25/jest-24-refreshing-polished-typescript-friendly). - -### Hooks support - -We now enforce [Rules of Hooks](https://reactjs.org/docs/hooks-rules.html) with `eslint-plugin-react-hooks`. If you are breaking any of the rules of Hooks this will cause your build to fail. - -### TypeScript linting - -We now lint TypeScript files. You can see the list of [rules we enforce](https://github.com/facebook/create-react-app/blob/eee8491d57d67dd76f0806a7512eaba2ce9c36f0/packages/eslint-config-react-app/index.js#L89:L98) to check if your project is compatible. If you're using Visual Studio Code you can follow our guide to [setup up your editor to display lint warnings](https://facebook.github.io/create-react-app/docs/setting-up-your-editor#displaying-lint-output-in-the-editor). - -### `browserslist` support in @babel/preset-env - -The `browserslist` config in your `package.json` is now used to control the output of your JavaScript files. You can use separate configuration for `development` and `production`. See [here](https://github.com/facebook/create-react-app/blob/b0cbf2caa18ee8267855b14578ebc3dee826f552/packages/react-scripts/package.json#L83-L94) for a good starting point which gives a good development experience, especially when using language features such as async/await, but still provides high compatibility with many browsers in production - -### Remove --no-watch flag - -We've removed the `--no-watch` flag from the `start` script in favor of Jest's own `--watchAll=false`. - -### New structure in `asset-manifest.json` - -All asset paths have been moved under the `files` key in `asset-manifest.json`. - -## New Features - -### using `jsconfig.json`/`tsconfig.json` - -We now support setting `baseUrl` in `jsconfig.json` and `tsconfig.json`. To configure `baseUrl` to point to the `src` directory in your JavaScript project, create a `jsconfig.json` file in your project root: - -```json -{ - "compilerOptions": { - "baseUrl": "src" - }, - "include": ["src"] -} -``` - -If you have a TypeScript project you can configure `baseUrl` the same way in your `tsconfig.json`. - -Currently the only supported options for `baseUrl` are `node_modules` (the default) and `src`. - -### PostCSS Normalize - -You can now include a version of Normalize.css in your project that will use your `browserslist` setting to generate the appropriate styles for your target browsers. To include it simply add `@import-normalize` at the top of one of your CSS files. - -# Detailed Changelog - -#### :rocket: New Feature - -- `react-scripts` - - [#6656](https://github.com/facebook/create-react-app/pull/6656) Set baseUrl from jsconfig.json/tsconfig.json ([@rovansteen](https://github.com/rovansteen)) - - [#5810](https://github.com/facebook/create-react-app/pull/5810) Adds PostCSS Normalize ([@mrchief](https://github.com/mrchief)) -- `babel-plugin-named-asset-import`, `confusing-browser-globals`, `react-dev-utils`, `react-error-overlay`, `react-scripts` - - [#6278](https://github.com/facebook/create-react-app/pull/6278) Update to Jest 24 ([@loryman](https://github.com/loryman)) -- `eslint-config-react-app`, `react-scripts` - - [#6513](https://github.com/facebook/create-react-app/pull/6513) Add TypeScript linting support ([@ianschmitz](https://github.com/ianschmitz)) + - [#9805](https://github.com/facebook/create-react-app/pull/9805) Fix refreshOverlayInterop module scope error ([@ianschmitz](https://github.com/ianschmitz)) + - [#9037](https://github.com/facebook/create-react-app/pull/9037) Fix dotenv file loading order ([@Timer](https://github.com/Timer)) + - [#8700](https://github.com/facebook/create-react-app/pull/8700) Skip stdin resuming to support lerna parallel ([@hieuxlu](https://github.com/hieuxlu)) + - [#8845](https://github.com/facebook/create-react-app/pull/8845) Do not check for interactive session to shut down dev server ([@jeremywadsack](https://github.com/jeremywadsack)) + - [#8768](https://github.com/facebook/create-react-app/pull/8768) Add .cjs and .mjs files support to test runner ([@ai](https://github.com/ai)) - `babel-preset-react-app`, `eslint-config-react-app`, `react-scripts` - - [#5997](https://github.com/facebook/create-react-app/pull/5997) Support React Hooks (#5602) ([@eivind88](https://github.com/eivind88)) -- `babel-preset-react-app`, `react-dev-utils`, `react-scripts` - - [#6608](https://github.com/facebook/create-react-app/pull/6608) Support browserslist in @babel/preset-env ([@ianschmitz](https://github.com/ianschmitz)) - -#### :boom: Breaking Change - -- `react-scripts` - - [#6848](https://github.com/facebook/create-react-app/pull/6848) Remove no-watch flag in favor of watchAll=false ([@bugzpodder](https://github.com/bugzpodder)) - - [#6821](https://github.com/facebook/create-react-app/pull/6821) Add custom function to generate asset manifest ([@iansu](https://github.com/iansu)) - - [#6750](https://github.com/facebook/create-react-app/pull/6750) change NODE_ENV and PUBLIC_URL into readonly ([@xiaoxiangmoe](https://github.com/xiaoxiangmoe)) - - [#4176](https://github.com/facebook/create-react-app/pull/4176) Remove --coverage + --watch workaround for the test command ([@stipsan](https://github.com/stipsan)) - - [#6615](https://github.com/facebook/create-react-app/pull/6615) Allow .json type checking ([@ianschmitz](https://github.com/ianschmitz)) - - [#6821](https://github.com/facebook/create-react-app/pull/6821) Add custom function to generate asset manifest ([@iansu](https://github.com/iansu)) -- `babel-preset-react-app`, `react-app-polyfill` - - [#6769](https://github.com/facebook/create-react-app/pull/6769) Update to core-js@3 ([@ianschmitz](https://github.com/ianschmitz)) -- `babel-plugin-named-asset-import`, `confusing-browser-globals`, `react-dev-utils`, `react-error-overlay`, `react-scripts` - - [#6278](https://github.com/facebook/create-react-app/pull/6278) Update to Jest 24 ([@loryman](https://github.com/loryman)) + - [#9788](https://github.com/facebook/create-react-app/pull/9788) fix: resolve new JSX transform issues ([@mrmckeb](https://github.com/mrmckeb)) - `eslint-config-react-app`, `react-scripts` - - [#6513](https://github.com/facebook/create-react-app/pull/6513) Add TypeScript linting support ([@ianschmitz](https://github.com/ianschmitz)) -- `babel-preset-react-app`, `eslint-config-react-app`, `react-scripts` - - [#5997](https://github.com/facebook/create-react-app/pull/5997) Support React Hooks (#5602) ([@eivind88](https://github.com/eivind88)) -- `babel-preset-react-app`, `react-dev-utils`, `react-scripts` - - [#6608](https://github.com/facebook/create-react-app/pull/6608) Support browserslist in @babel/preset-env ([@ianschmitz](https://github.com/ianschmitz)) - -#### :bug: Bug Fix - -- `react-dev-utils` - - [#6735](https://github.com/facebook/create-react-app/pull/6735) InlineChunkHtmlPlugin works with empty publicPath ([@ItalyPaleAle](https://github.com/ItalyPaleAle)) -- `react-scripts` - - [#6732](https://github.com/facebook/create-react-app/pull/6732) fix: terser-webpack-plugin hanging on WSL ([@endiliey](https://github.com/endiliey)) - - [#6610](https://github.com/facebook/create-react-app/pull/6610) Convert JSON.stringify \n to os.EOL ([@MikeBeaton](https://github.com/MikeBeaton)) + - [#9683](https://github.com/facebook/create-react-app/pull/9683) fix: resolve ESLint config from appPath ([@mrmckeb](https://github.com/mrmckeb)) - `create-react-app` - - [#6759](https://github.com/facebook/create-react-app/pull/6759) Fix unlogged yarn pnp message ([@heyimalex](https://github.com/heyimalex)) + - [#9412](https://github.com/facebook/create-react-app/pull/9412) Fix template name handling ([@iansu](https://github.com/iansu)) +- `babel-preset-react-app` + - [#9374](https://github.com/facebook/create-react-app/pull/9374) fix: use default modules option from `preset-env` ([@JLHwung](https://github.com/JLHwung)) +- `react-dev-utils` + - [#9390](https://github.com/facebook/create-react-app/pull/9390) Publish refreshOverlayInterop with react-dev-utils ([@klinem](https://github.com/klinem)) + - [#8492](https://github.com/facebook/create-react-app/pull/8492) Replace period in CSS Module classnames ([@evankennedy](https://github.com/evankennedy)) +- `react-dev-utils`, `react-scripts` + - [#8694](https://github.com/facebook/create-react-app/pull/8694) Use process.execPath to spawn node subprocess ([@anuraaga](https://github.com/anuraaga)) +- `cra-template-typescript`, `cra-template`, `react-scripts` + - [#8734](https://github.com/facebook/create-react-app/pull/8734) fix: handle templates without main package field ([@mrmckeb](https://github.com/mrmckeb)) #### :nail_care: Enhancement - `react-scripts` - - [#6845](https://github.com/facebook/create-react-app/pull/6845) Change CRA version in `react-scripts` eject warning. ([@lffg](https://github.com/lffg)) - - [#6821](https://github.com/facebook/create-react-app/pull/6821) Add custom function to generate asset manifest ([@iansu](https://github.com/iansu)) - - [#6580](https://github.com/facebook/create-react-app/pull/6580) Fix react-scripts peer-deps link local issue ([@transitive-bullshit](https://github.com/transitive-bullshit)) - - [#6746](https://github.com/facebook/create-react-app/pull/6746) Replace deprecated SFC with FunctionComponent in react-app.d.ts ([@iamandrewluca](https://github.com/iamandrewluca)) - - [#6160](https://github.com/facebook/create-react-app/pull/6160) Suggests that tsconfig.json is incorrect only when SyntaxError is caught ([@Andarist](https://github.com/Andarist)) - - [#6696](https://github.com/facebook/create-react-app/pull/6696) Enable futureEmitAssets in webpack config ([@iansu](https://github.com/iansu)) - - [#6669](https://github.com/facebook/create-react-app/pull/6669) Remove unnecessary shrink-to-fit=no meta data ([@abdelrahmanrifai](https://github.com/abdelrahmanrifai)) - - [#5686](https://github.com/facebook/create-react-app/pull/5686) Add empty mock for http2 ([@kjin](https://github.com/kjin)) - - [#5960](https://github.com/facebook/create-react-app/pull/5960) add command to add files to staging after eject ([@clickclickonsal](https://github.com/clickclickonsal)) - - [#6615](https://github.com/facebook/create-react-app/pull/6615) Allow .json type checking ([@ianschmitz](https://github.com/ianschmitz)) - - [#6451](https://github.com/facebook/create-react-app/pull/6451) change class component to function component ([@xiaoxiangmoe](https://github.com/xiaoxiangmoe)) -- `babel-plugin-named-asset-import`, `babel-preset-react-app`, `confusing-browser-globals`, `create-react-app`, `eslint-config-react-app`, `react-app-polyfill`, `react-dev-utils`, `react-error-overlay`, `react-scripts` - - [#6826](https://github.com/facebook/create-react-app/pull/6826) Add directory details to packages/\* package.json ([@feelepxyz](https://github.com/feelepxyz)) -- `babel-preset-react-app`, `react-app-polyfill` - - [#6769](https://github.com/facebook/create-react-app/pull/6769) Update to core-js@3 ([@ianschmitz](https://github.com/ianschmitz)) + - [#9734](https://github.com/facebook/create-react-app/pull/9734) Use new JSX setting with TypeScript 4.1.0 ([@iansu](https://github.com/iansu)) + - [#8638](https://github.com/facebook/create-react-app/pull/8638) Support source maps for scss in dev environments ([@MKorostoff](https://github.com/MKorostoff)) + - [#8834](https://github.com/facebook/create-react-app/pull/8834) Don't use webpack multi entry unnecessarily ([@sebmarkbage](https://github.com/sebmarkbage)) +- `babel-preset-react-app`, `eslint-config-react-app`, `react-scripts` + - [#9861](https://github.com/facebook/create-react-app/pull/9861) New JSX Transform opt out ([@iansu](https://github.com/iansu)) +- `cra-template` + - [#9853](https://github.com/facebook/create-react-app/pull/9853) feat: remove unused React imports ([@mrmckeb](https://github.com/mrmckeb)) +- `babel-preset-react-app`, `react-scripts` + - [#9645](https://github.com/facebook/create-react-app/pull/9645) Use new JSX transform with React 17 ([@iansu](https://github.com/iansu)) +- `react-dev-utils`, `react-scripts` + - [#9350](https://github.com/facebook/create-react-app/pull/9350) Add Fast Refresh warning when using React < 16.10 ([@iansu](https://github.com/iansu)) +- `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#9375](https://github.com/facebook/create-react-app/pull/9375) feat: better refresh plugin integration ([@pmmmwh](https://github.com/pmmmwh)) +- `cra-template-typescript`, `cra-template` + - [#9116](https://github.com/facebook/create-react-app/pull/9116) Add performance relayer + documentation (web-vitals) ([@housseindjirdeh](https://github.com/housseindjirdeh)) + - [#8705](https://github.com/facebook/create-react-app/pull/8705) Update template tests ([@MichaelDeBoey](https://github.com/MichaelDeBoey)) - `create-react-app` - - [#6770](https://github.com/facebook/create-react-app/pull/6770) Warn when using react-scripts-ts ([@ianschmitz](https://github.com/ianschmitz)) -- `react-dev-utils` - - [#5821](https://github.com/facebook/create-react-app/pull/5821) Add wait: false to options object for opn ([@evalexpr](https://github.com/evalexpr)) - - [#6502](https://github.com/facebook/create-react-app/pull/6502) Enable click to go to error in console part 2! ([@johnnyreilly](https://github.com/johnnyreilly)) + - [#8460](https://github.com/facebook/create-react-app/pull/8460) Fix --use-pnp for Yarn 2 ([@nickmccurdy](https://github.com/nickmccurdy)) #### :memo: Documentation - Other - - [#6847](https://github.com/facebook/create-react-app/pull/6847) Add baseUrl documentation ([@ianschmitz](https://github.com/ianschmitz)) - - [#6801](https://github.com/facebook/create-react-app/pull/6801) Copy fixes in adding Bootstrap docs ([@panckreous](https://github.com/panckreous)) - - [#6820](https://github.com/facebook/create-react-app/pull/6820) Fix docs about minimum React version for SVG component support ([@iansu](https://github.com/iansu)) - - [#6817](https://github.com/facebook/create-react-app/pull/6817) Add link to TypeScript page in Getting Started ([@ianschmitz](https://github.com/ianschmitz)) - - [#6786](https://github.com/facebook/create-react-app/pull/6786) Clarify production build output files documentation ([@bakuzan](https://github.com/bakuzan)) - - [#6783](https://github.com/facebook/create-react-app/pull/6783) Add SVG support dependency note ([@pnarielwala](https://github.com/pnarielwala)) - - [#6772](https://github.com/facebook/create-react-app/pull/6772) Update link to React Testing Library docs ([@fjoshuajr](https://github.com/fjoshuajr)) - - [#6695](https://github.com/facebook/create-react-app/pull/6695) Add Render deployment section ([@anurag](https://github.com/anurag)) - - [#6082](https://github.com/facebook/create-react-app/pull/6082) Add explanation for adding everything as dependencies to docs ([@mikeattara](https://github.com/mikeattara)) - - [#5481](https://github.com/facebook/create-react-app/pull/5481) Document .graphql and .gql file loading with graphql.macro ([@petetnt](https://github.com/petetnt)) - - [#6491](https://github.com/facebook/create-react-app/pull/6491) Update advanced-configuration.md ([@stephengodderidge](https://github.com/stephengodderidge)) - - [#6208](https://github.com/facebook/create-react-app/pull/6208) Add deployment instructions with AWS Amplify ([@swaminator](https://github.com/swaminator)) - - [#6374](https://github.com/facebook/create-react-app/pull/6374) Add note about npx caching and link to #6119 ([@TaylorBriggs](https://github.com/TaylorBriggs)) - - [#6386](https://github.com/facebook/create-react-app/pull/6386) Revert removal of newlines from html in docs ([@JBallin](https://github.com/JBallin)) + - [#9728](https://github.com/facebook/create-react-app/pull/9728) Upgrade Docusaurus to latest version ([@lex111](https://github.com/lex111)) + - [#9630](https://github.com/facebook/create-react-app/pull/9630) Emphasise that Next.js is capable of SSG ([@liamness](https://github.com/liamness)) + - [#9073](https://github.com/facebook/create-react-app/pull/9073) Update running-tests.md ([@MichaelDeBoey](https://github.com/MichaelDeBoey)) + - [#9560](https://github.com/facebook/create-react-app/pull/9560) Update Vercel deployment documentation ([@timothyis](https://github.com/timothyis)) + - [#9380](https://github.com/facebook/create-react-app/pull/9380) Update running-tests.md ([@andycanderson](https://github.com/andycanderson)) + - [#9245](https://github.com/facebook/create-react-app/pull/9245) [Doc] fix React Testing Library example ([@sakito21](https://github.com/sakito21)) + - [#9231](https://github.com/facebook/create-react-app/pull/9231) Clarify wording in adding TypeScript to existing project ([@merelinguist](https://github.com/merelinguist)) + - [#8895](https://github.com/facebook/create-react-app/pull/8895) Fix chai URL ([@BMorearty](https://github.com/BMorearty)) + - [#9042](https://github.com/facebook/create-react-app/pull/9042) Update deployment docs for Azure Static Web Apps ([@burkeholland](https://github.com/burkeholland)) + - [#8246](https://github.com/facebook/create-react-app/pull/8246) Add a VSCode tip in the CSS reset section ([@maazadeeb](https://github.com/maazadeeb)) + - [#8610](https://github.com/facebook/create-react-app/pull/8610) Update url to see prettier in action ([@M165437](https://github.com/M165437)) + - [#8684](https://github.com/facebook/create-react-app/pull/8684) Simplify wording in setting-up-your-editor.md ([@coryhouse](https://github.com/coryhouse)) + - [#8791](https://github.com/facebook/create-react-app/pull/8791) Add setupTests.js to the list of generated files ([@MostafaNawara](https://github.com/MostafaNawara)) + - [#8763](https://github.com/facebook/create-react-app/pull/8763) Use simplified import of @testing-library/jest-dom ([@Dremora](https://github.com/Dremora)) +- `react-dev-utils` + - [#9471](https://github.com/facebook/create-react-app/pull/9471) Fixes in the /packages/react-devs-utils/README.md file ([@caspero-62](https://github.com/caspero-62)) + - [#8651](https://github.com/facebook/create-react-app/pull/8651) Update build script deployment URL ([@StenAL](https://github.com/StenAL)) +- `cra-template-typescript`, `cra-template` + - [#9241](https://github.com/facebook/create-react-app/pull/9241) Updated README.md Templates to Follow ESLint Markdown Rules ([@firehawk09](https://github.com/firehawk09)) + - [#8406](https://github.com/facebook/create-react-app/pull/8406) Upgrade testing-library packages ([@gnapse](https://github.com/gnapse)) - `react-scripts` - - [#6848](https://github.com/facebook/create-react-app/pull/6848) Remove no-watch flag in favor of watchAll=false ([@bugzpodder](https://github.com/bugzpodder)) - - [#6775](https://github.com/facebook/create-react-app/pull/6775) Fix code comment typo ([@bestseob93](https://github.com/bestseob93)) + - [#9244](https://github.com/facebook/create-react-app/pull/9244) Explain how to uninstall create-react-app globally ([@nickmccurdy](https://github.com/nickmccurdy)) + - [#8838](https://github.com/facebook/create-react-app/pull/8838) Support devDependencies in templates ([@mrmckeb](https://github.com/mrmckeb)) +- `cra-template-typescript`, `cra-template`, `react-dev-utils`, `react-scripts` + - [#8957](https://github.com/facebook/create-react-app/pull/8957) Move shortlinks to cra.link ([@iansu](https://github.com/iansu)) +- `babel-preset-react-app` + - [#5847](https://github.com/facebook/create-react-app/pull/5847) Include absoluteRuntime in babel preset docs ([@iddan](https://github.com/iddan)) #### :house: Internal +- `eslint-config-react-app` + - [#9670](https://github.com/facebook/create-react-app/pull/9670) fix(eslint-config-react-app): Make eslint-plugin-jest an optional peerDependency ([@MichaelDeBoey](https://github.com/MichaelDeBoey)) - Other - - [#6829](https://github.com/facebook/create-react-app/pull/6829) Upgrade to Lerna v3 ([@iansu](https://github.com/iansu)) - - [#6762](https://github.com/facebook/create-react-app/pull/6762) Add temporary workaround for Babel dependency issues in kitchensink-eject test suite ([@iansu](https://github.com/iansu)) - - [#6757](https://github.com/facebook/create-react-app/pull/6757) Add temporary workaround for Babel dependency issues in installs test suite ([@iansu](https://github.com/iansu)) - - [#6700](https://github.com/facebook/create-react-app/pull/6700) Kill verdaccio in CI tasks cleanup ([@santoshyadav198613](https://github.com/santoshyadav198613)) - - [#6690](https://github.com/facebook/create-react-app/pull/6690) Remove duplicate url key in siteConfig ([@charpeni](https://github.com/charpeni)) -- `react-scripts` - - [#6313](https://github.com/facebook/create-react-app/pull/6313) Update testMatch to also be compatible with Jest 24 ([@ngbrown](https://github.com/ngbrown)) - - [#4176](https://github.com/facebook/create-react-app/pull/4176) Remove --coverage + --watch workaround for the test command ([@stipsan](https://github.com/stipsan)) - - [#6655](https://github.com/facebook/create-react-app/pull/6655) Change app component declaration from arrow function to regular function ([@iansu](https://github.com/iansu)) - - [#6625](https://github.com/facebook/create-react-app/pull/6625) change named import into default import ([@xiaoxiangmoe](https://github.com/xiaoxiangmoe)) - - [#6621](https://github.com/facebook/create-react-app/pull/6621) make compiler a const not a let ([@Primajin](https://github.com/Primajin)) -- `babel-plugin-named-asset-import`, `confusing-browser-globals`, `react-dev-utils`, `react-error-overlay`, `react-scripts` - - [#6654](https://github.com/facebook/create-react-app/pull/6654) Cleanup Jest config ([@ianschmitz](https://github.com/ianschmitz)) + - [#9258](https://github.com/facebook/create-react-app/pull/9258) fix: Fix azure-pipelines' endOfLine ([@MichaelDeBoey](https://github.com/MichaelDeBoey)) + - [#9102](https://github.com/facebook/create-react-app/pull/9102) Replace Spectrum links with GitHub Discussions ([@iansu](https://github.com/iansu)) + - [#8656](https://github.com/facebook/create-react-app/pull/8656) Bump acorn from 6.4.0 to 6.4.1 in /docusaurus/website ([@dependabot[bot]](https://github.com/apps/dependabot)) + - [#8749](https://github.com/facebook/create-react-app/pull/8749) Specify what files are served form a bare local copy ([@challet](https://github.com/challet)) +- `cra-template-typescript`, `cra-template` + - [#9252](https://github.com/facebook/create-react-app/pull/9252) feat: Update testing-library dependencies to latest ([@MichaelDeBoey](https://github.com/MichaelDeBoey)) - `react-dev-utils` - - [#6674](https://github.com/facebook/create-react-app/pull/6674) Remove unused eslint comment ([@mohitsinghs](https://github.com/mohitsinghs)) -- `eslint-config-react-app` - - [#6662](https://github.com/facebook/create-react-app/pull/6662) Sync version of babel-eslint in eslint-config-react-app for react-scripts V3 ([@dalcib](https://github.com/dalcib)) + - [#9059](https://github.com/facebook/create-react-app/pull/9059) clean formatMessage usage ([@chenxsan](https://github.com/chenxsan)) +- `cra-template` + - [#7787](https://github.com/facebook/create-react-app/pull/7787) Bump version of Verdaccio ([@ianschmitz](https://github.com/ianschmitz)) +- `babel-preset-react-app` + - [#8858](https://github.com/facebook/create-react-app/pull/8858) Remove outdated comment ([@availchet](https://github.com/availchet)) +- `react-scripts` + - [#8952](https://github.com/facebook/create-react-app/pull/8952) fix react-refresh babel plugin not applied ([@tanhauhau](https://github.com/tanhauhau)) #### :hammer: Underlying Tools - `react-scripts` - - [#6843](https://github.com/facebook/create-react-app/pull/6843) Update fsevents dependency version ([@FrancoisRmn](https://github.com/FrancoisRmn)) - - [#6725](https://github.com/facebook/create-react-app/pull/6725) Update to workbox-webpack-plugin v4 ([@r0ughnex](https://github.com/r0ughnex)) - - [#6361](https://github.com/facebook/create-react-app/pull/6361) Updating html-webpack-plugin dep ([@Aftabnack](https://github.com/Aftabnack)) - - [#6483](https://github.com/facebook/create-react-app/pull/6483) Update webpack-dev-server to 3.2.1 ([@ThePrez](https://github.com/ThePrez)) -- `babel-plugin-named-asset-import`, `babel-preset-react-app`, `confusing-browser-globals`, `create-react-app`, `eslint-config-react-app`, `react-app-polyfill`, `react-dev-utils`, `react-error-overlay`, `react-scripts` - - [#6840](https://github.com/facebook/create-react-app/pull/6840) Relax ESLint version range ([@ianschmitz](https://github.com/ianschmitz)) -- `babel-preset-react-app` - - [#6780](https://github.com/facebook/create-react-app/pull/6780) Remove unused babel-loader from babel-preset-react-app ([@tlrobinson](https://github.com/tlrobinson)) -- `babel-preset-react-app`, `react-dev-utils`, `react-error-overlay`, `react-scripts` - - [#6767](https://github.com/facebook/create-react-app/pull/6767) Update dependency versions ([@ianschmitz](https://github.com/ianschmitz)) + - [#9865](https://github.com/facebook/create-react-app/pull/9865) Pass JSX runtime setting to Babel preset in Jest config ([@iansu](https://github.com/iansu)) + - [#9841](https://github.com/facebook/create-react-app/pull/9841) Bump resolve-url-loader version ([@johannespfeiffer](https://github.com/johannespfeiffer)) + - [#9348](https://github.com/facebook/create-react-app/pull/9348) Upgrade refresh plugin ([@ianschmitz](https://github.com/ianschmitz)) + - [#8891](https://github.com/facebook/create-react-app/pull/8891) Bump style-loader to 1.2.1 ([@chybisov](https://github.com/chybisov)) +- `react-error-overlay`, `react-scripts` + - [#9863](https://github.com/facebook/create-react-app/pull/9863) Upgrade to React 17 ([@iansu](https://github.com/iansu)) + - [#9856](https://github.com/facebook/create-react-app/pull/9856) feat: Update ESLint dependencies ([@MichaelDeBoey](https://github.com/MichaelDeBoey)) +- `babel-plugin-named-asset-import`, `babel-preset-react-app`, `confusing-browser-globals`, `cra-template-typescript`, `cra-template`, `create-react-app`, `eslint-config-react-app`, `react-app-polyfill`, `react-error-overlay`, `react-scripts` + - [#9857](https://github.com/facebook/create-react-app/pull/9857) feat: Update all dependencies ([@MichaelDeBoey](https://github.com/MichaelDeBoey)) +- `eslint-config-react-app`, `react-dev-utils`, `react-scripts` + - [#9751](https://github.com/facebook/create-react-app/pull/9751) Replace deprecated eslint-loader by eslint-webpack-plugin ([@tooppaaa](https://github.com/tooppaaa)) +- `babel-plugin-named-asset-import`, `babel-preset-react-app`, `confusing-browser-globals`, `cra-template-typescript`, `cra-template`, `create-react-app`, `eslint-config-react-app`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#9639](https://github.com/facebook/create-react-app/pull/9639) Upgrade dependencies ([@ianschmitz](https://github.com/ianschmitz)) +- `eslint-config-react-app`, `react-error-overlay`, `react-scripts` + - [#9434](https://github.com/facebook/create-react-app/pull/9434) feat: Update ESLint dependencies ([@MichaelDeBoey](https://github.com/MichaelDeBoey)) + - [#9251](https://github.com/facebook/create-react-app/pull/9251) feat: Update ESLint dependencies ([@MichaelDeBoey](https://github.com/MichaelDeBoey)) + - [#8978](https://github.com/facebook/create-react-app/pull/8978) Support ESLint 7.x ([@MichaelDeBoey](https://github.com/MichaelDeBoey)) +- `cra-template-typescript`, `cra-template` + - [#9526](https://github.com/facebook/create-react-app/pull/9526) Update template dependencies to latest version ([@MichaelDeBoey](https://github.com/MichaelDeBoey)) + - [#8406](https://github.com/facebook/create-react-app/pull/8406) Upgrade testing-library packages ([@gnapse](https://github.com/gnapse)) +- `react-app-polyfill` + - [#9392](https://github.com/facebook/create-react-app/pull/9392) Upgrade whatwg-fetch ([@Lapz](https://github.com/Lapz)) - `react-dev-utils` - - [#6739](https://github.com/facebook/create-react-app/pull/6739) Update fork-ts-checker-webpack-plugin out of alpha ([@pelotom](https://github.com/pelotom)) -- `eslint-config-react-app` - - [#6701](https://github.com/facebook/create-react-app/pull/6701) Remove project property from @typescript-eslint/parser options ([@jackwilsdon](https://github.com/jackwilsdon)) + - [#8933](https://github.com/facebook/create-react-app/pull/8933) Bump immer version ([@staff0rd](https://github.com/staff0rd)) +- `babel-plugin-named-asset-import`, `babel-preset-react-app`, `confusing-browser-globals`, `create-react-app`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#9317](https://github.com/facebook/create-react-app/pull/9317) Upgrade dependencies ([@ianschmitz](https://github.com/ianschmitz)) +- `babel-preset-react-app`, `cra-template-typescript`, `cra-template`, `create-react-app`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#9196](https://github.com/facebook/create-react-app/pull/9196) Upgrade dependencies ([@ianschmitz](https://github.com/ianschmitz)) + - [#9132](https://github.com/facebook/create-react-app/pull/9132) Upgrade dependencies ([@ianschmitz](https://github.com/ianschmitz)) +- `babel-plugin-named-asset-import`, `confusing-browser-globals`, `create-react-app`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#8955](https://github.com/facebook/create-react-app/pull/8955) Upgrade to Jest 26 ([@ianschmitz](https://github.com/ianschmitz)) +- `babel-preset-react-app`, `create-react-app`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#9081](https://github.com/facebook/create-react-app/pull/9081) Update packages ([@ianschmitz](https://github.com/ianschmitz)) + - [#8947](https://github.com/facebook/create-react-app/pull/8947) Minor/patch dependency upgrades ([@ianschmitz](https://github.com/ianschmitz)) +- `babel-plugin-named-asset-import`, `babel-preset-react-app`, `create-react-app`, `react-app-polyfill`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#8950](https://github.com/facebook/create-react-app/pull/8950) Dependency major version upgrades ([@ianschmitz](https://github.com/ianschmitz)) - `eslint-config-react-app`, `react-scripts` - - [#6653](https://github.com/facebook/create-react-app/pull/6653) Unpin eslint-config-react-hooks dependency ([@iansu](https://github.com/iansu)) -- `babel-preset-react-app`, `eslint-config-react-app`, `react-scripts` - - [#5997](https://github.com/facebook/create-react-app/pull/5997) Support React Hooks (#5602) ([@eivind88](https://github.com/eivind88)) -- `babel-preset-react-app`, `create-react-app`, `react-app-polyfill`, `react-dev-utils`, `react-error-overlay`, `react-scripts` - - [#6614](https://github.com/facebook/create-react-app/pull/6614) Upgrade dependencies ([@ianschmitz](https://github.com/ianschmitz)) - -#### Committers: 49 - -- Abdelrahman Rifai ([@abdelrahmanrifai](https://github.com/abdelrahmanrifai)) -- Aftab Khan ([@Aftabnack](https://github.com/Aftabnack)) -- Alessandro (Ale) Segala ([@ItalyPaleAle](https://github.com/ItalyPaleAle)) -- Alex Guerra ([@heyimalex](https://github.com/heyimalex)) -- Andrew Luca ([@iamandrewluca](https://github.com/iamandrewluca)) -- Anurag Goel ([@anurag](https://github.com/anurag)) -- Cody Olsen ([@stipsan](https://github.com/stipsan)) -- Dalci de Jesus Bagolin ([@dalcib](https://github.com/dalcib)) -- Dan ([@panckreous](https://github.com/panckreous)) -- Eivind Arvesen ([@eivind88](https://github.com/eivind88)) -- Endilie Yacop Sucipto ([@endiliey](https://github.com/endiliey)) -- Francisco Joshua ([@fjoshuajr](https://github.com/fjoshuajr)) -- Hrusikesh Panda ([@mrchief](https://github.com/mrchief)) + - [#8939](https://github.com/facebook/create-react-app/pull/8939) Bump React Hooks ESLint plugin to 4.0.0 ([@gaearon](https://github.com/gaearon)) +- `babel-plugin-named-asset-import`, `babel-preset-react-app`, `confusing-browser-globals`, `cra-template-typescript`, `react-dev-utils`, `react-error-overlay`, `react-scripts` + - [#8362](https://github.com/facebook/create-react-app/pull/8362) Upgrade to Jest 25 ([@skovhus](https://github.com/skovhus)) + +#### Committers: 63 + +- Adam Charron ([@charrondev](https://github.com/charrondev)) +- Alex Krolick ([@alexkrolick](https://github.com/alexkrolick)) +- Alexey Pyltsyn ([@lex111](https://github.com/lex111)) +- Andrey Sitnik ([@ai](https://github.com/ai)) +- Andy C ([@andycanderson](https://github.com/andycanderson)) +- Anuraag Agrawal ([@anuraaga](https://github.com/anuraaga)) +- Braedon Gough ([@braedongough](https://github.com/braedongough)) +- Brian Morearty ([@BMorearty](https://github.com/BMorearty)) +- Brody McKee ([@mrmckeb](https://github.com/mrmckeb)) +- Burke Holland ([@burkeholland](https://github.com/burkeholland)) +- Chetanya Kandhari ([@availchet](https://github.com/availchet)) +- Clément DUNGLER ([@tooppaaa](https://github.com/tooppaaa)) +- Clément Hallet ([@challet](https://github.com/challet)) +- Cory House ([@coryhouse](https://github.com/coryhouse)) +- Dan Abramov ([@gaearon](https://github.com/gaearon)) +- Dylan Brookes ([@merelinguist](https://github.com/merelinguist)) +- Ernesto García ([@gnapse](https://github.com/gnapse)) +- Eugene Chybisov ([@chybisov](https://github.com/chybisov)) +- Evan Kennedy ([@evankennedy](https://github.com/evankennedy)) +- Gerrit Alex ([@ljosberinn](https://github.com/ljosberinn)) +- Hieu Do ([@hieuxlu](https://github.com/hieuxlu)) +- Hongbo Miao ([@Hongbo-Miao](https://github.com/Hongbo-Miao)) +- Houssein Djirdeh ([@housseindjirdeh](https://github.com/housseindjirdeh)) +- Huáng Jùnliàng ([@JLHwung](https://github.com/JLHwung)) - Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz)) - Ian Sutherland ([@iansu](https://github.com/iansu)) -- JBallin ([@JBallin](https://github.com/JBallin)) -- Jack Wilsdon ([@jackwilsdon](https://github.com/jackwilsdon)) -- Jack Zhao ([@bugzpodder](https://github.com/bugzpodder)) -- Jannis Hell ([@Primajin](https://github.com/Primajin)) -- John Reilly ([@johnnyreilly](https://github.com/johnnyreilly)) -- Kelvin Jin ([@kjin](https://github.com/kjin)) -- Lorenzo Rapetti ([@loryman](https://github.com/loryman)) -- Luiz Felipe Gonçalves ([@lffg](https://github.com/lffg)) -- Mateusz Burzyński ([@Andarist](https://github.com/Andarist)) -- Mike Beaton ([@MikeBeaton](https://github.com/MikeBeaton)) -- Mike Perry Y Attara ([@mikeattara](https://github.com/mikeattara)) -- Mohit Singh ([@mohitsinghs](https://github.com/mohitsinghs)) -- Nathan Brown ([@ngbrown](https://github.com/ngbrown)) -- Nicolas Charpentier ([@charpeni](https://github.com/charpeni)) -- Nikhil Swaminathan ([@swaminator](https://github.com/swaminator)) -- Parth Narielwala ([@pnarielwala](https://github.com/pnarielwala)) -- Pete Nykänen ([@petetnt](https://github.com/petetnt)) -- Philip Harrison ([@feelepxyz](https://github.com/feelepxyz)) -- Pradeep Sekar ([@r0ughnex](https://github.com/r0ughnex)) -- Raphael.dev ([@bestseob93](https://github.com/bestseob93)) -- Robert van Steen ([@rovansteen](https://github.com/rovansteen)) -- Romain François ([@FrancoisRmn](https://github.com/FrancoisRmn)) -- Salvador Hernandez ([@clickclickonsal](https://github.com/clickclickonsal)) -- Santosh Yadav ([@santoshyadav198613](https://github.com/santoshyadav198613)) -- Stephen Godderidge ([@stephengodderidge](https://github.com/stephengodderidge)) -- Taylor Briggs ([@TaylorBriggs](https://github.com/TaylorBriggs)) -- Tom Crockett ([@pelotom](https://github.com/pelotom)) -- Tom Robinson ([@tlrobinson](https://github.com/tlrobinson)) -- Travis Fischer ([@transitive-bullshit](https://github.com/transitive-bullshit)) -- Wilkins ([@evalexpr](https://github.com/evalexpr)) -- ZHAO Jinxiang ([@xiaoxiangmoe](https://github.com/xiaoxiangmoe)) -- [@ThePrez](https://github.com/ThePrez) -- [@bakuzan](https://github.com/bakuzan) -- [@frederikhors](https://github.com/frederikhors) +- Iddan Aaronsohn ([@iddan](https://github.com/iddan)) +- Jakob Krigovsky ([@sonicdoe](https://github.com/sonicdoe)) +- Jeffrey Posnick ([@jeffposnick](https://github.com/jeffposnick)) +- Jeremy Wadsack ([@jeremywadsack](https://github.com/jeremywadsack)) +- Jeroen Claassens ([@Favna](https://github.com/Favna)) +- Joe Haddad ([@Timer](https://github.com/Timer)) +- Johannes Pfeiffer ([@johannespfeiffer](https://github.com/johannespfeiffer)) +- Josemaria Nriagu ([@josenriagu](https://github.com/josenriagu)) +- Kenneth Skovhus ([@skovhus](https://github.com/skovhus)) +- Kirill Korolyov ([@Dremora](https://github.com/Dremora)) +- Kline Moralee ([@klinem](https://github.com/klinem)) +- Lenard Pratt ([@Lapz](https://github.com/Lapz)) +- Liam Duffy ([@liamness](https://github.com/liamness)) +- Maaz Syed Adeeb ([@maazadeeb](https://github.com/maazadeeb)) +- Marc Hassan ([@mhassan1](https://github.com/mhassan1)) +- Matt Korostoff ([@MKorostoff](https://github.com/MKorostoff)) +- Michael Mok ([@pmmmwh](https://github.com/pmmmwh)) +- Michael Schmidt-Voigt ([@M165437](https://github.com/M165437)) +- Michaël De Boey ([@MichaelDeBoey](https://github.com/MichaelDeBoey)) +- Minh Nguyen ([@NMinhNguyen](https://github.com/NMinhNguyen)) +- Mostafa Nawara ([@MostafaNawara](https://github.com/MostafaNawara)) +- Nick McCurdy ([@nickmccurdy](https://github.com/nickmccurdy)) +- Rafael Quijada ([@firehawk09](https://github.com/firehawk09)) +- Raihan Nismara ([@raihan71](https://github.com/raihan71)) +- Sakito Mukai ([@sakito21](https://github.com/sakito21)) +- Sam Chen ([@chenxsan](https://github.com/chenxsan)) +- Sam Saccone ([@samccone](https://github.com/samccone)) +- Sebastian Markbåge ([@sebmarkbage](https://github.com/sebmarkbage)) +- Shakib Hossain ([@shakib609](https://github.com/shakib609)) +- Simen Bekkhus ([@SimenB](https://github.com/SimenB)) +- Stafford Williams ([@staff0rd](https://github.com/staff0rd)) +- Sten Arthur Laane ([@StenAL](https://github.com/StenAL)) +- Tan Li Hau ([@tanhauhau](https://github.com/tanhauhau)) +- Timothy ([@timothyis](https://github.com/timothyis)) +- Tobias Büschel ([@tobiasbueschel](https://github.com/tobiasbueschel)) +- Webdot_30 ([@caspero-62](https://github.com/caspero-62)) +- [@atlanteh](https://github.com/atlanteh) -## Releases Before 3.x +## Releases Before 4.x -Please refer to [CHANGELOG-2.x.md](./CHANGELOG-2.x.md) for earlier versions. +Please refer to [CHANGELOG-3.x.md](./CHANGELOG-3.x.md) for earlier versions. diff --git a/README.md b/README.md index 55e8b891f20..4343c5ef13d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Create React App [![Build Status](https://dev.azure.com/facebook/create-react-app/_apis/build/status/facebook.create-react-app?branchName=master)](https://dev.azure.com/facebook/create-react-app/_build/latest?definitionId=1&branchName=master) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg)](https://github.com/facebook/create-react-app/blob/master/CONTRIBUTING.md) +Logo + Create React apps with no build configuration. - [Creating an App](#creating-an-app) – How to create a new app. @@ -7,7 +9,7 @@ Create React apps with no build configuration. Create React App works on macOS, Windows, and Linux.
If something doesn’t work, please [file an issue](https://github.com/facebook/create-react-app/issues/new).
-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 @@ -17,7 +19,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))_ @@ -175,9 +177,9 @@ Here are a few common cases where you might want to try something else: - If you need to **publish a React component**, [nwb](https://github.com/insin/nwb) can [also do this](https://github.com/insin/nwb#react-components-and-libraries), as well as [Neutrino's react-components preset](https://neutrino.js.org/packages/react-components/). -- If you want to do **server rendering** with React and Node.js, check out [Next.js](https://github.com/zeit/next.js/) or [Razzle](https://github.com/jaredpalmer/razzle). Create React App is agnostic of the backend, and only produces static HTML/JS/CSS bundles. +- If you want to do **server rendering** with React and Node.js, check out [Next.js](https://nextjs.org/) or [Razzle](https://github.com/jaredpalmer/razzle). Create React App is agnostic of the backend, and only produces static HTML/JS/CSS bundles. -- If your website is **mostly static** (for example, a portfolio or a blog), consider using [Gatsby](https://www.gatsbyjs.org/) instead. Unlike Create React App, it pre-renders the website into HTML at the build time. +- If your website is **mostly static** (for example, a portfolio or a blog), consider using [Gatsby](https://www.gatsbyjs.org/) or [Next.js](https://nextjs.org/). Unlike Create React App, Gatsby pre-renders the website into HTML at build time. Next.js supports both server rendering and pre-rendering. - Finally, if you need **more customization**, check out [Neutrino](https://neutrino.js.org/) and its [React preset](https://neutrino.js.org/packages/react/). @@ -194,6 +196,10 @@ Check out [Expo CLI](https://github.com/expo/expo-cli). We'd love to have your helping hand on `create-react-app`! See [CONTRIBUTING.md](CONTRIBUTING.md) for more information on what we're looking for and how to get started. +## Supporting Create React App + +Create React App is a community maintained project and all contributors are volunteers. If you'd like to support the future development of Create React App then please consider donating to our [Open Collective](https://opencollective.com/create-react-app). + ## Credits This project exists thanks to all the people who [contribute](CONTRIBUTING.md).
@@ -211,4 +217,4 @@ We are grateful to the authors of existing related projects for their ideas and ## License -Create React App is open source software [licensed as MIT](https://github.com/facebook/create-react-app/blob/master/LICENSE). +Create React App is open source software [licensed as MIT](https://github.com/facebook/create-react-app/blob/master/LICENSE). The Create React App logo is licensed under a [Creative Commons Attribution 4.0 International license](https://creativecommons.org/licenses/by/4.0/). diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000000..1c4112b6d4c --- /dev/null +++ b/SECURITY.md @@ -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 diff --git a/azure-pipelines-test-job.yml b/azure-pipelines-test-job.yml index e3b9d92b669..116d2f87e23 100644 --- a/azure-pipelines-test-job.yml +++ b/azure-pipelines-test-job.yml @@ -1,40 +1,38 @@ -# -# Azure Pipelines job for building and testing create-react-app on Linux, Windows, and macOS. -# - -parameters: - name: '' - testScript: '' - configurations: - LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x } - LinuxNode12: { vmImage: 'ubuntu-16.04', nodeVersion: 12.x } - # WindowsNode10: { vmImage: 'windows-latest', nodeVersion: 10.x } - # WindowsNode12: { vmImage: 'windows-latest', nodeVersion: 12.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' - - - checkout: self - path: create-react-app - - - task: NodeTool@0 - inputs: - versionSpec: $(nodeVersion) - displayName: 'Install Node.js' - - - script: yarn --frozen-lockfile - displayName: 'Run yarn' - - - bash: ${{ parameters.testScript }} - displayName: 'Run tests' +# +# Azure Pipelines job for building and testing create-react-app on Linux, Windows, and macOS. +# + +parameters: + name: '' + testScript: '' + configurations: + LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x } + LinuxNode12: { vmImage: 'ubuntu-16.04', nodeVersion: 12.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' + + - checkout: self + path: create-react-app + + - task: NodeTool@0 + inputs: + versionSpec: $(nodeVersion) + displayName: 'Install Node.js' + + - script: yarn --frozen-lockfile + displayName: 'Run yarn' + + - bash: ${{ parameters.testScript }} + displayName: 'Run tests' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6f9f49df877..3c89363208b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,79 +1,77 @@ -# -# Azure Pipelines configuration for building and testing create-react-app on Linux, Windows, and macOS. -# - -trigger: - - master - -variables: - CI: true - # Overrides the Yarn and NPM cache directories so they are on the same drive as the source. This helps improve build performance on Windows hosted agents. - YARN_CACHE_FOLDER: $(Build.SourcesDirectory)/../yarn-cache - 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 - -# ****************************************************************************** -# Simple test suite -# ****************************************************************************** -jobs: - - 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 - - # ****************************************************************************** - # 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 - - # ****************************************************************************** - # Behavior test suite - # ****************************************************************************** - - template: azure-pipelines-test-job.yml - parameters: - name: Behavior - testScript: tasks/e2e-behavior.sh - configurations: - LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x } - LinuxNode12: { vmImage: 'ubuntu-16.04', nodeVersion: 12.x } - # WindowsNode10: { vmImage: 'windows-latest', nodeVersion: 10.x } - # WindowsNode12: { vmImage: 'windows-latest', nodeVersion: 12.x } - MacNode10: { vmImage: 'macOS-latest', nodeVersion: 10.x } - MacNode12: { vmImage: 'macOS-latest', nodeVersion: 12.x } - - # ****************************************************************************** - # Old Node test suite - # ****************************************************************************** - - job: OldNode - pool: - vmImage: ubuntu-latest - steps: - - task: NodeTool@0 - inputs: - versionSpec: 8.x - displayName: 'Install Node.js 8.x' - - bash: tasks/e2e-old-node.sh - displayName: 'Run tests' +# +# Azure Pipelines configuration for building and testing create-react-app on Linux, Windows, and macOS. +# + +trigger: + - master + +variables: + CI: true + # Overrides the Yarn and NPM cache directories so they are on the same drive as the source. This helps improve build performance on Windows hosted agents. + YARN_CACHE_FOLDER: $(Build.SourcesDirectory)/../yarn-cache + 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 + CRA_INTERNAL_TEST: true + +# ****************************************************************************** +# Simple test suite +# ****************************************************************************** +jobs: + - 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 + + # ****************************************************************************** + # 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 + + # ****************************************************************************** + # Behavior test suite + # ****************************************************************************** + - template: azure-pipelines-test-job.yml + parameters: + name: Behavior + testScript: tasks/e2e-behavior.sh + configurations: + 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-latest + steps: + - task: NodeTool@0 + inputs: + versionSpec: 8.x + displayName: 'Install Node.js 8.x' + - bash: tasks/e2e-old-node.sh + displayName: 'Run tests' diff --git a/docusaurus/docs/adding-css-reset.md b/docusaurus/docs/adding-css-reset.md index 4b5b976c8a0..c08567124af 100644 --- a/docusaurus/docs/adding-css-reset.md +++ b/docusaurus/docs/adding-css-reset.md @@ -16,7 +16,7 @@ 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`. +> **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]. diff --git a/docusaurus/docs/adding-custom-environment-variables.md b/docusaurus/docs/adding-custom-environment-variables.md index b604a10c810..48bfea2cf64 100644 --- a/docusaurus/docs/adding-custom-environment-variables.md +++ b/docusaurus/docs/adding-custom-environment-variables.md @@ -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. diff --git a/docusaurus/docs/adding-typescript.md b/docusaurus/docs/adding-typescript.md index 40c9c2242a8..6f4c86c6cc7 100644 --- a/docusaurus/docs/adding-typescript.md +++ b/docusaurus/docs/adding-typescript.md @@ -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 @@ -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. diff --git a/docusaurus/docs/advanced-configuration.md b/docusaurus/docs/advanced-configuration.md index ba926362e69..a3000988b62 100644 --- a/docusaurus/docs/advanced-configuration.md +++ b/docusaurus/docs/advanced-configuration.md @@ -7,25 +7,24 @@ You can adjust various development and production settings by setting environmen > Note: You do not need to declare `REACT_APP_` before the below variables as you would with custom environment variables. -| Variable | Development | Production | Usage | -| :---------------------- | :---------: | :--------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| BROWSER | ✅ Used | 🚫 Ignored | By default, Create React App will open the default system browser, favoring Chrome on macOS. Specify a [browser](https://github.com/sindresorhus/open#app) to override this behavior, or set it to `none` to disable it completely. If you need to customize the way the browser is launched, you can specify a node script instead. Any arguments passed to `npm start` will also be passed to this script, and the url where your app is served will be the last argument. Your script's file name must have the `.js` extension. | -| BROWSER_ARGS | ✅ Used | 🚫 Ignored | When the `BROWSER` environment variable is specified, any arguments that you set to this environment variable will be passed to the browser instance. Multiple arguments are supported as a space separated list. By default, no arguments are passed through to browsers. | -| HOST | ✅ Used | 🚫 Ignored | By default, the development web server binds to all hostnames on the device (`localhost`, LAN network address, etc.). You may use this variable to specify a different host. | -| 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. | -| HTTPS | ✅ Used | 🚫 Ignored | When set to `true`, Create React App will run the development server in `https` mode. | -| 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. | -| 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 `/sockjs-node` 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. | -| 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. | -| 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. | -| 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. | -| CI | ✅ Used | ✅ Used | When set to `true`, Create React App treats warnings as failures in the build. It also makes the test runner non-watching. Most CIs set this flag by default. | -| 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]() 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 `true`, enables 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. | +| Variable | Development | Production | Usage | +| :------------------------ | :---------: | :--------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| BROWSER | ✅ Used | 🚫 Ignored | By default, Create React App will open the default system browser, favoring Chrome on macOS. Specify a [browser](https://github.com/sindresorhus/open#app) to override this behavior, or set it to `none` to disable it completely. If you need to customize the way the browser is launched, you can specify a node script instead. Any arguments passed to `npm start` will also be passed to this script, and the url where your app is served will be the last argument. Your script's file name must have the `.js` extension. | +| BROWSER_ARGS | ✅ Used | 🚫 Ignored | When the `BROWSER` environment variable is specified, any arguments that you set to this environment variable will be passed to the browser instance. Multiple arguments are supported as a space separated list. By default, no arguments are passed through to browsers. | +| HOST | ✅ Used | 🚫 Ignored | By default, the development web server binds to all hostnames on the device (`localhost`, LAN network address, etc.). You may use this variable to specify a different host. | +| 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. | +| HTTPS | ✅ Used | 🚫 Ignored | When set to `true`, Create React App will run the development server in `https` mode. | +| 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. | +| 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 `/sockjs-node` 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. | +| 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. | +| 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. | +| 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. | +| CI | ✅ Used | ✅ Used | When set to `true`, Create React App treats warnings as failures in the build. It also makes the test runner non-watching. Most CIs set this flag by default. | +| 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]() 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. | +| 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. | +| 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. | +| DISABLE_NEW_JSX_TRANSFORM | ✅ Used | ✅ Used | When set to `true`, disables the [new JSX transform](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) introduced in React 17 and backported to React 16.14.0, 15.7.0, and 0.14.10. New projects will use a version of React that supports this by default but you may need to disable it in existing projects if you can't upgrade React. | diff --git a/docusaurus/docs/deployment.md b/docusaurus/docs/deployment.md index dfb2e13d6aa..201ce21cd76 100644 --- a/docusaurus/docs/deployment.md +++ b/docusaurus/docs/deployment.md @@ -1,497 +1,508 @@ ---- -id: deployment -title: Deployment -sidebar_label: Deployment ---- - -`npm run build` creates a `build` directory with a production build of your app. Set up your favorite HTTP server so that a visitor to your site is served `index.html`, and requests to static paths like `/static/js/main..js` are served with the contents of the `/static/js/main..js` file. For more information see the [production build](production-build.md) section. - -## Static Server - -For environments using [Node](https://nodejs.org/), the easiest way to handle this would be to install [serve](https://github.com/zeit/serve) and let it handle the rest: - -```sh -npm install -g serve -serve -s build -``` - -The last command shown above will serve your static site on the port **5000**. Like many of [serve](https://github.com/zeit/serve)’s internal settings, the port can be adjusted using the `-l` or `--listen` flags: - -```sh -serve -s build -l 4000 -``` - -Run this command to get a full list of the options available: - -```sh -serve -h -``` - -## Other Solutions - -You don’t necessarily need a static server in order to run a Create React App project in production. It also works well when integrated into an existing server side app. - -Here’s a programmatic example using [Node](https://nodejs.org/) and [Express](https://expressjs.com/): - -```javascript -const express = require('express'); -const path = require('path'); -const app = express(); - -app.use(express.static(path.join(__dirname, 'build'))); - -app.get('/', function(req, res) { - res.sendFile(path.join(__dirname, 'build', 'index.html')); -}); - -app.listen(9000); -``` - -The choice of your server software isn’t important either. Since Create React App is completely platform-agnostic, there’s no need to explicitly use Node. - -The `build` folder with static assets is the only output produced by Create React App. - -However this is not quite enough if you use client-side routing. Read the next section if you want to support URLs like `/todos/42` in your single-page app. - -## Serving Apps with Client-Side Routing - -If you use routers that use the HTML5 [`pushState` history API](https://developer.mozilla.org/en-US/docs/Web/API/History_API#Adding_and_modifying_history_entries) under the hood (for example, [React Router](https://github.com/ReactTraining/react-router) with `browserHistory`), many static file servers will fail. For example, if you used React Router with a route for `/todos/42`, the development server will respond to `localhost:3000/todos/42` properly, but an Express serving a production build as above will not. - -This is because when there is a fresh page load for a `/todos/42`, the server looks for the file `build/todos/42` and does not find it. The server needs to be configured to respond to a request to `/todos/42` by serving `index.html`. For example, we can amend our Express example above to serve `index.html` for any unknown paths: - -```diff - app.use(express.static(path.join(__dirname, 'build'))); - --app.get('/', function (req, res) { -+app.get('/*', function (req, res) { - res.sendFile(path.join(__dirname, 'build', 'index.html')); - }); -``` - -If you’re using [Apache HTTP Server](https://httpd.apache.org/), you need to create a `.htaccess` file in the `public` folder that looks like this: - -``` - Options -MultiViews - RewriteEngine On - RewriteCond %{REQUEST_FILENAME} !-f - RewriteRule ^ index.html [QSA,L] -``` - -It will get copied to the `build` folder when you run `npm run build`. - -If you’re using [Apache Tomcat](https://tomcat.apache.org/), you need to follow [this Stack Overflow answer](https://stackoverflow.com/a/41249464/4878474). - -Now requests to `/todos/42` will be handled correctly both in development and in production. - -On a production build, and when you've [opted-in](making-a-progressive-web-app.md#why-opt-in), -a [service worker](https://developers.google.com/web/fundamentals/primers/service-workers/) will automatically handle all navigation requests, like for -`/todos/42`, by serving the cached copy of your `index.html`. This -service worker navigation routing can be configured or disabled by -[`eject`ing](available-scripts.md#npm-run-eject) and then modifying the -[`navigateFallback`](https://github.com/GoogleChrome/sw-precache#navigatefallback-string) -and [`navigateFallbackWhitelist`](https://github.com/GoogleChrome/sw-precache#navigatefallbackwhitelist-arrayregexp) -options of the `SWPrecachePlugin` [configuration](../config/webpack.config.prod.js). - -When users install your app to the homescreen of their device the default configuration will make a shortcut to `/index.html`. This may not work for client-side routers which expect the app to be served from `/`. Edit the web app manifest at [`public/manifest.json`](public/manifest.json) and change `start_url` to match the required URL scheme, for example: - -```js - "start_url": ".", -``` - -## Building for Relative Paths - -By default, Create React App produces a build assuming your app is hosted at the server root. - -To override this, specify the `homepage` in your `package.json`, for example: - -```js - "homepage": "http://mywebsite.com/relativepath", -``` - -This will let Create React App correctly infer the root path to use in the generated HTML file. - -**Note**: If you are using `react-router@^4`, you can root ``s using the `basename` prop on any ``. - -More information [here](https://reacttraining.com/react-router/web/api/BrowserRouter/basename-string). - -For example: - -```js - - // renders -``` - -### Serving the Same Build from Different Paths - -> Note: this feature is available with `react-scripts@0.9.0` and higher. - -If you are not using the HTML5 `pushState` history API or not using client-side routing at all, it is unnecessary to specify the URL from which your app will be served. Instead, you can put this in your `package.json`: - -```js - "homepage": ".", -``` - -This will make sure that all the asset paths are relative to `index.html`. You will then be able to move your app from `http://mywebsite.com` to `http://mywebsite.com/relativepath` or even `http://mywebsite.com/relative/path` without having to rebuild it. - -## Customizing Environment Variables for Arbitrary Build Environments - -You can create an arbitrary build environment by creating a custom `.env` file and loading it using [env-cmd](https://www.npmjs.com/package/env-cmd). - -For example, to create a build environment for a staging environment: - -1. Create a file called `.env.staging` -1. Set environment variables as you would any other `.env` file (e.g. `REACT_APP_API_URL=http://api-staging.example.com`) -1. Install [env-cmd](https://www.npmjs.com/package/env-cmd) - ```sh - $ npm install env-cmd --save - $ # or - $ yarn add env-cmd - ``` -1. Add a new script to your `package.json`, building with your new environment: - ```json - { - "scripts": { - "build:staging": "env-cmd -f .env.staging npm run build" - } - } - ``` - -Now you can run `npm run build:staging` to build with the staging environment config. -You can specify other environments in the same way. - -Variables in `.env.production` will be used as fallback because `NODE_ENV` will always be set to `production` for a build. - -## [AWS Amplify](http://console.amplify.aws) - -The AWS Amplify Console provides continuous deployment and hosting for modern web apps (single page apps and static site generators) with serverless backends. The Amplify Console offers globally available CDNs, custom domain setup, feature branch deployments, and password protection. - -1. Login to the Amplify Console [here](https://console.aws.amazon.com/amplify/home). -1. Connect your Create React App repo and pick a branch. If you're looking for a Create React App+Amplify starter, try the [create-react-app-auth-amplify starter](https://github.com/swaminator/create-react-app-auth-amplify) that demonstrates setting up auth in 10 minutes with Create React App. -1. The Amplify Console automatically detects the build settings. Choose Next. -1. Choose _Save and deploy_. - -If the build succeeds, the app is deployed and hosted on a global CDN with an amplifyapp.com domain. You can now continuously deploy changes to your frontend or backend. Continuous deployment allows developers to deploy updates to their frontend and backend on every code commit to their Git repository. - -## [Azure](https://azure.microsoft.com/) - -See [this](https://medium.com/@to_pe/deploying-create-react-app-on-microsoft-azure-c0f6686a4321) blog post on how to deploy your React app to Microsoft Azure. - -See [this](https://medium.com/@strid/host-create-react-app-on-azure-986bc40d5bf2#.pycfnafbg) blog post or [this](https://github.com/ulrikaugustsson/azure-appservice-static) repo for a way to use automatic deployment to Azure App Service. - -## [Firebase](https://firebase.google.com/) - -Install the Firebase CLI if you haven’t already by running `npm install -g firebase-tools`. Sign up for a [Firebase account](https://console.firebase.google.com/) and create a new project. Run `firebase login` and login with your previous created Firebase account. - -Then run the `firebase init` command from your project’s root. You need to choose the **Hosting: Configure and deploy Firebase Hosting sites** and choose the Firebase project you created in the previous step. You will need to agree with `database.rules.json` being created, choose `build` as the public directory, and also agree to **Configure as a single-page app** by replying with `y`. - -```sh - === Project Setup - - First, let's associate this project directory with a Firebase project. - You can create multiple project aliases by running firebase use --add, - but for now we'll set up a default project. - - ? What Firebase project do you want to associate as default? Example app (example-app-fd690) - - === Database Setup - - Firebase Realtime Database Rules allow you to define how your data should be - structured and when your data can be read from and written to. - - ? What file should be used for Database Rules? database.rules.json - ✔ Database Rules for example-app-fd690 have been downloaded to database.rules.json. - Future modifications to database.rules.json will update Database Rules when you run - firebase deploy. - - === Hosting Setup - - Your public directory is the folder (relative to your project directory) that - will contain Hosting assets to uploaded with firebase deploy. If you - have a build process for your assets, use your build's output directory. - - ? What do you want to use as your public directory? build - ? Configure as a single-page app (rewrite all urls to /index.html)? Yes - ✔ Wrote build/index.html - - i Writing configuration info to firebase.json... - i Writing project information to .firebaserc... - - ✔ Firebase initialization complete! -``` - -IMPORTANT: you need to set proper HTTP caching headers for `service-worker.js` file in `firebase.json` file or you will not be able to see changes after first deployment ([issue #2440](https://github.com/facebook/create-react-app/issues/2440)). It should be added inside `"hosting"` key like next: - -```json -{ - "hosting": { - ... - "headers": [ - {"source": "/service-worker.js", "headers": [{"key": "Cache-Control", "value": "no-cache"}]} - ] - ... -``` - -Now, after you create a production build with `npm run build`, you can deploy it by running `firebase deploy`. - -```sh - === Deploying to 'example-app-fd690'... - - i deploying database, hosting - ✔ database: rules ready to deploy. - i hosting: preparing build directory for upload... - Uploading: [============================== ] 75%✔ hosting: build folder uploaded successfully - ✔ hosting: 8 files uploaded successfully - i starting release process (may take several minutes)... - - ✔ Deploy complete! - - Project Console: https://console.firebase.google.com/project/example-app-fd690/overview - Hosting URL: https://example-app-fd690.firebaseapp.com -``` - -For more information see [Firebase Hosting](https://firebase.google.com/docs/hosting). - -## [GitHub Pages](https://pages.github.com/) - -> Note: this feature is available with `react-scripts@0.2.0` and higher. - -### Step 1: Add `homepage` to `package.json` - -**The step below is important!**
- -**If you skip it, your app will not deploy correctly.** - -Open your `package.json` and add a `homepage` field for your project: - -```json - "homepage": "https://myusername.github.io/my-app", -``` - -or for a GitHub user page: - -```json - "homepage": "https://myusername.github.io", -``` - -or for a custom domain page: - -```json - "homepage": "https://mywebsite.com", -``` - -Create React App uses the `homepage` field to determine the root URL in the built HTML file. - -### Step 2: Install `gh-pages` and add `deploy` to `scripts` in `package.json` - -Now, whenever you run `npm run build`, you will see a cheat sheet with instructions on how to deploy to GitHub Pages. - -To publish it at [https://myusername.github.io/my-app](https://myusername.github.io/my-app), run: - -```sh -npm install --save gh-pages -``` - -Alternatively you may use `yarn`: - -```sh -yarn add gh-pages -``` - -Add the following scripts in your `package.json`: - -```diff - "scripts": { -+ "predeploy": "npm run build", -+ "deploy": "gh-pages -d build", - "start": "react-scripts start", - "build": "react-scripts build", -``` - -The `predeploy` script will run automatically before `deploy` is run. - -If you are deploying to a GitHub user page instead of a project page you'll need to make one -additional modification: - -1. Tweak your `package.json` scripts to push deployments to **master**: - -```diff - "scripts": { - "predeploy": "npm run build", -- "deploy": "gh-pages -d build", -+ "deploy": "gh-pages -b master -d build", -``` - -### Step 3: Deploy the site by running `npm run deploy` - -Then run: - -```sh -npm run deploy -``` - -### Step 4: For a project page, ensure your project’s settings use `gh-pages` - -Finally, make sure **GitHub Pages** option in your GitHub project settings is set to use the `gh-pages` branch: - -gh-pages branch setting - -### Step 5: Optionally, configure the domain - -You can configure a custom domain with GitHub Pages by adding a `CNAME` file to the `public/` folder. - -Your CNAME file should look like this: - -``` -mywebsite.com -``` - -### Notes on client-side routing - -GitHub Pages doesn’t support routers that use the HTML5 `pushState` history API under the hood (for example, React Router using `browserHistory`). This is because when there is a fresh page load for a url like `http://user.github.io/todomvc/todos/42`, where `/todos/42` is a frontend route, the GitHub Pages server returns 404 because it knows nothing of `/todos/42`. If you want to add a router to a project hosted on GitHub Pages, here are a couple of solutions: - -- You could switch from using HTML5 history API to routing with hashes. If you use React Router, you can switch to `hashHistory` for this effect, but the URL will be longer and more verbose (for example, `http://user.github.io/todomvc/#/todos/42?_k=yknaj`). [Read more](https://reacttraining.com/react-router/web/api/Router) about different history implementations in React Router. -- Alternatively, you can use a trick to teach GitHub Pages to handle 404s by redirecting to your `index.html` page with a custom redirect parameter. You would need to add a `404.html` file with the redirection code to the `build` folder before deploying your project, and you’ll need to add code handling the redirect parameter to `index.html`. You can find a detailed explanation of this technique [in this guide](https://github.com/rafrex/spa-github-pages). - -### Troubleshooting - -#### "/dev/tty: No such a device or address" - -If, when deploying, you get `/dev/tty: No such a device or address` or a similar error, try the following: - -1. Create a new [Personal Access Token](https://github.com/settings/tokens) -2. `git remote set-url origin https://:@github.com//` . -3. Try `npm run deploy` again - -#### "Cannot read property 'email' of null" - -If, when deploying, you get `Cannot read property 'email' of null`, try the following: - -1. `git config --global user.name ''` -2. `git config --global user.email ''` -3. Try `npm run deploy` again - -## [Heroku](https://www.heroku.com/) - -Use the [Heroku Buildpack for Create React App](https://github.com/mars/create-react-app-buildpack). - -You can find instructions in [Deploying React with Zero Configuration](https://blog.heroku.com/deploying-react-with-zero-configuration). - -### Resolving Heroku Deployment Errors - -Sometimes `npm run build` works locally but fails during deploy via Heroku. Following are the most common cases. - -#### "Module not found: Error: Cannot resolve 'file' or 'directory'" - -If you get something like this: - -``` -remote: Failed to create a production build. Reason: -remote: Module not found: Error: Cannot resolve 'file' or 'directory' -MyDirectory in /tmp/build_1234/src -``` - -It means you need to ensure that the lettercase of the file or directory you `import` matches the one you see on your filesystem or on GitHub. - -This is important because Linux (the operating system used by Heroku) is case sensitive. So `MyDirectory` and `mydirectory` are two distinct directories and thus, even though the project builds locally, the difference in case breaks the `import` statements on Heroku remotes. - -#### "Could not find a required file." - -If you exclude or ignore necessary files from the package you will see a error similar this one: - -``` -remote: Could not find a required file. -remote: Name: `index.html` -remote: Searched in: /tmp/build_a2875fc163b209225122d68916f1d4df/public -remote: -remote: npm ERR! Linux 3.13.0-105-generic -remote: npm ERR! argv "/tmp/build_a2875fc163b209225122d68916f1d4df/.heroku/node/bin/node" "/tmp/build_a2875fc163b209225122d68916f1d4df/.heroku/node/bin/npm" "run" "build" -``` - -In this case, ensure that the file is there with the proper lettercase and that’s not ignored on your local `.gitignore` or `~/.gitignore_global`. - -## [Netlify](https://www.netlify.com/) - -**To do a manual deploy to Netlify’s CDN:** - -```sh -npm install netlify-cli -g -netlify deploy -``` - -Choose `build` as the path to deploy. - -**To setup continuous delivery:** - -With this setup Netlify will build and deploy when you push to git or open a pull request: - -1. [Start a new netlify project](https://app.netlify.com/signup) -2. Pick your Git hosting service and select your repository -3. Click `Build your site` - -**Support for client-side routing:** - -To support `pushState`, make sure to create a `public/_redirects` file with the following rewrite rules: - -``` -/* /index.html 200 -``` - -When you build the project, Create React App will place the `public` folder contents into the build output. - -## [ZEIT Now](https://zeit.co) - -[ZEIT Now](https://zeit.co) is a cloud platform for websites and serverless APIs, that you can use to deploy your Create React App projects to your personal domain (or a free `.now.sh` suffixed URL). - -This guide will show you how to get started in a few quick steps: - -### Step 1: Installing Now CLI - -To install their command-line interface with [npm](https://www.npmjs.com/package/now), run the following command: - -```shell -npm i -g now -``` - -### Step 2: Deploying - -You can deploy your application by running the following command in the root of the project directory: - -```shell -now -``` - -**Alternatively**, you can also use their integration for [GitHub](https://zeit.co/github) or [GitLab](https://zeit.co/gitlab). - -That’s all! - -Your site will now deploy, and you will receive a link similar to the following: https://react.now-examples.now.sh - -Out of the box, you are preconfigured for client-side routing compatibility and appropriate default caching headers. This behaviour can be overwritten [like this](https://zeit.co/docs/v2/advanced/routes/). - -## [Render](https://render.com) - -Render offers free [static site](https://render.com/docs/static-sites) hosting with fully managed SSL, a global CDN and continuous auto deploys from GitHub. - -Deploy your app in only a few minutes by following the [Create React App deployment guide](https://render.com/docs/deploy-create-react-app). - -Use invite code `cra` to sign up or use [this link](https://render.com/i/cra). - -## [S3](https://aws.amazon.com/s3) and [CloudFront](https://aws.amazon.com/cloudfront/) - -See this [blog post](https://medium.com/@omgwtfmarc/deploying-create-react-app-to-s3-or-cloudfront-48dae4ce0af) on how to deploy your React app to Amazon Web Services S3 and CloudFront. If you are looking to add a custom domain, HTTPS and continuous deployment see this [blog post](https://medium.com/dailyjs/a-guide-to-deploying-your-react-app-with-aws-s3-including-https-a-custom-domain-a-cdn-and-58245251f081). - -## [Surge](https://surge.sh/) - -Install the Surge CLI if you haven’t already by running `npm install -g surge`. Run the `surge` command and log in you or create a new account. - -When asked about the project path, make sure to specify the `build` folder, for example: - -```sh - project path: /path/to/project/build -``` - -Note that in order to support routers that use HTML5 `pushState` API, you may want to rename the `index.html` in your build folder to `200.html` before deploying to Surge. This [ensures that every URL falls back to that file](https://surge.sh/help/adding-a-200-page-for-client-side-routing). - -## Publishing Components To npm - -Create React App doesn't provide any built-in functionality to publish a component to npm. If you're ready to extract a component from your project so other people can use it, we recommend moving it to a separate directory outside of your project and then using a tool like [nwb](https://github.com/insin/nwb#react-components-and-libraries) to prepare it for publishing. +--- +id: deployment +title: Deployment +sidebar_label: Deployment +--- + +`npm run build` creates a `build` directory with a production build of your app. Set up your favorite HTTP server so that a visitor to your site is served `index.html`, and requests to static paths like `/static/js/main..js` are served with the contents of the `/static/js/main..js` file. For more information see the [production build](production-build.md) section. + +## Static Server + +For environments using [Node](https://nodejs.org/), the easiest way to handle this would be to install [serve](https://github.com/zeit/serve) and let it handle the rest: + +```sh +npm install -g serve +serve -s build +``` + +The last command shown above will serve your static site on the port **5000**. Like many of [serve](https://github.com/zeit/serve)’s internal settings, the port can be adjusted using the `-l` or `--listen` flags: + +```sh +serve -s build -l 4000 +``` + +Run this command to get a full list of the options available: + +```sh +serve -h +``` + +## Other Solutions + +You don’t necessarily need a static server in order to run a Create React App project in production. It also works well when integrated into an existing server side app. + +Here’s a programmatic example using [Node](https://nodejs.org/) and [Express](https://expressjs.com/): + +```javascript +const express = require('express'); +const path = require('path'); +const app = express(); + +app.use(express.static(path.join(__dirname, 'build'))); + +app.get('/', function (req, res) { + res.sendFile(path.join(__dirname, 'build', 'index.html')); +}); + +app.listen(9000); +``` + +The choice of your server software isn’t important either. Since Create React App is completely platform-agnostic, there’s no need to explicitly use Node. + +The `build` folder with static assets is the only output produced by Create React App. + +However this is not quite enough if you use client-side routing. Read the next section if you want to support URLs like `/todos/42` in your single-page app. + +## Serving Apps with Client-Side Routing + +If you use routers that use the HTML5 [`pushState` history API](https://developer.mozilla.org/en-US/docs/Web/API/History_API#Adding_and_modifying_history_entries) under the hood (for example, [React Router](https://github.com/ReactTraining/react-router) with `browserHistory`), many static file servers will fail. For example, if you used React Router with a route for `/todos/42`, the development server will respond to `localhost:3000/todos/42` properly, but an Express serving a production build as above will not. + +This is because when there is a fresh page load for a `/todos/42`, the server looks for the file `build/todos/42` and does not find it. The server needs to be configured to respond to a request to `/todos/42` by serving `index.html`. For example, we can amend our Express example above to serve `index.html` for any unknown paths: + +```diff + app.use(express.static(path.join(__dirname, 'build'))); + +-app.get('/', function (req, res) { ++app.get('/*', function (req, res) { + res.sendFile(path.join(__dirname, 'build', 'index.html')); + }); +``` + +If you’re using [Apache HTTP Server](https://httpd.apache.org/), you need to create a `.htaccess` file in the `public` folder that looks like this: + +``` + Options -MultiViews + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ index.html [QSA,L] +``` + +It will get copied to the `build` folder when you run `npm run build`. + +If you’re using [Apache Tomcat](https://tomcat.apache.org/), you need to follow [this Stack Overflow answer](https://stackoverflow.com/a/41249464/4878474). + +Now requests to `/todos/42` will be handled correctly both in development and in production. + +On a production build, and when you've [opted-in](making-a-progressive-web-app.md#why-opt-in), +a [service worker](https://developers.google.com/web/fundamentals/primers/service-workers/) will automatically handle all navigation requests, like for +`/todos/42`, by serving the cached copy of your `index.html`. This +service worker navigation routing can be configured or disabled by +[`eject`ing](available-scripts.md#npm-run-eject) and then modifying the +[`navigateFallback`](https://github.com/GoogleChrome/sw-precache#navigatefallback-string) +and [`navigateFallbackWhitelist`](https://github.com/GoogleChrome/sw-precache#navigatefallbackwhitelist-arrayregexp) +options of the `SWPrecachePlugin` configuration. + +When users install your app to the homescreen of their device the default configuration will make a shortcut to `/index.html`. This may not work for client-side routers which expect the app to be served from `/`. Edit the web app manifest at `public/manifest.json` and change `start_url` to match the required URL scheme, for example: + +```js + "start_url": ".", +``` + +## Building for Relative Paths + +By default, Create React App produces a build assuming your app is hosted at the server root. + +To override this, specify the `homepage` in your `package.json`, for example: + +```js + "homepage": "http://mywebsite.com/relativepath", +``` + +This will let Create React App correctly infer the root path to use in the generated HTML file. + +**Note**: If you are using `react-router@^4`, you can root ``s using the `basename` prop on any ``. + +More information [here](https://reacttraining.com/react-router/web/api/BrowserRouter/basename-string). + +For example: + +```js + + // renders
+``` + +### Serving the Same Build from Different Paths + +> Note: this feature is available with `react-scripts@0.9.0` and higher. + +If you are not using the HTML5 `pushState` history API or not using client-side routing at all, it is unnecessary to specify the URL from which your app will be served. Instead, you can put this in your `package.json`: + +```js + "homepage": ".", +``` + +This will make sure that all the asset paths are relative to `index.html`. You will then be able to move your app from `http://mywebsite.com` to `http://mywebsite.com/relativepath` or even `http://mywebsite.com/relative/path` without having to rebuild it. + +## Customizing Environment Variables for Arbitrary Build Environments + +You can create an arbitrary build environment by creating a custom `.env` file and loading it using [env-cmd](https://www.npmjs.com/package/env-cmd). + +For example, to create a build environment for a staging environment: + +1. Create a file called `.env.staging` +1. Set environment variables as you would any other `.env` file (e.g. `REACT_APP_API_URL=http://api-staging.example.com`) +1. Install [env-cmd](https://www.npmjs.com/package/env-cmd) + ```sh + $ npm install env-cmd --save + $ # or + $ yarn add env-cmd + ``` +1. Add a new script to your `package.json`, building with your new environment: + ```json + { + "scripts": { + "build:staging": "env-cmd -f .env.staging npm run build" + } + } + ``` + +Now you can run `npm run build:staging` to build with the staging environment config. +You can specify other environments in the same way. + +Variables in `.env.production` will be used as fallback because `NODE_ENV` will always be set to `production` for a build. + +## [AWS Amplify](http://console.amplify.aws) + +The AWS Amplify Console provides continuous deployment and hosting for modern web apps (single page apps and static site generators) with serverless backends. The Amplify Console offers globally available CDNs, custom domain setup, feature branch deployments, and password protection. + +1. Login to the Amplify Console [here](https://console.aws.amazon.com/amplify/home). +1. Connect your Create React App repo and pick a branch. If you're looking for a Create React App+Amplify starter, try the [create-react-app-auth-amplify starter](https://github.com/swaminator/create-react-app-auth-amplify) that demonstrates setting up auth in 10 minutes with Create React App. +1. The Amplify Console automatically detects the build settings. Choose Next. +1. Choose _Save and deploy_. + +If the build succeeds, the app is deployed and hosted on a global CDN with an amplifyapp.com domain. You can now continuously deploy changes to your frontend or backend. Continuous deployment allows developers to deploy updates to their frontend and backend on every code commit to their Git repository. + +## [Azure](https://azure.microsoft.com/) + +Azure Static Web Apps creates an automated build and deploy pipeline for your React app powered by GitHub Actions. Applications are geo-distributed by default with multiple points of presence. PR's are built automatically for staging environment previews. + +1. Create a new Static Web App [here](https://ms.portal.azure.com/#create/Microsoft.StaticApp). +1. Add in the details and connect to your GitHub repo. +1. Make sure the build folder is set correctly on the "build" tab and create the resource. + +Azure Static Web Apps will automatically configure a GitHub Action in your repo and begin the deployment. + +See the [Azure Static Web Apps documentation](https://aka.ms/swadocs) for more information on routing, APIs, authentication and authorization, custom domains and more. + +## [Firebase](https://firebase.google.com/) + +Install the Firebase CLI if you haven’t already by running `npm install -g firebase-tools`. Sign up for a [Firebase account](https://console.firebase.google.com/) and create a new project. Run `firebase login` and login with your previous created Firebase account. + +Then run the `firebase init` command from your project’s root. You need to choose the **Hosting: Configure and deploy Firebase Hosting sites** and choose the Firebase project you created in the previous step. You will need to agree with `database.rules.json` being created, choose `build` as the public directory, and also agree to **Configure as a single-page app** by replying with `y`. + +```sh + === Project Setup + + First, let's associate this project directory with a Firebase project. + You can create multiple project aliases by running firebase use --add, + but for now we'll set up a default project. + + ? What Firebase project do you want to associate as default? Example app (example-app-fd690) + + === Database Setup + + Firebase Realtime Database Rules allow you to define how your data should be + structured and when your data can be read from and written to. + + ? What file should be used for Database Rules? database.rules.json + ✔ Database Rules for example-app-fd690 have been downloaded to database.rules.json. + Future modifications to database.rules.json will update Database Rules when you run + firebase deploy. + + === Hosting Setup + + Your public directory is the folder (relative to your project directory) that + will contain Hosting assets to uploaded with firebase deploy. If you + have a build process for your assets, use your build's output directory. + + ? What do you want to use as your public directory? build + ? Configure as a single-page app (rewrite all urls to /index.html)? Yes + ✔ Wrote build/index.html + + i Writing configuration info to firebase.json... + i Writing project information to .firebaserc... + + ✔ Firebase initialization complete! +``` + +IMPORTANT: you need to set proper HTTP caching headers for `service-worker.js` file in `firebase.json` file or you will not be able to see changes after first deployment ([issue #2440](https://github.com/facebook/create-react-app/issues/2440)). It should be added inside `"hosting"` key like next: + +```json +{ + "hosting": { + ... + "headers": [ + {"source": "/service-worker.js", "headers": [{"key": "Cache-Control", "value": "no-cache"}]} + ] + ... +``` + +Now, after you create a production build with `npm run build`, you can deploy it by running `firebase deploy`. + +```sh + === Deploying to 'example-app-fd690'... + + i deploying database, hosting + ✔ database: rules ready to deploy. + i hosting: preparing build directory for upload... + Uploading: [============================== ] 75%✔ hosting: build folder uploaded successfully + ✔ hosting: 8 files uploaded successfully + i starting release process (may take several minutes)... + + ✔ Deploy complete! + + Project Console: https://console.firebase.google.com/project/example-app-fd690/overview + Hosting URL: https://example-app-fd690.firebaseapp.com +``` + +For more information see [Firebase Hosting](https://firebase.google.com/docs/hosting). + +## [GitHub Pages](https://pages.github.com/) + +> Note: this feature is available with `react-scripts@0.2.0` and higher. + +### Step 1: Add `homepage` to `package.json` + +**The step below is important!**
+ +**If you skip it, your app will not deploy correctly.** + +Open your `package.json` and add a `homepage` field for your project: + +```json + "homepage": "https://myusername.github.io/my-app", +``` + +or for a GitHub user page: + +```json + "homepage": "https://myusername.github.io", +``` + +or for a custom domain page: + +```json + "homepage": "https://mywebsite.com", +``` + +Create React App uses the `homepage` field to determine the root URL in the built HTML file. + +### Step 2: Install `gh-pages` and add `deploy` to `scripts` in `package.json` + +Now, whenever you run `npm run build`, you will see a cheat sheet with instructions on how to deploy to GitHub Pages. + +To publish it at [https://myusername.github.io/my-app](https://myusername.github.io/my-app), run: + +```sh +npm install --save gh-pages +``` + +Alternatively you may use `yarn`: + +```sh +yarn add gh-pages +``` + +Add the following scripts in your `package.json`: + +```diff + "scripts": { ++ "predeploy": "npm run build", ++ "deploy": "gh-pages -d build", + "start": "react-scripts start", + "build": "react-scripts build", +``` + +The `predeploy` script will run automatically before `deploy` is run. + +If you are deploying to a GitHub user page instead of a project page you'll need to make one +additional modification: + +1. Tweak your `package.json` scripts to push deployments to **master**: + +```diff + "scripts": { + "predeploy": "npm run build", +- "deploy": "gh-pages -d build", ++ "deploy": "gh-pages -b master -d build", +``` + +### Step 3: Deploy the site by running `npm run deploy` + +Then run: + +```sh +npm run deploy +``` + +### Step 4: For a project page, ensure your project’s settings use `gh-pages` + +Finally, make sure **GitHub Pages** option in your GitHub project settings is set to use the `gh-pages` branch: + +gh-pages branch setting + +### Step 5: Optionally, configure the domain + +You can configure a custom domain with GitHub Pages by adding a `CNAME` file to the `public/` folder. + +Your CNAME file should look like this: + +``` +mywebsite.com +``` + +### Notes on client-side routing + +GitHub Pages doesn’t support routers that use the HTML5 `pushState` history API under the hood (for example, React Router using `browserHistory`). This is because when there is a fresh page load for a url like `http://user.github.io/todomvc/todos/42`, where `/todos/42` is a frontend route, the GitHub Pages server returns 404 because it knows nothing of `/todos/42`. If you want to add a router to a project hosted on GitHub Pages, here are a couple of solutions: + +- You could switch from using HTML5 history API to routing with hashes. If you use React Router, you can switch to `hashHistory` for this effect, but the URL will be longer and more verbose (for example, `http://user.github.io/todomvc/#/todos/42?_k=yknaj`). [Read more](https://reacttraining.com/react-router/web/api/Router) about different history implementations in React Router. +- Alternatively, you can use a trick to teach GitHub Pages to handle 404s by redirecting to your `index.html` page with a custom redirect parameter. You would need to add a `404.html` file with the redirection code to the `build` folder before deploying your project, and you’ll need to add code handling the redirect parameter to `index.html`. You can find a detailed explanation of this technique [in this guide](https://github.com/rafrex/spa-github-pages). + +### Troubleshooting + +#### "/dev/tty: No such a device or address" + +If, when deploying, you get `/dev/tty: No such a device or address` or a similar error, try the following: + +1. Create a new [Personal Access Token](https://github.com/settings/tokens) +2. `git remote set-url origin https://:@github.com//` . +3. Try `npm run deploy` again + +#### "Cannot read property 'email' of null" + +If, when deploying, you get `Cannot read property 'email' of null`, try the following: + +1. `git config --global user.name ''` +2. `git config --global user.email ''` +3. Try `npm run deploy` again + +## [Heroku](https://www.heroku.com/) + +Use the [Heroku Buildpack for Create React App](https://github.com/mars/create-react-app-buildpack). + +You can find instructions in [Deploying React with Zero Configuration](https://blog.heroku.com/deploying-react-with-zero-configuration). + +### Resolving Heroku Deployment Errors + +Sometimes `npm run build` works locally but fails during deploy via Heroku. Following are the most common cases. + +#### "Module not found: Error: Cannot resolve 'file' or 'directory'" + +If you get something like this: + +``` +remote: Failed to create a production build. Reason: +remote: Module not found: Error: Cannot resolve 'file' or 'directory' +MyDirectory in /tmp/build_1234/src +``` + +It means you need to ensure that the lettercase of the file or directory you `import` matches the one you see on your filesystem or on GitHub. + +This is important because Linux (the operating system used by Heroku) is case sensitive. So `MyDirectory` and `mydirectory` are two distinct directories and thus, even though the project builds locally, the difference in case breaks the `import` statements on Heroku remotes. + +#### "Could not find a required file." + +If you exclude or ignore necessary files from the package you will see a error similar this one: + +``` +remote: Could not find a required file. +remote: Name: `index.html` +remote: Searched in: /tmp/build_a2875fc163b209225122d68916f1d4df/public +remote: +remote: npm ERR! Linux 3.13.0-105-generic +remote: npm ERR! argv "/tmp/build_a2875fc163b209225122d68916f1d4df/.heroku/node/bin/node" "/tmp/build_a2875fc163b209225122d68916f1d4df/.heroku/node/bin/npm" "run" "build" +``` + +In this case, ensure that the file is there with the proper lettercase and that’s not ignored on your local `.gitignore` or `~/.gitignore_global`. + +## [Netlify](https://www.netlify.com/) + +**To do a manual deploy to Netlify’s CDN:** + +```sh +npm install netlify-cli -g +netlify deploy +``` + +Choose `build` as the path to deploy. + +**To setup continuous delivery:** + +With this setup Netlify will build and deploy when you push to git or open a pull request: + +1. [Start a new netlify project](https://app.netlify.com/signup) +2. Pick your Git hosting service and select your repository +3. Click `Build your site` + +**Support for client-side routing:** + +To support `pushState`, make sure to create a `public/_redirects` file with the following rewrite rules: + +``` +/* /index.html 200 +``` + +When you build the project, Create React App will place the `public` folder contents into the build output. + +## [Vercel](https://vercel.com) + +[Vercel](https://vercel.com/home) is a cloud platform that enables developers to host Jamstack websites and web services that deploy instantly, scale automatically, and requires no supervision, all with zero configuration. They provide a global edge network, SSL encryption, asset compression, cache invalidation, and more. + +### Step 1: Deploying your React project to Vercel + +To deploy your React project with a [Vercel for Git Integration](https://vercel.com/docs/git-integrations), make sure it has been pushed to a Git repository. + +Import the project into Vercel using the [Import Flow](https://vercel.com/import/git). During the import, you will find all relevant [options](https://vercel.com/docs/build-step#build-&-development-settings) preconfigured for you with the ability to change as needed. + +After your project has been imported, all subsequent pushes to branches will generate [Preview Deployments](https://vercel.com/docs/platform/deployments#preview), and all changes made to the [Production Branch](https://vercel.com/docs/git-integrations#production-branch) (commonly "master" or "main") will result in a [Production Deployment](https://vercel.com/docs/platform/deployments#production). + +Once deployed, you will get a URL to see your app live, such as the following: https://create-react-app-example.vercel.app/. + +### Step 2 (optional): Using a Custom Domain + +If you want to use a Custom Domain with your Vercel deployment, you can **Add** or **Transfer in** your domain via your Vercel [account Domain settings.](https://vercel.com/dashboard/domains) + +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. + +Once the domain as been added, you will be presented with different methods for configuring it. + +### Deploying a fresh React project + +You can deploy a fresh React project, with a Git repository set up for you, with the following Deploy Button: + +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/git?s=https%3A%2F%2Fgithub.com%2Fvercel%2Fvercel%2Ftree%2Fmaster%2Fexamples%2Fcreate-react-app) + +### Vercel References: + +- [Example Source](https://github.com/vercel/vercel/tree/master/examples/create-react-app) +- [Official Vercel Guide](https://vercel.com/guides/deploying-react-with-vercel-cra) +- [Vercel Deployment Docs](https://vercel.com/docs) +- [Vercel Custom Domain Docs](https://vercel.com/docs/custom-domains) + +## [Render](https://render.com) + +Render offers free [static site](https://render.com/docs/static-sites) hosting with fully managed SSL, a global CDN and continuous auto deploys from GitHub. + +Deploy your app in only a few minutes by following the [Create React App deployment guide](https://render.com/docs/deploy-create-react-app). + +Use invite code `cra` to sign up or use [this link](https://render.com/i/cra). + +## [S3](https://aws.amazon.com/s3) and [CloudFront](https://aws.amazon.com/cloudfront/) + +See this [blog post](https://medium.com/@omgwtfmarc/deploying-create-react-app-to-s3-or-cloudfront-48dae4ce0af) on how to deploy your React app to Amazon Web Services S3 and CloudFront. If you are looking to add a custom domain, HTTPS and continuous deployment see this [blog post](https://medium.com/dailyjs/a-guide-to-deploying-your-react-app-with-aws-s3-including-https-a-custom-domain-a-cdn-and-58245251f081). + +## [Surge](https://surge.sh/) + +Install the Surge CLI if you haven’t already by running `npm install -g surge`. Run the `surge` command and log in you or create a new account. + +When asked about the project path, make sure to specify the `build` folder, for example: + +```sh + project path: /path/to/project/build +``` + +Note that in order to support routers that use HTML5 `pushState` API, you may want to rename the `index.html` in your build folder to `200.html` before deploying to Surge. This [ensures that every URL falls back to that file](https://surge.sh/help/adding-a-200-page-for-client-side-routing). + +## Publishing Components To npm + +Create React App doesn't provide any built-in functionality to publish a component to npm. If you're ready to extract a component from your project so other people can use it, we recommend moving it to a separate directory outside of your project and then using a tool like [nwb](https://github.com/insin/nwb#react-components-and-libraries) to prepare it for publishing. diff --git a/docusaurus/docs/getting-started.md b/docusaurus/docs/getting-started.md index 9418ca03c07..b95bc100470 100644 --- a/docusaurus/docs/getting-started.md +++ b/docusaurus/docs/getting-started.md @@ -14,7 +14,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))_ @@ -120,7 +120,8 @@ my-app ├── index.css ├── index.js ├── logo.svg - └── serviceWorker.js + ├── serviceWorker.js + └── setupTests.js ``` No configuration or complicated folder structures, only the files you need to build your app. Once the installation is done, you can open your project folder: diff --git a/docusaurus/docs/making-a-progressive-web-app.md b/docusaurus/docs/making-a-progressive-web-app.md index ba9802e6088..649fb9cb320 100644 --- a/docusaurus/docs/making-a-progressive-web-app.md +++ b/docusaurus/docs/making-a-progressive-web-app.md @@ -5,12 +5,42 @@ title: Making a Progressive Web App The production build has all the tools necessary to generate a first-class [Progressive Web App](https://developers.google.com/web/progressive-web-apps/), -but **the offline/cache-first behavior is opt-in only**. By default, -the build process will generate a service worker file, but it will not be -registered, so it will not take control of your production web app. +but **the offline/cache-first behavior is opt-in only**. + +Starting with Create React App 4, you can add a `src/service-worker.js` file to +your project to use the built-in support for +[Workbox](https://developers.google.com/web/tools/workbox/)'s +[`InjectManifest`](https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-webpack-plugin.InjectManifest) +plugin, which will +[compile](https://developers.google.com/web/tools/workbox/guides/using-bundlers) +your service worker and inject into it a list of URLs to +[precache](https://developers.google.com/web/tools/workbox/guides/precache-files). + +If you start a new project using one of the PWA [custom +templates](https://create-react-app.dev/docs/custom-templates/), you'll get a +`src/service-worker.js` file that serves as a good starting point for an +offline-first service worker: + +```sh +npx create-react-app my-app --template cra-template-pwa +``` + +The TypeScript equivalent is: + +```sh +npx create-react-app my-app --template cra-template-pwa-typescript +``` + +If you know that you won't be using service workers, or if you'd prefer to use a +different approach to creating your service worker, don't create a +`src/service-worker.js` file. The `InjectManifest` plugin won't be run in that +case. -In order to opt-in to the offline-first behavior, developers should look for the -following in their [`src/index.js`](https://github.com/facebook/create-react-app/blob/master/packages/cra-template/template/src/index.js) file: +In addition to creating your local `src/service-worker.js` file, it needs to be +registered before it will be used. In order to opt-in to the offline-first +behavior, developers should look for the following in their +[`src/index.js`](https://github.com/facebook/create-react-app/blob/master/packages/cra-template/template/src/index.js) +file: ```js // If you want your app to work offline and load faster, you can change @@ -24,23 +54,59 @@ As the comment states, switching `serviceWorker.unregister()` to ## Why Opt-in? -Offline-first Progressive Web Apps are faster and more reliable than traditional web pages, and provide an engaging mobile experience: +Offline-first Progressive Web Apps are faster and more reliable than traditional +web pages, and provide an engaging mobile experience: + +- All static site assets that are a part of your `webpack` build are cached so + that your page loads fast on subsequent visits, regardless of network + connectivity (such as 2G or 3G). Updates are downloaded in the background. +- Your app will work regardless of network state, even if offline. This means + your users will be able to use your app at 10,000 feet and on the subway. +- On mobile devices, your app can be added directly to the user's home screen, + app icon and all. This eliminates the need for the app store. + +However, they [can make debugging deployments more +challenging](https://github.com/facebook/create-react-app/issues/2398). + +The +[`workbox-webpack-plugin`](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin) +is integrated into production configuration, and it will take care of compiling +a service worker file that will automatically precache all of your +`webpack`-generated assets and keep them up to date as you deploy updates. The +service worker will use a [cache-first +strategy](https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#cache-falling-back-to-network) +for handling all requests for `webpack`-generated assets, including [navigation +requests](https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests) +for your HTML, ensuring that your web app is consistently fast, even on a slow +or unreliable network. -- All static site assets are cached so that your page loads fast on subsequent visits, regardless of network connectivity (such as 2G or 3G). Updates are downloaded in the background. -- Your app will work regardless of network state, even if offline. This means your users will be able to use your app at 10,000 feet and on the subway. -- On mobile devices, your app can be added directly to the user's home screen, app icon and all. This eliminates the need for the app store. +Note: Resources that are not generated by `webpack`, such as static files that are +copied over from your local +[`public/` directory](https://github.com/facebook/create-react-app/blob/master/packages/cra-template/template/public/) +or third-party resources, will not be precached. You can optionally set up Workbox +[routes](https://developers.google.com/web/tools/workbox/guides/route-requests) +to apply the runtime caching strategy of your choice to those resources. + +## Customization + +Starting with Create React App 4, you have full control over customizing the +logic in this service worker, by creating your own `src/service-worker.js` file, +or customizing the one added by the `cra-template-pwa` (or +`cra-template-pwa-typescript`) template. You can use [additional +modules](https://developers.google.com/web/tools/workbox/modules) from the +Workbox project, add in a push notification library, or remove some of the +default caching logic. The one requirement is that you keep `self.__WB_MANIFEST` +somewhere in your file, as the Workbox compilation plugin checks for this value +when generating a manifest of URLs to precache. If you would prefer not to use +precaching, you can assign `self.__WB_MANIFEST` to a variable that will be +ignored, like: -However, they [can make debugging deployments more challenging](https://github.com/facebook/create-react-app/issues/2398) so, starting with Create React App 2, service workers are opt-in. +```js +// eslint-disable-next-line no-restricted-globals +const ignored = self.__WB_MANIFEST; -The [`workbox-webpack-plugin`](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin) -is integrated into production configuration, -and it will take care of generating a service worker file that will automatically -precache all of your local assets and keep them up to date as you deploy updates. -The service worker will use a [cache-first strategy](https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#cache-falling-back-to-network) -for handling all requests for local assets, including -[navigation requests](https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests) -for your HTML, ensuring that your web app is consistently fast, even on a slow -or unreliable network. +// Your custom service worker code goes here. +``` ## Offline-First Considerations @@ -88,7 +154,8 @@ following into account: 1. By default, the generated service worker file will not intercept or cache any cross-origin traffic, like HTTP [API requests](integrating-with-an-api-backend.md), - images, or embeds loaded from a different domain. + images, or embeds loaded from a different domain. Starting with Create + React App 4, this can be customized, as explained above. ## Progressive Web App Metadata diff --git a/docusaurus/docs/measuring-performance.md b/docusaurus/docs/measuring-performance.md new file mode 100644 index 00000000000..a41635cbe40 --- /dev/null +++ b/docusaurus/docs/measuring-performance.md @@ -0,0 +1,65 @@ +--- +id: measuring-performance +title: Measuring Performance +--- + +By default, Create React App includes a performance relayer that allows you to measure and analyze +the performance of your application using different metrics. + +To measure any of the supported metrics, you only need to pass a function into the `reportWebVitals` +function in `index.js`: + +```js +reportWebVitals(console.log); +``` + +This function is fired when the final values for any of the metrics have finished calculating on the +page. You can use it to log any of the results to the console or send to a particular endpoint. + +## Web Vitals + +[Web Vitals](https://web.dev/vitals/) are a set of useful metrics that aim to capture the user +experience of a web page. In Create React App, a third-party library is used to measure these +metrics ([web-vitals](https://github.com/GoogleChrome/web-vitals)). + +To understand more about the object returned to the function when a metric value is calculated, +refer to the [documentation](https://github.com/GoogleChrome/web-vitals/#types). The [Browser +Support](https://github.com/GoogleChrome/web-vitals/#browser-support) section also explains which browsers are supported. + +## Sending results to analytics + +With the `reportWebVitals` function, you can send any of results to an analytics endpoint to measure and track real user performance on your site. For example: + +```js +function sendToAnalytics(metric) { + const body = JSON.stringify(metric); + const url = 'https://example.com/analytics'; + + // Use `navigator.sendBeacon()` if available, falling back to `fetch()` + if (navigator.sendBeacon) { + navigator.sendBeacon(url, body); + } else { + fetch(url, { body, method: 'POST', keepalive: true }); + } +} + +reportWebVitals(sendToAnalytics); +``` + +> **Note:** If you use Google Analytics, use the `id` value to make it easier to construct metric distributions manually (to calculate percentiles, etc…). +> +> ```js +> function sendToAnalytics({ id, name, value }) { +> ga('send', 'event', { +> eventCategory: 'Web Vitals', +> eventAction: name, +> eventValue: Math.round(name === 'CLS' ? value * 1000 : value), // values must be integers +> eventLabel: id, // id unique to current page load +> nonInteraction: true, // avoids affecting bounce rate +> }); +> } +> +> reportWebVitals(sendToAnalytics); +> ``` +> +> Read more about sending results to Google Analytics [here](https://github.com/GoogleChrome/web-vitals#send-the-results-to-google-analytics). diff --git a/docusaurus/docs/running-tests.md b/docusaurus/docs/running-tests.md index a757355e018..ffbb0f70a74 100644 --- a/docusaurus/docs/running-tests.md +++ b/docusaurus/docs/running-tests.md @@ -85,97 +85,9 @@ This test mounts a component and makes sure that it didn’t throw during render When you encounter bugs caused by changing components, you will gain a deeper insight into which parts of them are worth testing in your application. This might be a good time to introduce more specific tests asserting specific expected output or behavior. -### Option 1: Shallow Rendering +### React Testing Library -If you’d like to test components in isolation from the child components they render, we recommend using [`shallow()` rendering API](https://airbnb.io/enzyme/docs/api/shallow.html) from [Enzyme](https://airbnb.io/enzyme/). To install it, run: - -```sh -npm install --save enzyme enzyme-adapter-react-16 react-test-renderer -``` - -Alternatively you may use `yarn`: - -```sh -yarn add enzyme enzyme-adapter-react-16 react-test-renderer -``` - -As of Enzyme 3, you will need to install Enzyme along with an Adapter corresponding to the version of React you are using. (The examples above use the adapter for React 16.) - -The adapter will also need to be configured in your [global setup file](#initializing-test-environment): - -### `src/setupTests.js` - -```js -import { configure } from 'enzyme'; -import Adapter from 'enzyme-adapter-react-16'; - -configure({ adapter: new Adapter() }); -``` - -> Note: Keep in mind that if you decide to "eject" before creating `src/setupTests.js`, the resulting `package.json` file won't contain any reference to it. [Read here](#initializing-test-environment) to learn how to add this after ejecting. - -Now you can write a smoke test with it: - -```js -import React from 'react'; -import { shallow } from 'enzyme'; -import App from './App'; - -it('renders without crashing', () => { - shallow(); -}); -``` - -Unlike the previous smoke test using `ReactDOM.render()`, this test only renders `` and doesn’t go deeper. For example, even if `` itself renders a `