Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Commit 6bd33bd

Browse files
committed
Merge remote-tracking branch 'facebook/master'
2 parents b5caf82 + 36e279d commit 6bd33bd

File tree

17 files changed

+165
-33
lines changed

17 files changed

+165
-33
lines changed

CHANGELOG.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,85 @@
1+
## 1.0.6 (May 24, 2017)
2+
3+
#### :bug: Bug Fix
4+
5+
* `eslint-config-react-app`, `react-error-overlay`, `react-scripts`
6+
7+
* [#2346](https://github.com/facebookincubator/create-react-app/pull/2346) Resolve Flow errors in an ESLint plugin. ([@iainbeeston](https://github.com/iainbeeston))
8+
9+
* `react-dev-utils`
10+
11+
* [#2332](https://github.com/facebookincubator/create-react-app/pull/2332) Fix proxying issues with backends that don't support IPv6. ([@Timer](https://github.com/Timer))
12+
13+
#### :nail_care: Enhancement
14+
* `react-scripts`
15+
16+
* [#2347](https://github.com/facebookincubator/create-react-app/pull/2347) Don't precache `/__*` URLs to fix Firebase hosting. ([@ryansully](https://github.com/ryansully))
17+
18+
#### :memo: Documentation
19+
20+
* README
21+
22+
* [#2334](https://github.com/facebookincubator/create-react-app/pull/2334) Add missing files to the list. ([@jesselpalmer](https://github.com/jesselpalmer))
23+
24+
#### Committers: 4
25+
- Iain Beeston ([iainbeeston](https://github.com/iainbeeston))
26+
- Jesse Palmer ([jesselpalmer](https://github.com/jesselpalmer))
27+
- Joe Haddad ([Timer](https://github.com/Timer))
28+
- Ryan Sullivan ([ryansully](https://github.com/ryansully))
29+
30+
### Migrating from 1.0.5 to 1.0.6
31+
32+
Inside any created project that has not been ejected, run:
33+
34+
```
35+
npm install --save-dev --save-exact react-scripts@1.0.6
36+
```
37+
38+
or
39+
40+
```
41+
yarn add --dev --exact react-scripts@1.0.6
42+
```
43+
44+
## 1.0.5 (May 22, 2017)
45+
46+
#### :bug: Bug Fix
47+
* `react-dev-utils`, `react-scripts`
48+
49+
* [#2326](https://github.com/facebookincubator/create-react-app/pull/2326) Files in `public/` folder should not be requested through proxy. ([@gaearon](https://github.com/gaearon))
50+
51+
#### :nail_care: Enhancement
52+
* `react-dev-utils`
53+
54+
* [#2327](https://github.com/facebookincubator/create-react-app/pull/2327) Limit console warnings to 5 files at most. ([@gaearon](https://github.com/gaearon))
55+
56+
* `eslint-config-react-app`
57+
58+
* [#2325](https://github.com/facebookincubator/create-react-app/pull/2325) Allow declaring variables before use in a scope above. ([@gaearon](https://github.com/gaearon))
59+
60+
#### :house: Internal
61+
* `react-dev-utils`, `react-scripts`
62+
63+
* [#2320](https://github.com/facebookincubator/create-react-app/pull/2320) Remove unnecessary dependencies. ([@pmadar](https://github.com/pmadar))
64+
65+
#### Committers: 2
66+
- Dan Abramov ([gaearon](https://github.com/gaearon))
67+
- Pavol Madar ([pmadar](https://github.com/pmadar))
68+
69+
### Migrating from 1.0.4 to 1.0.5
70+
71+
Inside any created project that has not been ejected, run:
72+
73+
```
74+
npm install --save-dev --save-exact react-scripts@1.0.5
75+
```
76+
77+
or
78+
79+
```
80+
yarn add --dev --exact react-scripts@1.0.5
81+
```
82+
183
## 1.0.4 (May 22, 2017)
284

385
#### :bug: Bug Fix
@@ -303,6 +385,10 @@ Follow these steps if you see errors about missing lint rules in the editor.
303385

304386
If you still have the problem please file an issue.
305387

388+
#### Some of my tests started crashing because of unhandled rejections
389+
390+
Unhandled Promise rejections will now crash tests. You can fix them by explicitly catching the errors you don’t care about.
391+
306392
#### How to turn my app into a [Progressive Web App](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#making-a-progressive-web-app)?
307393

308394
After the regular update procedure above, add these line to `<head>` in `public/index.html`:

packages/eslint-config-react-app/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,14 @@ module.exports = {
195195
ignoreRestSiblings: true,
196196
},
197197
],
198-
'no-use-before-define': ['warn', 'nofunc'],
198+
'no-use-before-define': [
199+
'warn',
200+
{
201+
functions: false,
202+
classes: false,
203+
variables: false,
204+
},
205+
],
199206
'no-useless-computed-key': 'warn',
200207
'no-useless-concat': 'warn',
201208
'no-useless-constructor': 'warn',

packages/eslint-config-react-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-react-app",
3-
"version": "1.0.2",
3+
"version": "1.0.4",
44
"description": "ESLint configuration used by Create React App",
55
"repository": "facebookincubator/create-react-app",
66
"license": "BSD-3-Clause",
@@ -15,7 +15,7 @@
1515
"eslint": "^3.19.0",
1616
"eslint-plugin-flowtype": "^2.33.0",
1717
"eslint-plugin-import": "^2.2.0",
18-
"eslint-plugin-jsx-a11y": "^5.0.1",
18+
"eslint-plugin-jsx-a11y": "^5.0.3",
1919
"eslint-plugin-react": "^7.0.1"
2020
}
2121
}

packages/react-dev-utils/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ Returns a Promise resolving to either `defaultPort` or next available port if th
283283

284284
Creates a Webpack compiler instance for WebpackDevServer with built-in helpful messages. Takes the `require('webpack')` entry point as the first argument. To provide the `urls` argument, use `prepareUrls()` described below.
285285

286-
##### `prepareProxy(proxySetting: string): Object`
286+
##### `prepareProxy(proxySetting: string, appPublicFolder: string): Object`
287287

288288
Creates a WebpackDevServer `proxy` configuration object from the `proxy` setting in `package.json`.
289289

packages/react-dev-utils/WebpackDevServerUtils.js

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
'use strict';
1010

1111
const address = require('address');
12+
const fs = require('fs');
13+
const path = require('path');
1214
const url = require('url');
1315
const chalk = require('chalk');
1416
const detect = require('@timer/detect-port');
@@ -191,10 +193,25 @@ function resolveLoopback(proxy) {
191193
if (o.hostname !== 'localhost') {
192194
return proxy;
193195
}
194-
try {
196+
// Unfortunately, many languages (unlike node) do not yet support IPv6.
197+
// This means even though localhost resolves to ::1, the application
198+
// must fall back to IPv4 (on 127.0.0.1).
199+
// We can re-enable this in a few years.
200+
/*try {
195201
o.hostname = address.ipv6() ? '::1' : '127.0.0.1';
196202
} catch (_ignored) {
197203
o.hostname = '127.0.0.1';
204+
}*/
205+
206+
try {
207+
// Check if we're on a network; if we are, chances are we can resolve
208+
// localhost. Otherwise, we can just be safe and assume localhost is
209+
// IPv4 for maximum compatibility.
210+
if (!address.ip()) {
211+
o.hostname = '127.0.0.1';
212+
}
213+
} catch (_ignored) {
214+
o.hostname = '127.0.0.1';
198215
}
199216
return url.format(o);
200217
}
@@ -240,7 +257,7 @@ function onProxyError(proxy) {
240257
};
241258
}
242259

243-
function prepareProxy(proxy) {
260+
function prepareProxy(proxy, appPublicFolder) {
244261
// `proxy` lets you specify alternate servers for specific requests.
245262
// It can either be a string or an object conforming to the Webpack dev server proxy configuration
246263
// https://webpack.github.io/docs/webpack-dev-server.html
@@ -264,13 +281,11 @@ function prepareProxy(proxy) {
264281
process.exit(1);
265282
}
266283

267-
// Otherwise, if proxy is specified, we will let it handle any request.
268-
// There are a few exceptions which we won't send to the proxy:
269-
// - /index.html (served as HTML5 history API fallback)
270-
// - /*.hot-update.json (WebpackDevServer uses this too for hot reloading)
271-
// - /sockjs-node/* (WebpackDevServer uses this for hot reloading)
272-
// Tip: use https://jex.im/regulex/ to visualize the regex
273-
const mayProxy = /^(?!\/(index\.html$|.*\.hot-update\.json$|sockjs-node\/)).*$/;
284+
// Otherwise, if proxy is specified, we will let it handle any request except for files in the public folder.
285+
function mayProxy(pathname) {
286+
const maybePublicPath = path.resolve(appPublicFolder, pathname.slice(1));
287+
return !fs.existsSync(maybePublicPath);
288+
}
274289

275290
// Support proxy as a string for those who are using the simple proxy option
276291
if (typeof proxy === 'string') {
@@ -301,7 +316,7 @@ function prepareProxy(proxy) {
301316
// However API calls like `fetch()` won’t generally accept text/html.
302317
// If this heuristic doesn’t work well for you, use a custom `proxy` object.
303318
context: function(pathname, req) {
304-
return mayProxy.test(pathname) &&
319+
return mayProxy(pathname) &&
305320
req.headers.accept &&
306321
req.headers.accept.indexOf('text/html') === -1;
307322
},
@@ -341,7 +356,7 @@ function prepareProxy(proxy) {
341356
}
342357
return Object.assign({}, proxy[context], {
343358
context: function(pathname) {
344-
return mayProxy.test(pathname) && pathname.match(context);
359+
return mayProxy(pathname) && pathname.match(context);
345360
},
346361
onProxyReq: proxyReq => {
347362
// Browers may send Origin headers even with same-origin
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
10+
'use strict';
11+
12+
var crossSpawn = require('cross-spawn');
13+
14+
module.exports = crossSpawn;

packages/react-dev-utils/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-dev-utils",
3-
"version": "1.0.3",
3+
"version": "2.0.1",
44
"description": "Webpack utilities used by Create React App",
55
"repository": "facebookincubator/create-react-app",
66
"license": "BSD-3-Clause",
@@ -15,6 +15,7 @@
1515
"checkRequiredFiles.js",
1616
"clearConsole.js",
1717
"crashOverlay.js",
18+
"crossSpawn.js",
1819
"eslintFormatter.js",
1920
"FileSizeReporter.js",
2021
"formatWebpackMessages.js",

packages/react-dev-utils/webpackHotDevClient.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,13 @@ function handleWarnings(warnings) {
228228

229229
if (typeof console !== 'undefined' && typeof console.warn === 'function') {
230230
for (var i = 0; i < formatted.warnings.length; i++) {
231+
if (i === 5) {
232+
console.warn(
233+
'There were more warnings in other files.\n' +
234+
'You can find a complete log in the terminal.'
235+
);
236+
break;
237+
}
231238
console.warn(stripAnsi(formatted.warnings[i]));
232239
}
233240
}

packages/react-error-overlay/.flowconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[ignore]
2-
<PROJECT_ROOT>/node_modules/eslint-plugin-jsx-a11y/.*
32

43
[include]
54
src/**/*.js

packages/react-error-overlay/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-error-overlay",
3-
"version": "1.0.3",
3+
"version": "1.0.6",
44
"description": "An overlay for displaying stack frames.",
55
"main": "lib/index.js",
66
"scripts": {
@@ -34,7 +34,7 @@
3434
"anser": "1.2.5",
3535
"babel-code-frame": "6.22.0",
3636
"babel-runtime": "6.23.0",
37-
"react-dev-utils": "^1.0.3",
37+
"react-dev-utils": "^2.0.1",
3838
"settle-promise": "1.0.0",
3939
"source-map": "0.5.6"
4040
},
@@ -44,10 +44,10 @@
4444
"babel-preset-react-app": "^3.0.0",
4545
"cross-env": "5.0.0",
4646
"eslint": "3.19.0",
47-
"eslint-config-react-app": "^1.0.2",
47+
"eslint-config-react-app": "^1.0.4",
4848
"eslint-plugin-flowtype": "2.33.0",
4949
"eslint-plugin-import": "2.2.0",
50-
"eslint-plugin-jsx-a11y": "5.0.1",
50+
"eslint-plugin-jsx-a11y": "5.0.3",
5151
"eslint-plugin-react": "7.0.1",
5252
"flow-bin": "0.46.0",
5353
"jest": "20.0.1",

packages/react-scripts/bin/react-scripts-ts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
'use strict';
1212

13-
const spawn = require('cross-spawn');
13+
const spawn = require('react-dev-utils/crossSpawn');
1414
const script = process.argv[2];
1515
const args = process.argv.slice(3);
1616

packages/react-scripts/config/webpack.config.prod.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,12 @@ module.exports = {
303303
console.log(message);
304304
},
305305
minify: true,
306+
// For unknown URLs, fallback to the index page
306307
navigateFallback: publicUrl + '/index.html',
308+
// Ignores URLs starting from /__ (useful for Firebase):
309+
// https://github.com/facebookincubator/create-react-app/issues/2237#issuecomment-302693219
310+
navigateFallbackWhitelist: [/^(?!\/__).*/],
311+
// Don't precache sourcemaps (they're large) and build asset manifest:
307312
staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/],
308313
// Work around Windows path issue in SWPrecacheWebpackPlugin:
309314
// https://github.com/facebookincubator/create-react-app/issues/2235

packages/react-scripts/package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
"case-sensitive-paths-webpack-plugin": "2.0.0",
2828
"chalk": "1.1.3",
2929
"cli-highlight": "1.1.4",
30-
"connect-history-api-fallback": "1.3.0",
31-
"cross-spawn": "4.0.2",
3230
"css-loader": "0.28.1",
3331
"dotenv": "4.0.0",
3432
"extract-text-webpack-plugin": "2.1.0",
@@ -40,8 +38,8 @@
4038
"postcss-flexbugs-fixes": "3.0.0",
4139
"postcss-loader": "2.0.5",
4240
"promise": "7.1.1",
43-
"react-dev-utils": "^1.0.2",
44-
"react-error-overlay": "^1.0.2",
41+
"react-dev-utils": "^2.0.1",
42+
"react-error-overlay": "^1.0.6",
4543
"style-loader": "0.17.0",
4644
"ts-loader": "^2.0.3",
4745
"tslint": "^5.2.0",
@@ -51,7 +49,7 @@
5149
"source-map-loader": "^0.2.1",
5250
"sw-precache-webpack-plugin": "0.9.1",
5351
"url-loader": "0.5.8",
54-
"webpack": "2.5.1",
52+
"webpack": "2.6.0",
5553
"webpack-dev-server": "2.4.5",
5654
"webpack-manifest-plugin": "1.1.0",
5755
"whatwg-fetch": "2.0.3"

packages/react-scripts/scripts/eject.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ process.on('unhandledRejection', err => {
1919
const fs = require('fs-extra');
2020
const path = require('path');
2121
const execSync = require('child_process').execSync;
22-
const spawnSync = require('cross-spawn').sync;
2322
const chalk = require('chalk');
2423
const paths = require('../config/paths');
2524
const createJestConfig = require('./utils/createJestConfig');
2625
const inquirer = require('react-dev-utils/inquirer');
26+
const spawnSync = require('react-dev-utils/crossSpawn').sync;
2727

2828
const green = chalk.green;
2929
const cyan = chalk.cyan;

packages/react-scripts/scripts/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ process.on('unhandledRejection', err => {
1818

1919
const fs = require('fs-extra');
2020
const path = require('path');
21-
const spawn = require('cross-spawn');
2221
const chalk = require('chalk');
22+
const spawn = require('react-dev-utils/crossSpawn');
2323

2424
module.exports = function(
2525
appPath,

packages/react-scripts/scripts/start.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ choosePort(HOST, DEFAULT_PORT)
6666
const compiler = createCompiler(webpack, config, appName, urls, useYarn);
6767
// Load proxy config
6868
const proxySetting = require(paths.appPackageJson).proxy;
69-
const proxyConfig = prepareProxy(proxySetting);
69+
const proxyConfig = prepareProxy(proxySetting, paths.appPublic);
7070
// Serve webpack assets generated by the compiler over a web sever.
7171
const serverConfig = createDevServerConfig(
7272
proxyConfig,

0 commit comments

Comments
 (0)