Skip to content

[pull] master from facebook:master #22

New issue

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

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

Already on GitHub? Sign in to your account

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c9a24db
docs: add missing override options for Jest config (#9473)
tobiasbueschel Feb 3, 2021
d229676
Fix CI tests (#10217)
ianschmitz Feb 3, 2021
6a39607
appTsConfig immutability handling by immer (#10027)
josezone Feb 3, 2021
8fa0a26
Add support for new BUILD_PATH advanced configuration variable (#8986)
ajhyndman Feb 3, 2021
b9963ab
Add opt-out for eslint-webpack-plugin (#10170)
mrmckeb Feb 3, 2021
32c06e6
Prepare 4.0.2 release
iansu Feb 3, 2021
9c75260
Publish
iansu Feb 3, 2021
3f5dea9
tests: update test case to match the description (#10384)
jamesgeorge007 Feb 3, 2021
9722ef1
Bump webpack-dev-server 3.11.0 -> 3.11.1 (#10312)
Awarua- Feb 18, 2021
18b5962
Upgrade eslint-webpack-plugin to fix opt-out flag (#10590)
mrmckeb Feb 22, 2021
6947896
update immer to 8.0.1 to address vulnerability (#10412)
wclem4 Feb 22, 2021
f710976
Prepare 4.0.3 release
iansu Feb 22, 2021
cce32fa
Update CHANGELOG
iansu Feb 22, 2021
f92c37a
Publish
iansu Feb 22, 2021
22f46a8
Update IMAGE_INLINE_SIZE_LIMIT docs (#10631)
ianschmitz Mar 2, 2021
f5e415f
Security Fix for Command Injection - huntr.dev (#10644)
Mar 8, 2021
3c02ca7
[email protected]
gaearon Mar 8, 2021
7b56cf7
Update PostCSS packages (#10456)
raix Mar 17, 2021
48d7ffe
Update WebpackManifestPlugin (#10204)
raix Mar 17, 2021
5fc8350
Update ModuleNotFoundPlugin to support Webpack 5 (#10205)
raix Mar 17, 2021
09ac3d4
Bump y18n from 4.0.0 to 4.0.1 in /docusaurus/website (#10765)
dependabot[bot] Mar 31, 2021
2d1829e
Trivial English fixes (#10763)
ujihisa Mar 31, 2021
4d3bbe0
Update PWA docs to point at the cra-template-pwa package (#10805)
slieschke Apr 12, 2021
ea4002e
Fix ICSS syntax in stylesheets (#10511)
thabemmz Apr 12, 2021
007a028
Upgrade docs http links to https (#10288)
xom9ikk Apr 12, 2021
71cbe59
Suggest sass instead of node-sass package (#10779)
andrewywong Apr 12, 2021
fddce8a
Remove outdated comments on react-refresh (#10784)
Apr 12, 2021
651d0db
eslint-config-react-app typo fix (#10317)
Spacerat May 12, 2021
b680ee7
Fix link address (#10907)
May 12, 2021
281a868
Bump immer version for fixing security issue (#10791)
shamprasadrh May 12, 2021
7bdeced
test(create-react-app): add integration tests (#10381)
jamesgeorge007 May 12, 2021
b172b5e
Add support for Webpack 5 message objects (#10121)
jasonwilliams May 30, 2021
93241a0
Unpin babel dependencies (#10797)
mohd-akram May 30, 2021
0415189
Remove ESLint verification when opting-out (#10499)
mrmckeb Jun 2, 2021
382ba21
Add source-map-loader for debugging into original source of node_modu…
justingrant Jun 2, 2021
0ee4765
Coerce Node versions with metadata (#11057)
mrmckeb Jun 8, 2021
64df135
Update PostCSS version (#11121)
mrmckeb Jun 22, 2021
78d86f6
Run npm with --no-audit (#11176)
gaearon Jul 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"browser": true,
"commonjs": true,
"node": true,
"es6": true
"es6": true,
"jest": true
},
"parserOptions": {
"ecmaVersion": 2018
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ labels: 'issue: bug report, needs triage'
* yarn.lock

Then you need to decide which package manager you prefer to use.
We support both npm (https://npmjs.com) and yarn (http://yarnpkg.com/).
We support both npm (https://npmjs.com) and yarn (https://yarnpkg.com/).
However, **they can't be used together in one project** so you need to pick one.

If you decided to use npm, run this in your project directory:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Integration Tests

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
job:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
node: ['10', '12', '14']
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Cache dependencies
id: cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock', './yarn.lock') }}
- name: Install packages
if: steps.cache.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile --prefer-offline
- name: Run integration tests
run: yarn test:integration
8 changes: 4 additions & 4 deletions CHANGELOG-0.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ npm install -g [email protected]

If you are using Yarn, and you have created at least one app previously, Create React App now works offline.

<img src="http://i.imgur.com/1FLa9Tg.gif" width="500" alt="Yarn offline installation demo">
<img src="https://i.imgur.com/1FLa9Tg.gif" width="500" alt="Yarn offline installation demo">

#### :bug: Bug Fix

Expand Down Expand Up @@ -515,7 +515,7 @@ Inside any created project that has not been ejected, run:
npm install --save-dev --save-exact [email protected]
```

Then, run your tests. If you are affected by breaking changes from Jest 18, consult [blog post](https://facebook.github.io/jest/blog/2016/12/15/2016-in-jest.html), [changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md#jest-1800), and [documentation](http://facebook.github.io/jest/docs/getting-started.html). You might need to update any snapshots since their format might have changed.
Then, run your tests. If you are affected by breaking changes from Jest 18, consult [blog post](https://facebook.github.io/jest/blog/2016/12/15/2016-in-jest.html), [changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md#jest-1800), and [documentation](https://facebook.github.io/jest/docs/getting-started.html). You might need to update any snapshots since their format might have changed.

If you relied on the browser not starting in non-interactive terminals, you now need to explicitly specify `BROWSER=none` as an environment variable to disable it.

Expand Down Expand Up @@ -993,7 +993,7 @@ Thanks to [@fson](https://github.com/fson) for cutting this release.

### Build Dependency (`react-scripts`)

- Updates Jest to [version 16.0](http://facebook.github.io/jest/blog/2016/10/03/jest-16.html), with an upgraded CLI, improved snapshot testing, new matchers and more. ([@chase](https://github.com/chase) in [#858](https://github.com/facebook/create-react-app/pull/858))
- Updates Jest to [version 16.0](https://facebook.github.io/jest/blog/2016/10/03/jest-16.html), with an upgraded CLI, improved snapshot testing, new matchers and more. ([@chase](https://github.com/chase) in [#858](https://github.com/facebook/create-react-app/pull/858))
- Test setup file `src/setupTests.js` is now called after test framework initialization to support loading custom matchers. ([@just-boris](https://github.com/just-boris) in [#846](https://github.com/facebook/create-react-app/pull/846))
- Build command shows better instructions for deploying the app to GitHub Pages ([@Janpot](https://github.com/Janpot) in [#841](https://github.com/facebook/create-react-app/pull/841))
- Build command now generates an asset manifest with mappings from each filename to its final output filename. ([@lukyth](https://github.com/lukyth) in [#891](https://github.com/facebook/create-react-app/pull/891))
Expand Down Expand Up @@ -1394,7 +1394,7 @@ Newly created projects will use `0.2.1` automatically. You **don’t** need to u

- You can now enable deployment to GitHub Pages by adding `homepage` field to `package.json` ([@dhruska](https://github.com/dhruska) in [#94](https://github.com/facebook/create-react-app/pull/94))
- Development server now runs on `0.0.0.0` and works with VirtualBox ([@JWo1F](https://github.com/JWo1F) in [#128](https://github.com/facebook/create-react-app/pull/128))
- Cloud9 and Nitrous online IDEs are now supported ([@gaearon](http://github.com/gaearon) in [2fe84e](https://github.com/facebook/create-react-app/commit/2fe84ecded55f1d5258d91f9c2c07698ae0d2fb4))
- Cloud9 and Nitrous online IDEs are now supported ([@gaearon](https://github.com/gaearon) in [2fe84e](https://github.com/facebook/create-react-app/commit/2fe84ecded55f1d5258d91f9c2c07698ae0d2fb4))
- When `3000` port is taken, we offer to use another port ([@chocnut](https://github.com/chocnut) in [#101](https://github.com/facebook/create-react-app/pull/101), [2edf21](https://github.com/facebook/create-react-app/commit/2edf2180f2aa6bf647807d0b1fcd95f4cfe4a558))
- You can now `import` CSS files from npm modules ([@glennreyes](https://github.com/glennreyes) in [#105](https://github.com/facebook/create-react-app/pull/105), [@breaddevil](https://github.com/breaddevil) in [#178](https://github.com/facebook/create-react-app/pull/178))
- `fetch` and `Promise` polyfills are now always included ([@gaearon](https://github.com/gaearon) in [#235](https://github.com/facebook/create-react-app/pull/235))
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG-1.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ You can automatically convert your project to fix them by running the [correspon

#### How do I make my tests work with Jest 20?

Please refer to the [Jest 19](https://facebook.github.io/jest/blog/2017/02/21/jest-19-immersive-watch-mode-test-platform-improvements.html#breaking-changes) and [Jest 20](http://facebook.github.io/jest/blog/2017/05/06/jest-20-delightful-testing-multi-project-runner.html#breaking-changes) breaking changes for migration instructions.
Please refer to the [Jest 19](https://facebook.github.io/jest/blog/2017/02/21/jest-19-immersive-watch-mode-test-platform-improvements.html#breaking-changes) and [Jest 20](https://facebook.github.io/jest/blog/2017/05/06/jest-20-delightful-testing-multi-project-runner.html#breaking-changes) breaking changes for migration instructions.

If you use snapshots, you will likely need to update them once because of the change in format.

Expand Down
121 changes: 121 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,124 @@
## 4.0.3 (2021-02-22)

v4.0.3 is a maintenance release that includes minor bug fixes and dependency updates.

#### :bug: Bug Fix

- `react-scripts`
- [#10590](https://github.com/facebook/create-react-app/pull/10590) Upgrade eslint-webpack-plugin to fix opt-out flag ([@mrmckeb](https://github.com/mrmckeb))

#### :house: Internal

- `react-dev-utils`
- [#10412](https://github.com/facebook/create-react-app/pull/10412) update immer to 8.0.1 to address vulnerability ([@wclem4](https://github.com/wclem4))
- `create-react-app`
- [#10384](https://github.com/facebook/create-react-app/pull/10384) tests: update test case to match the description ([@jamesgeorge007](https://github.com/jamesgeorge007))

#### Committers: 4

- Brody McKee ([@mrmckeb](https://github.com/mrmckeb))
- Dion Woolley ([@Awarua-](https://github.com/Awarua-))
- James George ([@jamesgeorge007](https://github.com/jamesgeorge007))
- Walker Clem ([@wclem4](https://github.com/wclem4))

# Migrating from 4.0.2 to 4.0.3

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

```bash
npm install --save --save-exact [email protected]
```

or

```
yarn add --exact [email protected]
```

## 4.0.2 (2021-02-03)

v4.0.2 is a maintenance release that includes minor bug fixes and documentation updates.

#### :rocket: New Feature

- `react-scripts`
- [#8986](https://github.com/facebook/create-react-app/pull/8986) Add support for new BUILD_PATH advanced configuration variable ([@ajhyndman](https://github.com/ajhyndman))

#### :bug: Bug Fix

- `react-scripts`
- [#10170](https://github.com/facebook/create-react-app/pull/10170) Add opt-out for eslint-webpack-plugin ([@mrmckeb](https://github.com/mrmckeb))
- [#9872](https://github.com/facebook/create-react-app/pull/9872) fix(react-scripts): add missing peer dependency react and update react-refresh-webpack-plugin ([@merceyz](https://github.com/merceyz))
- [#9964](https://github.com/facebook/create-react-app/pull/9964) Add TypeScript 4.x as peerDependency to react-scripts ([@sheepsteak](https://github.com/sheepsteak))

#### :nail_care: Enhancement

- `react-scripts`
- [#9977](https://github.com/facebook/create-react-app/pull/9977) Move ESLint cache file into node_modules ([@ehsankhfr](https://github.com/ehsankhfr))
- [#9569](https://github.com/facebook/create-react-app/pull/9569) Improve vendor chunk names in development ([@jrr](https://github.com/jrr))

#### :memo: Documentation

- [#9473](https://github.com/facebook/create-react-app/pull/9473) docs: add missing override options for Jest config ([@tobiasbueschel](https://github.com/tobiasbueschel))
- [#10314](https://github.com/facebook/create-react-app/pull/10314) Update using-the-public-folder.md ([@Avivhdr](https://github.com/Avivhdr))
- [#10214](https://github.com/facebook/create-react-app/pull/10214) Remove references to Node 8 ([@ianschmitz](https://github.com/ianschmitz))

#### :house: Internal

- `react-scripts`
- [#10027](https://github.com/facebook/create-react-app/pull/10027) appTsConfig immutability handling by immer ([@josezone](https://github.com/josezone))
- `create-react-app`
- [#10217](https://github.com/facebook/create-react-app/pull/10217) Fix CI tests ([@ianschmitz](https://github.com/ianschmitz))
- `react-dev-utils`, `react-error-overlay`, `react-scripts`
- [#10091](https://github.com/facebook/create-react-app/pull/10091) Recovered some integration tests ([@maxsbelt](https://github.com/maxsbelt))

#### :hammer: Underlying Tools

- `react-scripts`
- [#10216](https://github.com/facebook/create-react-app/pull/10216) Revert "Update postcss packages" ([@ianschmitz](https://github.com/ianschmitz))
- [#9988](https://github.com/facebook/create-react-app/pull/9988) Upgrade sass-loader ([@ehsankhfr](https://github.com/ehsankhfr))
- [#10003](https://github.com/facebook/create-react-app/pull/10003) Update postcss packages ([@raix](https://github.com/raix))
- [#10213](https://github.com/facebook/create-react-app/pull/10213) Upgrade @svgr/webpack to fix build error ([@jabranr](https://github.com/jabranr))
- `react-dev-utils`
- [#10198](https://github.com/facebook/create-react-app/pull/10198) remove chalk from formatWebpackMessages ([@jasonwilliams](https://github.com/jasonwilliams))
- `cra-template-typescript`
- [#10141](https://github.com/facebook/create-react-app/pull/10141) chore: bump typescript version ([@trainto](https://github.com/trainto))
- `cra-template-typescript`, `cra-template`
- [#10143](https://github.com/facebook/create-react-app/pull/10143) chore: bump web-vital dependency version ([@sahilpurav](https://github.com/sahilpurav))

#### Committers: 15

- Andrew Hyndman ([@ajhyndman](https://github.com/ajhyndman))
- Aviv Hadar ([@Avivhdr](https://github.com/Avivhdr))
- Brody McKee ([@mrmckeb](https://github.com/mrmckeb))
- Chris Shepherd ([@sheepsteak](https://github.com/sheepsteak))
- EhsanKhaki ([@ehsankhfr](https://github.com/ehsankhfr))
- Hakjoon Sim ([@trainto](https://github.com/trainto))
- Ian Schmitz ([@ianschmitz](https://github.com/ianschmitz))
- Jabran Rafique⚡️ ([@jabranr](https://github.com/jabranr))
- Jason Williams ([@jasonwilliams](https://github.com/jasonwilliams))
- John Ruble ([@jrr](https://github.com/jrr))
- Kristoffer K. ([@merceyz](https://github.com/merceyz))
- Morten N.O. Nørgaard Henriksen ([@raix](https://github.com/raix))
- Sahil Purav ([@sahilpurav](https://github.com/sahilpurav))
- Sergey Makarov ([@maxsbelt](https://github.com/maxsbelt))
- Tobias Büschel ([@tobiasbueschel](https://github.com/tobiasbueschel))
- mad-jose ([@josezone](https://github.com/josezone))

# Migrating from 4.0.1 to 4.0.2

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

```bash
npm install --save --save-exact [email protected]
```

or

```
yarn add --exact [email protected]
```

## 4.0.1 (2020-11-23)

v4.0.1 is a maintenance release that includes minor bug fixes and documentation updates.
Expand Down
41 changes: 23 additions & 18 deletions docusaurus/docs/adding-a-sass-stylesheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,36 @@ Generally, we recommend that you don’t reuse the same CSS classes across diffe

Following this rule often makes CSS preprocessors less useful, as features like mixins and nesting are replaced by component composition. You can, however, integrate a CSS preprocessor if you find it valuable.

To use Sass, first install `node-sass`:
To use Sass, first install `sass`:

```sh
$ npm install node-sass --save
$ # or
$ yarn add node-sass
$ npm install sass
# or
$ yarn add sass
```

Now you can rename `src/App.css` to `src/App.scss` and update `src/App.js` to import `src/App.scss`.
This file and any other file will be automatically compiled if imported with the extension `.scss` or `.sass`.

To share variables between Sass files, you can use Sass imports. For example, `src/App.scss` and other component style files could include `@import "./shared.scss";` with variable definitions.
To share variables between Sass files, you can use Sass's [`@use` rule](https://sass-lang.com/documentation/at-rules/use). For example, `src/App.scss` and other component style files could include `@use "./shared.scss";` with variable definitions.

This will allow you to do imports like

```scss
@import 'styles/_colors.scss'; // assuming a styles directory under src/
@import '~nprogress/nprogress'; // importing a css file from the nprogress node module
@use 'styles/_colors.scss'; // assuming a styles directory under src/
@use '~nprogress/nprogress'; // loading a css file from the nprogress node module
```

> **Note:** You must prefix imports from `node_modules` with `~` as displayed above.
> **Note:** You can prefix paths with `~`, as displayed above, to resolve modules from `node_modules`.

`node-sass` also supports the `SASS_PATH` variable.
`sass` also supports the `SASS_PATH` variable.

To use imports relative to a path you specify, and from `node_modules` without adding the `~` prefix, you can add a [`.env` file](https://github.com/facebook/create-react-app/blob/master/docusaurus/docs/adding-custom-environment-variables.md#adding-development-environment-variables-in-env) at the project root with the variable `SASS_PATH=node_modules:src`. To specify more directories you can add them to `SASS_PATH` separated by a `:` like `path1:path2:path3`.
To use imports relative to a path you specify, you can add a [`.env` file](https://github.com/facebook/create-react-app/blob/master/docusaurus/docs/adding-custom-environment-variables.md#adding-development-environment-variables-in-env) at the project root with the path specified in the `SASS_PATH` environment variable. To specify more directories you can add them to `SASS_PATH` separated by a `:` like `path1:path2:path3`.

If you set `SASS_PATH=node_modules:src`, this will allow you to do imports like
```scss
@import 'styles/colors'; // assuming a styles directory under src/, where _colors.scss partial file exists.
@import 'nprogress/nprogress'; // importing a css file from the nprogress node module
```

> **Note:** For windows operating system, use below syntax
> **Note:** For the Windows operating system, separate your paths by semicolons.
>
> ```
> SASS_PATH=./node_modules;./src
> SASS_PATH=path1;path2;path3
> ```

> **Tip:** You can opt into using this feature with [CSS modules](adding-a-css-modules-stylesheet.md) too!
Expand All @@ -61,3 +55,14 @@ If you set `SASS_PATH=node_modules:src`, this will allow you to do imports like
> module.file_ext=.sass
> module.file_ext=.scss
> ```

> **Note:** LibSass and the packages built on top of it, including Node Sass, are [deprecated](https://sass-lang.com/blog/libsass-is-deprecated).
> If you're a user of Node Sass, you can migrate to Dart Sass by replacing `node-sass` in your `package.json` file with `sass` or by running the following commands:
>
> ```sh
> $ npm uninstall node-sass
> $ npm install sass
> # or
> $ yarn remove node-sass
> $ yarn add sass
> ```
12 changes: 6 additions & 6 deletions docusaurus/docs/adding-bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ While you don’t have to use any specific library to integrate Bootstrap with R
Each project's respective documentation site has detailed instructions for installing and using them. Both depend on the Bootstrap css file so install that as well:

```sh
npm install --save bootstrap
npm install bootstrap
```

Alternatively you may use `yarn`:
Expand All @@ -33,19 +33,19 @@ Sometimes you might need to tweak the visual styles of Bootstrap (or equivalent

As of `[email protected]` you can import `.scss` files. This makes it possible to use a package's built-in Sass variables for global style preferences.

To enable `scss` in Create React App you will need to install `node-sass`.
To enable `scss` in Create React App you will need to install `sass`.

```sh
npm install --save node-sass
npm install sass
```

Alternatively you may use `yarn`:

```sh
yarn add node-sass
yarn add sass
```

To customize Bootstrap, create a file called `src/custom.scss` (or similar) and import the Bootstrap source stylesheet. Add any overrides _before_ the imported file(s). You can reference [Bootstrap's documentation](https://getbootstrap.com/docs/4.1/getting-started/theming/#css-variables) for the names of the available variables.
To customize Bootstrap, create a file called `src/custom.scss` (or similar) and import the Bootstrap source stylesheet. Add any overrides _before_ the imported file(s). You can reference [Bootstrap's documentation](https://getbootstrap.com/docs/4.6/getting-started/theming/#variable-defaults) for the names of the available variables.

```scss
// Override default variables before the import
Expand All @@ -55,7 +55,7 @@ $body-bg: #000;
@import '~bootstrap/scss/bootstrap.scss';
```

> **Note:** You must prefix imports from `node_modules` with `~` as displayed above.
> **Note:** You can prefix paths with `~`, as displayed above, to resolve modules from `node_modules`.

Finally, import the newly created `.scss` file instead of the default Bootstrap `.css` in the beginning of your `src/index.js` file, for example:

Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/adding-css-reset.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Browser support is dictated by what normalize.css [supports]. As of this writing
- iOS Safari (last 2)
- Internet Explorer 9+

[browserslist]: http://browserl.ist/
[browserslist]: https://browserl.ist/
[css reset]: https://cssreset.com/what-is-a-css-reset/
[normalize.css]: https://github.com/csstools/normalize.css
[supports]: https://github.com/csstools/normalize.css#browser-support
Expand Down
Loading