Skip to content

Commit 231a136

Browse files
committed
Merge branch 'masterd' into feat/modern-build
* masterd: (24 commits) Add TypeScript linting support (facebook#6513) Support React Hooks (facebook#5602) (facebook#5997) Support browserslist in @babel/preset-env (facebook#6608) Add empty mock for http2 (facebook#5686) Add note about npx caching (facebook#6374) change named import into default import (facebook#6625) Stage files for commit after ejecting (facebook#5960) Upgrade dependencies (facebook#6614) Make compiler variable const instead of let (facebook#6621) Type check JSON files (facebook#6615) Change class components to functional components in templates (facebook#6451) Convert JSON.stringify \n to os.EOL when writing tsconfig.json (facebook#6610) Update html-webpack-plugin (facebook#6361) Enable click to go to error in console for TypeScript (facebook#6502) Update webpack-dev-server to 3.2.1 (facebook#6483) [docs] revert removal of newlines from html (facebook#6386) Publish Prepare 2.1.8 release Reapply "Speed up TypeScript v2 (facebook#6406)" (facebook#6586) Publish ... # Conflicts: # packages/babel-preset-react-app/create.js # packages/react-scripts/scripts/build.js
2 parents 89aed63 + eee8491 commit 231a136

File tree

31 files changed

+984
-691
lines changed

31 files changed

+984
-691
lines changed

CHANGELOG.md

+120
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,123 @@
1+
## 2.1.8 (March 7, 2019)
2+
3+
v2.1.8 is a maintenance release that reapplies the TypeScript speed improvements ([#6406](https://github.com/facebook/create-react-app/pull/6406)) in a new major version of `react-dev-utils`.
4+
5+
### Migrating from 2.1.7 to 2.1.8
6+
7+
Inside any created project that has not been ejected, run:
8+
9+
```sh
10+
npm install --save --save-exact react-scripts@2.1.8
11+
```
12+
13+
or
14+
15+
```sh
16+
yarn add --exact react-scripts@2.1.8
17+
```
18+
19+
## 2.1.7 (March 7, 2019)
20+
21+
v2.1.7 is a maintenance release that temporarily reverts the TypeScript speed improvements ([#6406](https://github.com/facebook/create-react-app/pull/6406)) to fix a dependency issue in `react-dev-utils`.
22+
23+
### Migrating from 2.1.6 to 2.1.7
24+
25+
Inside any created project that has not been ejected, run:
26+
27+
```sh
28+
npm install --save --save-exact react-scripts@2.1.7
29+
```
30+
31+
or
32+
33+
```sh
34+
yarn add --exact react-scripts@2.1.7
35+
```
36+
37+
## 2.1.6 (March 6, 2019)
38+
39+
v2.1.6 is a maintenance release that brings a few new improvements, most notably:
40+
41+
- :rocket: Reduced TypeScript rebuild times while running the development server. This was previously introduced in v2.1.4 but had to be reverted. Thanks to [@ianschmitz](https://github.com/ianschmitz) for getting this ready.
42+
43+
#### :bug: Bug Fix
44+
45+
- `react-dev-utils`
46+
- [#6511](https://github.com/facebook/create-react-app/pull/6511) Fix deploy instructions to make link clickable. ([@sbimochan](https://github.com/sbimochan))
47+
- `react-scripts`
48+
- [#6472](https://github.com/facebook/create-react-app/pull/6472) Revert CSS sourcemaps in development. ([@bugzpodder](https://github.com/bugzpodder))
49+
- [#6444](https://github.com/facebook/create-react-app/pull/6444) Revert "Switch to eval-source-map (#5060)". ([@ianschmitz](https://github.com/ianschmitz))
50+
51+
#### :nail_care: Enhancement
52+
53+
- `react-dev-utils`, `react-scripts`
54+
- [#6406](https://github.com/facebook/create-react-app/pull/6406) Speed up TypeScript rebuild times in development. ([@ianschmitz](https://github.com/ianschmitz))
55+
- `create-react-app`
56+
- [#6253](https://github.com/facebook/create-react-app/pull/6253) Only use `yarn.lock.cached` if using the default Yarn registry. ([@hangryCat](https://github.com/hangryCat))
57+
- `react-scripts`
58+
- [#5457](https://github.com/facebook/create-react-app/pull/5457) Add forward ref to React SVG Component. ([@GasimGasimzada](https://github.com/GasimGasimzada))
59+
60+
#### :memo: Documentation
61+
62+
- `babel-preset-react-app`
63+
- [#6254](https://github.com/facebook/create-react-app/pull/6254) Improve Flow and TypeScript usage docs. ([@saranshkataria](https://github.com/saranshkataria))
64+
- `babel-preset-react-app`, `confusing-browser-globals`, `react-app-polyfill`
65+
- [#6419](https://github.com/facebook/create-react-app/pull/6419) Improve language used in markdown code blocks. ([@cherouvim](https://github.com/cherouvim))
66+
- `create-react-app`
67+
- [#6481](https://github.com/facebook/create-react-app/pull/6481) Fix typo. ([@adyouri](https://github.com/adyouri))
68+
- `react-dev-utils`
69+
- [#6482](https://github.com/facebook/create-react-app/pull/6482) Fix typo. ([@mattfwood](https://github.com/mattfwood))
70+
- Other
71+
- [#6438](https://github.com/facebook/create-react-app/pull/6438) Update `source-map-explorer` docs to analyze all chunks. ([@Kamahl19](https://github.com/Kamahl19))
72+
- [#6454](https://github.com/facebook/create-react-app/pull/6454) Fix typo. ([@DenrizSusam](https://github.com/DenrizSusam))
73+
- [#5767](https://github.com/facebook/create-react-app/pull/5767) Add information about using custom registries in e2e testing #4488. ([@juanpicado](https://github.com/juanpicado))
74+
- `react-dev-utils`, `react-scripts`
75+
- [#6239](https://github.com/facebook/create-react-app/pull/6239) Convert all bit.ly links from http to https. ([@leighhalliday](https://github.com/leighhalliday))
76+
77+
#### :house: Internal
78+
79+
- [#6493](https://github.com/facebook/create-react-app/pull/6493) Remove AppVeyor config files. ([@iansu](https://github.com/iansu))
80+
- [#6474](https://github.com/facebook/create-react-app/pull/6474) Remove latest Node version from Travis config. ([@iansu](https://github.com/iansu))
81+
82+
#### :hammer: Underlying Tools
83+
84+
- `react-scripts`
85+
- [#6387](https://github.com/facebook/create-react-app/pull/6387) Use contenthash instead of chunkhash for better long-term caching. ([@ianschmitz](https://github.com/ianschmitz))
86+
- Other
87+
- [#6365](https://github.com/facebook/create-react-app/pull/6365) Upgrade Docusaurus and enable new features. ([@yangshun](https://github.com/yangshun))
88+
89+
#### Committers: 15
90+
91+
- Abdelhadi Dyouri ([adyouri](https://github.com/adyouri))
92+
- Bimochan Shrestha ([sbimochan](https://github.com/sbimochan))
93+
- Deniz Susman ([DenrizSusam](https://github.com/DenrizSusam))
94+
- Gasim Gasimzada ([GasimGasimzada](https://github.com/GasimGasimzada))
95+
- Ian Schmitz ([ianschmitz](https://github.com/ianschmitz))
96+
- Ian Sutherland ([iansu](https://github.com/iansu))
97+
- Ioannis Cherouvim ([cherouvim](https://github.com/cherouvim))
98+
- Jack Zhao ([bugzpodder](https://github.com/bugzpodder))
99+
- Juan Picado @jotadeveloper ([juanpicado](https://github.com/juanpicado))
100+
- Leigh Halliday ([leighhalliday](https://github.com/leighhalliday))
101+
- Martin Litvaj ([Kamahl19](https://github.com/Kamahl19))
102+
- Matt Wood ([mattfwood](https://github.com/mattfwood))
103+
- Meo H. ([hangryCat](https://github.com/hangryCat))
104+
- Saransh Kataria ([saranshkataria](https://github.com/saranshkataria))
105+
- Yangshun Tay ([yangshun](https://github.com/yangshun))
106+
107+
### Migrating from 2.1.5 to 2.1.6
108+
109+
Inside any created project that has not been ejected, run:
110+
111+
```sh
112+
npm install --save --save-exact react-scripts@2.1.6
113+
```
114+
115+
or
116+
117+
```sh
118+
yarn add --exact react-scripts@2.1.6
119+
```
120+
1121
## 2.1.5 (February 11, 2019)
2122

3123
v2.1.5 is a maintenance release that reverts the TypeScript speed improvements ([#5903](https://github.com/facebook/create-react-app/pull/5903)) to fix a dependency issue in `react-dev-utils`.

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,19 @@ During the build, `process.env.REACT_APP_NOT_SECRET_CODE` will be replaced with
4141

4242
When you load the app in the browser and inspect the `<input>`, you will see its value set to `abcdef`, and the bold text will show the environment provided when using `npm start`:
4343

44+
<!-- prettier-ignore-start -->
45+
4446
```html
4547
<div>
4648
<small>You are running this application in <b>development</b> mode.</small>
47-
<form><input type="hidden" value="abcdef" /></form>
49+
<form>
50+
<input type="hidden" value="abcdef" />
51+
</form>
4852
</div>
4953
```
5054

55+
<!-- prettier-ignore-end -->
56+
5157
The above form is looking for a variable called `REACT_APP_NOT_SECRET_CODE` from the environment. In order to consume this value, we need to have it defined in the environment. This can be done using two ways: either in your shell or in a `.env` file. Both of these ways are described in the next few sections.
5258

5359
Having access to the `NODE_ENV` is also useful for performing actions conditionally:

docusaurus/docs/adding-typescript.md

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ Type errors will show up in the same console as the build one.
3333

3434
To learn more about TypeScript, check out [its documentation](https://www.typescriptlang.org/).
3535

36+
> **Note:** If your project is not created with TypeScript enabled, npx may be using a cached version of `create-react-app`.
37+
> Remove previously installed versions with `npm uninstall -g create-react-app` (see [#6119](https://github.com/facebook/create-react-app/issues/6119#issuecomment-451614035)).
38+
3639
> **Note:** You are not required to make a [`tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html), one will be made for you.
3740
> You are allowed to edit the generated TypeScript configuration.
3841

docusaurus/docs/setting-up-your-editor.md

+13
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,19 @@ You would need to install an ESLint plugin for your editor first. Then, add a fi
2828
}
2929
```
3030

31+
If you're using TypeScript and Visual Studio Code, the [ESLint Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint#overview) currently [doesn't have TypeScript support enabled by default](https://github.com/Microsoft/vscode-eslint/issues/609). To enable TypeScript support in the ESLint extension, add the following to your project's Visual Studio Code settings file, located at `.vscode/settings.json` (you can create this file if it doesn't already exist):
32+
33+
```json
34+
{
35+
"eslint.validate": [
36+
"javascript",
37+
"javascriptreact",
38+
{ "language": "typescript", "autoFix": true },
39+
{ "language": "typescriptreact", "autoFix": true }
40+
]
41+
}
42+
```
43+
3144
Now your editor should report the linting warnings.
3245

3346
Note that even if you edit your `.eslintrc.json` file further, these changes will **only affect the editor integration**. They won’t affect the terminal and in-browser lint output. This is because Create React App intentionally provides a minimal set of rules that find common mistakes.

docusaurus/docs/supported-browsers-features.md

+32-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_label: Supported Browsers and Features
66

77
## Supported Browsers
88

9-
By default, the generated project supports all modern browsers. Support for Internet Explorer 9, 10, and 11 requires [polyfills](https://github.com/facebook/create-react-app/blob/master/packages/react-app-polyfill/README.md).
9+
By default, the generated project supports all modern browsers. Support for Internet Explorer 9, 10, and 11 requires polyfills. For a minimum set of polyfills to support older browsers, use [react-app-polyfill](https://github.com/facebook/create-react-app/blob/master/packages/react-app-polyfill/README.md). To polyfill other language features, see the [Adding Polyfills](#adding-polyfills) section below
1010

1111
## Supported Language Features
1212

@@ -26,3 +26,34 @@ While we recommend using experimental proposals with some caution, Facebook heav
2626
Note that **this project includes no [polyfills](https://github.com/facebook/create-react-app/blob/master/packages/react-app-polyfill/README.md)** by default.
2727

2828
If you use any other ES6+ features that need **runtime support** (such as `Array.from()` or `Symbol`), make sure you are [including the appropriate polyfills manually](https://github.com/facebook/create-react-app/blob/master/packages/react-app-polyfill/README.md), or that the browsers you are targeting already support them.
29+
30+
## Adding Polyfills
31+
32+
You can install [`@babel/polyfill`](https://babeljs.io/docs/en/babel-polyfill) as a dependency in your application, and import it at the very top of your app's entry point (`src/index.js` or `src/index.tsx`) to emulate a full ES2015+ environment. Your `browerslist` configuration will be used to only include the polyfills necessary by your target browsers.
33+
34+
## Configuring Supported Browsers
35+
36+
By default, the generated project includes a [`browerslist`](https://github.com/browserslist/browserslist) configuration in your `package.json` file to target a broad range of browsers based on global usage (`> 0.2%`) for production builds, and modern browsers for development. This gives a good development experience, especially when using language features such as async/await, but still provides high compatibility with many browsers in production.
37+
38+
The `browserslist` configuration controls the outputted JavaScript so that the emitted code will be compatible with the browsers specified. The `production` list will be used when creating a production build by running the `build` script, and the `development` list will be used when running the `start` script. You can use [https://browserl.ist](https://browserl.ist/?q=%3E+0.2%25%2C+not+dead%2C+not+op_mini+all) to see the browsers supported by your configured `browserslist`.
39+
40+
Here is an example `browserslist` that is specified in `package.json`:
41+
42+
```json
43+
"browserslist": {
44+
"production": [
45+
">0.2%",
46+
"not dead",
47+
"not op_mini all"
48+
],
49+
"development": [
50+
"last 1 chrome version",
51+
"last 1 firefox version",
52+
"last 1 safari version"
53+
]
54+
}
55+
```
56+
57+
> Note that this does not include polyfills automatically for you. You will still need to polyfill language features (see above) as needed based on the browsers your are supporting.
58+
59+
> When editing the `browerslist` config, you may notice that your changes don't get picked up right away. This is due to an [issue in babel-loader](https://github.com/babel/babel-loader/issues/690) not detecting the change in your `package.json`. An easy solution is to delete the `node_modules/.cache` folder and try again.

package.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,24 @@
1919
"compile:lockfile": "node tasks/compile-lockfile.js"
2020
},
2121
"devDependencies": {
22-
"eslint": "5.12.0",
22+
"eslint": "5.15.1",
2323
"execa": "1.0.0",
24-
"fs-extra": "^7.0.0",
25-
"get-port": "^4.0.0",
26-
"globby": "^8.0.1",
27-
"husky": "1.0.0-rc.15",
24+
"fs-extra": "^7.0.1",
25+
"get-port": "^4.2.0",
26+
"globby": "^9.1.0",
27+
"husky": "^1.3.1",
2828
"jest": "^23.6.0",
2929
"lerna": "2.9.1",
30-
"lerna-changelog": "^0.7.0",
30+
"lerna-changelog": "~0.8.2",
3131
"lint-staged": "^8.0.4",
3232
"meow": "^5.0.0",
33-
"multimatch": "^2.1.0",
34-
"prettier": "1.15.2",
35-
"puppeteer": "^1.8.0",
36-
"strip-ansi": "^4.0.0",
33+
"multimatch": "^3.0.0",
34+
"prettier": "1.16.4",
35+
"puppeteer": "^1.13.0",
36+
"strip-ansi": "^5.1.0",
3737
"svg-term-cli": "^2.1.1",
3838
"tempy": "^0.2.1",
39-
"wait-for-localhost": "2.0.1"
39+
"wait-for-localhost": "^3.1.0"
4040
},
4141
"husky": {
4242
"hooks": {

packages/babel-preset-react-app/create.js

+21-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ module.exports = function(api, opts, env) {
104104
ignoreBrowserslistConfig: true,
105105
// If users import all core-js they're probably not concerned with
106106
// bundle size. We shouldn't rely on magic to try and shrink it.
107-
useBuiltIns: !isModern || !shouldBuildModern ? false : 'entry',
107+
useBuiltIns: 'entry',
108108
// Do not transform modules to CJS
109109
modules: false,
110110
// Exclude transforms that make all code slower
@@ -141,7 +141,26 @@ module.exports = function(api, opts, env) {
141141
// Necessary to include regardless of the environment because
142142
// in practice some other transforms (such as object-rest-spread)
143143
// don't work without it: https://github.com/babel/babel/issues/7215
144-
require('@babel/plugin-transform-destructuring').default,
144+
[
145+
require('@babel/plugin-transform-destructuring').default,
146+
{
147+
// Use loose mode for performance:
148+
// https://github.com/facebook/create-react-app/issues/5602
149+
loose: false,
150+
selectiveLoose: [
151+
'useState',
152+
'useEffect',
153+
'useContext',
154+
'useReducer',
155+
'useCallback',
156+
'useMemo',
157+
'useRef',
158+
'useImperativeHandle',
159+
'useLayoutEffect',
160+
'useDebugValue',
161+
],
162+
},
163+
],
145164
// Turn on legacy decorators for TypeScript files
146165
isTypeScriptEnabled && [
147166
require('@babel/plugin-proposal-decorators').default,

packages/babel-preset-react-app/package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "babel-preset-react-app",
3-
"version": "7.0.1",
3+
"version": "7.0.2",
44
"description": "Babel preset used by Create React App",
55
"repository": "facebook/create-react-app",
66
"license": "MIT",
@@ -17,21 +17,21 @@
1717
"test.js"
1818
],
1919
"dependencies": {
20-
"@babel/core": "7.2.2",
21-
"@babel/plugin-proposal-class-properties": "7.3.0",
20+
"@babel/core": "7.3.4",
21+
"@babel/plugin-proposal-class-properties": "7.3.4",
2222
"@babel/plugin-proposal-decorators": "7.3.0",
23-
"@babel/plugin-proposal-object-rest-spread": "7.3.2",
23+
"@babel/plugin-proposal-object-rest-spread": "7.3.4",
2424
"@babel/plugin-syntax-dynamic-import": "7.2.0",
25-
"@babel/plugin-transform-classes": "7.2.2",
25+
"@babel/plugin-transform-classes": "7.3.4",
2626
"@babel/plugin-transform-destructuring": "7.3.2",
27-
"@babel/plugin-transform-flow-strip-types": "7.2.3",
27+
"@babel/plugin-transform-flow-strip-types": "7.3.4",
2828
"@babel/plugin-transform-react-constant-elements": "7.2.0",
2929
"@babel/plugin-transform-react-display-name": "7.2.0",
30-
"@babel/plugin-transform-runtime": "7.2.0",
31-
"@babel/preset-env": "7.3.1",
30+
"@babel/plugin-transform-runtime": "7.3.4",
31+
"@babel/preset-env": "7.3.4",
3232
"@babel/preset-react": "7.0.0",
33-
"@babel/preset-typescript": "7.1.0",
34-
"@babel/runtime": "7.3.1",
33+
"@babel/preset-typescript": "7.3.3",
34+
"@babel/runtime": "7.3.4",
3535
"babel-loader": "8.0.5",
3636
"babel-plugin-dynamic-import-node": "2.2.0",
3737
"babel-plugin-macros": "2.5.0",

packages/confusing-browser-globals/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "confusing-browser-globals",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "A list of browser globals that are often used by mistake instead of local variables",
55
"license": "MIT",
66
"main": "index.js",

packages/create-react-app/createReactApp.js

-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ if (program.info) {
136136
npmGlobalPackages: ['create-react-app'],
137137
},
138138
{
139-
clipboard: false,
140139
duplicates: true,
141140
showNotFound: true,
142141
}

packages/create-react-app/package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "create-react-app",
3-
"version": "2.1.5",
3+
"version": "2.1.8",
44
"keywords": [
55
"react"
66
],
77
"description": "Create React apps with no build configuration.",
88
"repository": "facebook/create-react-app",
99
"license": "MIT",
1010
"engines": {
11-
"node": ">=4"
11+
"node": ">=8"
1212
},
1313
"bugs": {
1414
"url": "https://github.com/facebook/create-react-app/issues"
@@ -22,13 +22,13 @@
2222
"create-react-app": "./index.js"
2323
},
2424
"dependencies": {
25-
"chalk": "1.1.3",
26-
"commander": "2.18.0",
27-
"cross-spawn": "4.0.2",
28-
"envinfo": "5.11.1",
29-
"fs-extra": "5.0.0",
25+
"chalk": "2.4.2",
26+
"commander": "2.19.0",
27+
"cross-spawn": "6.0.5",
28+
"envinfo": "7.1.0",
29+
"fs-extra": "7.0.1",
3030
"hyperquest": "2.1.3",
31-
"semver": "5.5.1",
31+
"semver": "5.6.0",
3232
"tar-pack": "3.4.1",
3333
"tmp": "0.0.33",
3434
"validate-npm-package-name": "3.0.0"

0 commit comments

Comments
 (0)