Skip to content

Commit 46b0234

Browse files
committed
Merge branch 'master' into static-folder
2 parents 0b57f5e + db5f874 commit 46b0234

29 files changed

+932
-166
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ const clientESLintConfig = require('./config/eslint');
22

33
module.exports = Object.assign({}, clientESLintConfig, {
44
env: Object.assign({}, clientESLintConfig.env, {
5-
node: true
5+
node: true,
66
})
77
});

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ build
33
.DS_Store
44
*.tgz
55
my-app*
6+
template/src/__tests__/__snapshots__/

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
## 0.2.1 (August 1, 2016)
2+
3+
### Build Dependency (`react-scripts`)
4+
5+
* Fixes an issue with `npm start` taking a very long time on OS X with Firewall enabled ([@gaearon](https://github.com/gaearon) in [#319](https://github.com/facebookincubator/create-react-app/pull/319))
6+
* Fixes an issue with Webpack eating a lot of CPU in some cases ([@dceddia](https://github.com/dceddia) in [#294](https://github.com/facebookincubator/create-react-app/pull/294))
7+
* We now warn if you import a file with mismatched casing because this breaks the watcher ([@alexzherdev](https://github.com/alexzherdev) in [#266](https://github.com/facebookincubator/create-react-app/pull/266))
8+
* CSS files specifying `?v=` after asset filenames, such as Font Awesome, now works correctly ([@alexzherdev](https://github.com/alexzherdev) in [#298](https://github.com/facebookincubator/create-react-app/pull/298))
9+
* Issues with `npm link`ing `react-scripts` have been fixed ([@dallonf](https://github.com/dallonf) in [#277](https://github.com/facebookincubator/create-react-app/pull/277))
10+
* We now use `/static` prefix for assets both in development and production ([@gaearon](https://github.com/gaearon) in [#278](https://github.com/facebookincubator/create-react-app/pull/278))
11+
12+
### Migrating from 0.2.0 to 0.2.1
13+
14+
Update `react-scripts` to point to `0.2.1` in your `package.json` and run `npm install`. You shouldn’t need to do anything else. If you see a warning about wrong file casing next time you `npm start`, fix your imports to use the correct filename casing.
15+
16+
Newly created projects will use `0.2.1` automatically. You **don’t** need to update the global `create-react-app` CLI itself. It stays at `0.2.0` for now because it doesn’t have any changes.
17+
118
## 0.2.0 (July 28, 2016)
219

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

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ If you don’t agree with the choices made in this project, you might want to ex
172172
* [roc](https://github.com/rocjs/roc)
173173
* [aik](https://github.com/d4rkr00t/aik)
174174
* [react-app](https://github.com/kriasoft/react-app)
175+
* [dev-toolkit](https://github.com/stoikerty/dev-toolkit)
176+
* [mozilla-neo](https://github.com/mozilla/neo)
175177

176178
You can also use module bundlers like [webpack](http://webpack.github.io) and [Browserify](http://browserify.org/) directly.<br>
177179
React documentation includes [a walkthrough](https://facebook.github.io/react/docs/package-management.html) on this topic.

bin/react-scripts.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ var args = process.argv.slice(3);
55

66
switch (script) {
77
case 'build':
8-
case 'start':
98
case 'eject':
9+
case 'start':
10+
case 'test':
1011
var result = spawn.sync(
1112
'node',
1213
[require.resolve('../scripts/' + script)].concat(args),

config/babel.dev.js

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,35 @@
88
*/
99

1010
module.exports = {
11+
// Don't try to find .babelrc because we want to force this configuration.
1112
babelrc: false,
13+
// This is a feature of `babel-loader` for webpack (not Babel itself).
14+
// It enables caching results in OS temporary directory for faster rebuilds.
1215
cacheDirectory: true,
1316
presets: [
14-
'babel-preset-es2015',
15-
'babel-preset-es2016',
16-
'babel-preset-react'
17-
].map(require.resolve),
17+
// let, const, destructuring, classes, modules
18+
require.resolve('babel-preset-es2015'),
19+
// exponentiation
20+
require.resolve('babel-preset-es2016'),
21+
// JSX, Flow
22+
require.resolve('babel-preset-react')
23+
],
1824
plugins: [
19-
'babel-plugin-syntax-trailing-function-commas',
20-
'babel-plugin-transform-class-properties',
21-
'babel-plugin-transform-object-rest-spread'
22-
].map(require.resolve).concat([
25+
// function x(a, b, c,) { }
26+
require.resolve('babel-plugin-syntax-trailing-function-commas'),
27+
// await fetch()
28+
require.resolve('babel-plugin-syntax-async-functions'),
29+
// class { handleClick = () => { } }
30+
require.resolve('babel-plugin-transform-class-properties'),
31+
// { ...todo, completed: true }
32+
require.resolve('babel-plugin-transform-object-rest-spread'),
33+
// function* () { yield 42; yield 43; }
34+
require.resolve('babel-plugin-transform-regenerator'),
35+
// Polyfills the runtime needed for async/await and generators
2336
[require.resolve('babel-plugin-transform-runtime'), {
2437
helpers: false,
2538
polyfill: false,
2639
regenerator: true
2740
}]
28-
])
41+
]
2942
};

config/babel.prod.js

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,34 @@
88
*/
99

1010
module.exports = {
11+
// Don't try to find .babelrc because we want to force this configuration.
1112
babelrc: false,
1213
presets: [
13-
'babel-preset-es2015',
14-
'babel-preset-es2016',
15-
'babel-preset-react'
16-
].map(require.resolve),
14+
// let, const, destructuring, classes, modules
15+
require.resolve('babel-preset-es2015'),
16+
// exponentiation
17+
require.resolve('babel-preset-es2016'),
18+
// JSX, Flow
19+
require.resolve('babel-preset-react')
20+
],
1721
plugins: [
18-
'babel-plugin-syntax-trailing-function-commas',
19-
'babel-plugin-transform-class-properties',
20-
'babel-plugin-transform-object-rest-spread',
21-
'babel-plugin-transform-react-constant-elements',
22-
].map(require.resolve).concat([
22+
// function x(a, b, c,) { }
23+
require.resolve('babel-plugin-syntax-trailing-function-commas'),
24+
// await fetch()
25+
require.resolve('babel-plugin-syntax-async-functions'),
26+
// class { handleClick = () => { } }
27+
require.resolve('babel-plugin-transform-class-properties'),
28+
// { ...todo, completed: true }
29+
require.resolve('babel-plugin-transform-object-rest-spread'),
30+
// function* () { yield 42; yield 43; }
31+
require.resolve('babel-plugin-transform-regenerator'),
32+
// Polyfills the runtime needed for async/await and generators
2333
[require.resolve('babel-plugin-transform-runtime'), {
2434
helpers: false,
2535
polyfill: false,
2636
regenerator: true
27-
}]
28-
])
37+
}],
38+
// Optimization: hoist JSX that never changes out of render()
39+
require.resolve('babel-plugin-transform-react-constant-elements')
40+
]
2941
};

config/env.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
11+
// injected into the application via DefinePlugin in Webpack configuration.
12+
13+
var REACT_APP = /^REACT_APP_/i;
14+
var NODE_ENV = JSON.stringify(process.env.NODE_ENV || 'development');
15+
16+
module.exports = Object
17+
.keys(process.env)
18+
.filter(key => REACT_APP.test(key))
19+
.reduce((env, key) => {
20+
env['process.env.' + key] = JSON.stringify(process.env[key]);
21+
return env;
22+
}, {
23+
'process.env.NODE_ENV': NODE_ENV
24+
});

config/eslint.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ module.exports = {
2828
browser: true,
2929
commonjs: true,
3030
es6: true,
31+
jest: true,
3132
node: true
3233
},
3334

config/jest/CSSStub.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
3+
*
4+
* This source code is licensed under the BSD-style license found in the
5+
* LICENSE file in the root directory of this source tree. An additional grant
6+
* of patent rights can be found in the PATENTS file in the same directory.
7+
*
8+
* @flow
9+
*/
10+
11+
module.exports = {};

0 commit comments

Comments
 (0)