Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…react-app

# By Ville Immonen (11) and others
# Via Dan Abramov
* 'master' of https://github.com/facebookincubator/create-react-app: (39 commits)
  Remove redundant `function` from export statement (facebook#996)
  Add Gatsby to alternatives (facebook#995)
  Allow webpack 2 as peerDependency in react-dev-utils (facebook#963)
  Remove custom babel-loader cache dir config (facebook#983)
  Check for presence of folders before continuing eject. Closes facebook#939. (facebook#951)
  Fixes facebook#952 (facebook#953)
  Always build before deploying to gh-pages (facebook#959)
  Add collectCoverageFrom option to collect coverage on files without any tests. (facebook#961)
  Catch and noop call to open web browser. (facebook#964)
  Gently nudge users towards https by default (facebook#974)
  Enable compression on webpack-dev-server (facebook#966) (facebook#968)
  Add next.js to Alternatives
  Point people to npm Windows instructions
  Encourage people to try recent npm
  Fix an attribution link in 0.7.0 changelog
  Update CLI version in changelog
  Publish
  Update eslint-config-react-app version in the guide
  Update changelog for 0.7.0
  Revert "Temporarily remove 0.7.0 changelog as it's not out yet"
  ...

Conflicts:
	packages/babel-preset-react-app/package.json
	packages/create-react-app/package.json
	packages/eslint-config-react-app/package.json
	packages/react-dev-utils/package.json
	packages/react-scripts/config/webpack.config.dev.js
	packages/react-scripts/config/webpack.config.prod.js
	packages/react-scripts/package.json
  • Loading branch information
kitze committed Nov 4, 2016
2 parents fe9343d + 79160b8 commit d444609
Show file tree
Hide file tree
Showing 27 changed files with 328 additions and 222 deletions.
63 changes: 61 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,62 @@
## 0.7.0 (October 22, 2016)

### 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/facebookincubator/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/facebookincubator/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/facebookincubator/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/facebookincubator/create-react-app/pull/891))
* Build command exits, if there are errors from UglifyJS ([@pdillon](https://github.com/pdillon) in [#859](https://github.com/facebookincubator/create-react-app/pull/859))
* Eject output is more beautiful now. ([@azakordonets](https://github.com/azakordonets) in [#769](https://github.com/facebookincubator/create-react-app/pull/769))
* Fixes opening the app in a new tab in Chrome. ([@unixdev](https://github.com/unixdev) in [#831](https://github.com/facebookincubator/create-react-app/pull/831))
* Fixes environment variables not being defined as normal properties of the `process.env` object. ([@dvkndn](https://github.com/dvkndn) in [#807](https://github.com/facebookincubator/create-react-app/pull/807))
* Fixes PostCSS autoprefixer not processing CSS files imported with CSS `@import` statements. ([@nhunzaker](https://github.com/nhunzaker) in [#929](https://github.com/facebookincubator/create-react-app/pull/929))

### ESLint Config (`eslint-config-react-app`)

* Adds `import/no-webpack-loader-syntax` rule that forbids using custom Webpack specific syntax to specify Webpack loaders in import statements. ([@fson](https://github.com/fson) in [#803](https://github.com/facebookincubator/create-react-app/pull/803))
* `react/react-in-jsx-scope` rule ("React must be in scope") is now an error. ([@gaearon](https://github.com/gaearon) in [#822](https://github.com/facebookincubator/create-react-app/pull/822))
* `no-unused-expressions` rule now allows the use of short circuit and ternary expressions. ([@cannona](https://github.com/cannona) in [#724](https://github.com/facebookincubator/create-react-app/pull/724))

### Babel Preset (`babel-preset-react-app`)

* The preset now detects the Node.js version in test environment and disables unnecessary ES2015 transforms using using `babel-preset-env`. ([@shubheksha](https://github.com/shubheksha) in [#878](https://github.com/facebookincubator/create-react-app/pull/878), [@JeffreyATW](https://github.com/JeffreyATW) in [#927
](https://github.com/facebookincubator/create-react-app/pull/927))
* Fixes a duplicate dependency on `babel-plugin-transform-regenerator`. ([@akofman](https://github.com/akofman) in [#864](https://github.com/facebookincubator/create-react-app/pull/864))

### Utilities (`react-dev-utils`)

* The error overlay is now disposed after fixing linting errors. ([@jarlef](https://github.com/jarlef) in [#856](https://github.com/facebookincubator/create-react-app/pull/856))
* Adds support for Webpack 2 to `webpackHotDevClient`. ([@michalkvasnicak](https://github.com/michalkvasnicak) in [#840](https://github.com/facebookincubator/create-react-app/pull/840))

### Global CLI (`create-react-app`)

* Adds support for passing a scoped package name to the `--scripts-version` argument. ([@pdillon](https://github.com/pdillon) in [#826](https://github.com/facebookincubator/create-react-app/pull/826))
* Fixes installing pre-release versions using a tarball URL with the `--scripts-version` argument. ([@jihchi](https://github.com/jihchi) in [#876](https://github.com/facebookincubator/create-react-app/pull/876))

### Migrating from 0.6.1 to 0.7.0

You may optionally update the global command (it’s not required):

```
npm install -g create-react-app@0.6.0
```

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

```
npm install --save-dev --save-exact react-scripts@0.7.0
```

### Breaking Change in 0.7.0

#### Updating Snapshots

Jest 16 includes [improvements to snapshot testing and changes to the snapshot format](https://facebook.github.io/jest/blog/2016/10/03/jest-16.html#snapshot-updates). If your project uses snapshot testing, you'll need to update the snapshot files. To update the snapshots, run:
```
npm test -- -u
```

## 0.6.1 (September 27, 2016)

### Build Dependency (`react-scripts`)
Expand Down Expand Up @@ -61,9 +120,9 @@ npm install --save-dev --save-exact react-scripts@0.5.1
* Adds [support for `public` folder](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#using-the-public-folder) with arbitrary assets. ([@gaearon](https://github.com/gaearon) in [#703](https://github.com/facebookincubator/create-react-app/pull/703))
* You can now [specify defaults](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-development-environment-variables-in-env) for environment variables with `.env` file. ([@ayrton](https://github.com/ayrton) in [#695](https://github.com/facebookincubator/create-react-app/pull/695))
* Ejecting now generates proper `.babelrc` and `.eslintrc`. ([@fson](https://github.com/fson) in [#689](https://github.com/facebookincubator/create-react-app/pull/689), [@gaearon](https://github.com/gaearon) in [#705](https://github.com/facebookincubator/create-react-app/pull/705))
* Some React warnings now [include the component stacktrace](https://twitter.com/dan_abramov/status/779308833399332864). ([@gaearon](https://github.com/gaearon) in [#716](https://github.com/facebookincubator/create-react-app/pull/716))
* Some React warnings now [include the component stacktrace](https://twitter.com/dan_abramov/status/779308833399332864). ([@gaearon](https://github.com/gaearon) in [#716](https://github.com/facebookincubator/create-react-app/pull/716))
* `npm start` doesn’t fail in a composed Docker container. ([@arekkas](https://github.com/arekkas) in [#711](https://github.com/facebookincubator/create-react-app/issues/711))
* The projects generated with `eject` are now cleaner. ([@gaearon](https://github.com/gaearon) in [#723](https://github.com/facebookincubator/create-react-app/pull/723))
* The projects generated with `eject` are now cleaner. ([@gaearon](https://github.com/gaearon) in [#723](https://github.com/facebookincubator/create-react-app/pull/723))
* The project is now managed as a monorepo. ([@ryanyogan](https://github.com/ryanyogan) in [#419](https://github.com/facebookincubator/create-react-app/pull/419), [@fson](https://github.com/fson) in [#678](https://github.com/facebookincubator/create-react-app/pull/678))

### ESLint Config (`eslint-config-react-app`)
Expand Down
20 changes: 20 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
If you are reporting a bug, please fill in below. Otherwise feel free to remove this template entirely.

### Can you reproduce the problem with latest npm?

Many errors, especially related to "missing modules", are due to npm bugs.

If you're using Windows, [follow these instructions to update npm](https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows).

If you're using OS X or Linux, run this to update npm:

```
npm install -g npm@latest
cd your_project_directory
rm -rf node_modules
npm install
```

Then try to reproduce the issue again.

Can you still reproduce it?

### Description

What are you reporting?
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ Some of the more popular and actively maintained ones are:
* [insin/nwb](https://github.com/insin/nwb)
* [mozilla/neo](https://github.com/mozilla/neo)
* [NYTimes/kyt](https://github.com/NYTimes/kyt)
* [zeit/next.js](https://github.com/zeit/next.js)
* [gatsbyjs/gatsby](https://github.com/gatsbyjs/gatsby)

Notable alternatives also include:

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"lerna": "2.0.0-beta.29",
"lerna": "2.0.0-beta.30",
"version": "independent"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"devDependencies": {
"babel-eslint": "6.1.2",
"eslint": "3.5.0",
"eslint-config-react-app": "file:packages/eslint-config-react-app",
"eslint-config-react-app": "0.2.1",
"eslint-plugin-flowtype": "2.18.1",
"eslint-plugin-import": "1.12.0",
"eslint-plugin-jsx-a11y": "2.2.2",
"eslint-plugin-react": "6.3.0",
"lerna": "2.0.0-beta.29"
"lerna": "2.0.0-beta.30"
}
}
72 changes: 50 additions & 22 deletions packages/babel-preset-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@

var path = require('path');

module.exports = {
presets: [
// Latest stable ECMAScript features
require.resolve('babel-preset-latest'),
// JSX, Flow
require.resolve('babel-preset-react')
],
plugins: [
const plugins = [
// class { handleClick = () => { } }
require.resolve('babel-plugin-transform-class-properties'),
// { ...todo, completed: true }
Expand All @@ -34,9 +27,16 @@ module.exports = {
regenerator: true,
// Resolve the Babel runtime relative to the config.
moduleName: path.dirname(require.resolve('babel-runtime/package'))
}]
]
};
}],
// The following two plugins are currently necessary to get
// babel-preset-env to work with rest/spread. More info here:
// https://github.com/babel/babel-preset-env#caveats
// https://github.com/babel/babel/issues/4074
// const { a, ...z } = obj;
require.resolve('babel-plugin-transform-es2015-destructuring'),
// const fn = ({ a, ...otherProps }) => otherProps;
require.resolve('babel-plugin-transform-es2015-parameters')
];

// This is similar to how `env` works in Babel:
// https://babeljs.io/docs/usage/babelrc/#env-option
Expand All @@ -52,7 +52,7 @@ if (env !== 'development' && env !== 'test' && env !== 'production') {
'"test", and "production". Instead, received: ' + JSON.stringify(env) + '.'
);
}
var plugins = module.exports.plugins;

if (env === 'development' || env === 'test') {
plugins.push.apply(plugins, [
// Adds component stack to warning messages
Expand All @@ -61,14 +61,42 @@ if (env === 'development' || env === 'test') {
require.resolve('babel-plugin-transform-react-jsx-self')
]);
}
if (env === 'production') {
// Optimization: hoist JSX that never changes out of render()
// Disabled because of issues:
// * https://github.com/facebookincubator/create-react-app/issues/525
// * https://phabricator.babeljs.io/search/query/pCNlnC2xzwzx/
// * https://github.com/babel/babel/issues/4516
// TODO: Enable again when these issues are resolved.
// plugins.push.apply(plugins, [
// require.resolve('babel-plugin-transform-react-constant-elements')
// ]);

if (env === 'test') {
module.exports = {
presets: [
// ES features necessary for user's Node version
[require('babel-preset-env').default, {
targets: {
node: parseFloat(process.versions.node),
},
}],
// JSX, Flow
require.resolve('babel-preset-react')
],
plugins: plugins
};
} else {
module.exports = {
presets: [
// Latest stable ECMAScript features
require.resolve('babel-preset-latest'),
// JSX, Flow
require.resolve('babel-preset-react')
],
plugins: plugins
};

if (env === 'production') {
// Optimization: hoist JSX that never changes out of render()
// Disabled because of issues:
// * https://github.com/facebookincubator/create-react-app/issues/525
// * https://phabricator.babeljs.io/search/query/pCNlnC2xzwzx/
// * https://github.com/babel/babel/issues/4516
// TODO: Enable again when these issues are resolved.
// plugins.push.apply(plugins, [
// require.resolve('babel-plugin-transform-react-constant-elements')
// ]);
}
}

15 changes: 9 additions & 6 deletions packages/babel-preset-react-app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "babel-preset-react-app",
"version": "0.2.1",
"private": true,
"version": "1.0.0",
"description": "Babel preset used by Create React App",
"repository": "facebookincubator/create-react-app",
"license": "BSD-3-Clause",
Expand All @@ -12,15 +12,18 @@
"index.js"
],
"dependencies": {
"babel-plugin-transform-class-properties": "6.11.5",
"babel-plugin-transform-object-rest-spread": "6.8.0",
"babel-plugin-transform-class-properties": "6.16.0",
"babel-plugin-transform-es2015-destructuring": "6.16.0",
"babel-plugin-transform-es2015-parameters": "6.17.0",
"babel-plugin-transform-object-rest-spread": "6.16.0",
"babel-plugin-transform-react-constant-elements": "6.9.1",
"babel-plugin-transform-react-jsx-self": "6.11.0",
"babel-plugin-transform-react-jsx-source": "6.9.0",
"babel-plugin-transform-regenerator": "6.14.0",
"babel-plugin-transform-regenerator": "6.16.1",
"babel-plugin-transform-runtime": "6.15.0",
"babel-preset-latest": "6.14.0",
"babel-preset-react": "6.11.1",
"babel-preset-env": "0.0.6",
"babel-preset-latest": "6.16.0",
"babel-preset-react": "6.16.0",
"babel-runtime": "6.11.6"
}
}
11 changes: 7 additions & 4 deletions packages/create-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,13 @@ function getInstallPackage(version) {

// Extract package name from tarball url or path.
function getPackageName(installPackage) {
if (~installPackage.indexOf('.tgz')) {
return installPackage.match(/^.+\/(.+)-.+\.tgz$/)[1];
} else if (~installPackage.indexOf('@')) {
return installPackage.split('@')[0];
if (installPackage.indexOf('.tgz') > -1) {
// The package name could be with or without semver version, e.g. react-scripts-0.2.0-alpha.1.tgz
// However, this function returns package name only wihout semver version.
return installPackage.match(/^.+\/(.+?)(?:-\d+.+)?\.tgz$/)[1];
} else if (installPackage.indexOf('@') > 0) {
// Do not match @scope/ when stripping off @version or @tag
return installPackage.charAt(0) + installPackage.substr(1).split('@')[0];
}
return installPackage;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/create-react-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-react-app",
"version": "0.5.0",
"version": "0.6.0",
"private": true,
"keywords": [
"react"
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-react-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ If you want to use this ESLint configuration in a project not built with Create
First, install this package, ESLint and the necessary plugins.

```sh
npm install --save-dev eslint-config-react-app babel-eslint@6.1.2 eslint@3.5.0 eslint-plugin-flowtype@2.18.1 eslint-plugin-import@1.12.0 eslint-plugin-jsx-a11y@2.2.2 eslint-plugin-react@6.3.0
npm install --save-dev eslint-config-react-app babel-eslint@7.0.0 eslint@3.8.1 eslint-plugin-flowtype@2.21.0 eslint-plugin-import@2.0.1 eslint-plugin-jsx-a11y@2.2.3 eslint-plugin-react@6.4.1
```

Then create a file named `.eslintrc` with following contents in the root folder of your project:
Expand Down
11 changes: 8 additions & 3 deletions packages/eslint-config-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ module.exports = {

parser: 'babel-eslint',

// import plugin is temporarily disabled, scroll below to see why
plugins: [/*'import', */'flowtype', 'jsx-a11y', 'react'],
plugins: ['import', 'flowtype', 'jsx-a11y', 'react'],

env: {
browser: true,
Expand All @@ -45,7 +44,7 @@ module.exports = {
settings: {
'import/ignore': [
'node_modules',
'\\.(json|css|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$',
'\\.(json|css|ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$',
],
'import/extensions': ['.js'],
'import/resolver': {
Expand Down Expand Up @@ -170,6 +169,9 @@ module.exports = {
// This is probably fixable with a patch to eslint-loader.
// When file A is saved, we want to invalidate all files that import it
// *and* that currently have lint errors. This should fix the problem.
// (As an exception, import/no-webpack-loader-syntax can be enabled already
// because it doesn't depend on whether the file exists, so this issue
// doesn't apply to it.)

// 'import/default': 'warn',
// 'import/export': 'warn',
Expand All @@ -181,6 +183,9 @@ module.exports = {
// 'import/no-named-as-default': 'warn',
// 'import/no-named-as-default-member': 'warn',
// 'import/no-unresolved': ['warn', { commonjs: true }],
// We don't support configuring Webpack using import source strings, so this
// is always an error.
'import/no-webpack-loader-syntax': 'error',

// https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules
'react/jsx-equals-spacing': ['warn', 'never'],
Expand Down
14 changes: 7 additions & 7 deletions packages/eslint-config-react-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-react-app",
"version": "0.2.1",
"version": "0.3.0",
"private": true,
"description": "ESLint configuration used by Create React App",
"repository": "facebookincubator/create-react-app",
Expand All @@ -12,11 +12,11 @@
"index.js"
],
"peerDependencies": {
"babel-eslint": "6.1.2",
"eslint": "3.5.0",
"eslint-plugin-flowtype": "2.18.1",
"eslint-plugin-import": "1.12.0",
"eslint-plugin-jsx-a11y": "2.2.2",
"eslint-plugin-react": "6.3.0"
"babel-eslint": "7.0.0",
"eslint": "3.8.1",
"eslint-plugin-flowtype": "2.21.0",
"eslint-plugin-import": "2.0.1",
"eslint-plugin-jsx-a11y": "2.2.3",
"eslint-plugin-react": "6.4.1"
}
}
2 changes: 1 addition & 1 deletion packages/react-dev-utils/openBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function openBrowser(url) {
// Fallback to opn
// (It will always open new tab)
try {
opn(url);
opn(url).catch(() => {}); // Prevent `unhandledRejection` error.
return true;
} catch (err) {
return false;
Expand Down
5 changes: 1 addition & 4 deletions packages/react-dev-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-dev-utils",
"version": "0.2.1",
"version": "0.3.0",
"private": true,
"description": "Webpack utilities used by Create React App",
"repository": "facebookincubator/create-react-app",
Expand Down Expand Up @@ -30,8 +30,5 @@
"opn": "4.0.2",
"sockjs-client": "1.0.3",
"strip-ansi": "3.0.1"
},
"peerDependencies": {
"webpack": "^1.13.2"
}
}
Loading

0 comments on commit d444609

Please sign in to comment.