Skip to content

Commit

Permalink
Update from upstream repo facebookincubator/create-react-app (#1)
Browse files Browse the repository at this point in the history
* Update Travis CI Node versions in User Guide (facebook#2454)

Removed Node v4 (CRA only supports Node >= 6)

* re-add storybook && update the documentation and links (facebook#2331)

* re-add storybook && update the documentation and links

* Change to new documentation domain

* Prioritize index.css over the implicit App.css (facebook#2470)

* Added NamedModulesPlugin in webpack.config.dev.js (facebook#2458)

* Added NamedModulesPlugin in webpack.config.dev.js

* Update webpack.config.dev.js

* Unscope detect-port (facebook#2483)

Resolves facebook#2481

* Update webpack links to point to webpack 2 (facebook#2492)

* Update README.md to make links to webpack point to webpack.js.org instead
  insteade of webpack 1 webpack.githup.io

* chore(templates): Move GitHub templates to hidden .github folder (facebook#2489)

* Fix minor docs typo (facebook#2500)

* Fix link to Storybook docs (facebook#2521)

* Simplify flow init docs (facebook#2522)

- Call `npm run flow --init` won't create a .flowconfig file, it should be `npm run flow init`
  • Loading branch information
backstroke-bot authored and paweljedrzejczyk committed Jun 12, 2017
1 parent 89361b5 commit 16c642e
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Some of them might get added in the future if they are stable, are useful to maj
The tools used by Create React App are subject to change.
Currently it is a thin layer on top of many amazing community projects, such as:

* [webpack](https://webpack.github.io/) with [webpack-dev-server](https://github.com/webpack/webpack-dev-server), [html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin) and [style-loader](https://github.com/webpack/style-loader)
* [webpack](https://webpack.js.org/) with [webpack-dev-server](https://github.com/webpack/webpack-dev-server), [html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin) and [style-loader](https://github.com/webpack/style-loader)
* [Babel](http://babeljs.io/) with ES6 and extensions used by Facebook (JSX, [object spread](https://github.com/sebmarkbage/ecmascript-rest-spread/commits/master), [class properties](https://github.com/jeffmo/es-class-public-fields))
* [Autoprefixer](https://github.com/postcss/autoprefixer)
* [ESLint](http://eslint.org/)
Expand Down Expand Up @@ -248,5 +248,5 @@ Notable alternatives also include:
* [dev-toolkit](https://github.com/stoikerty/dev-toolkit)
* [sku](https://github.com/seek-oss/sku)

You can also use module bundlers like [webpack](http://webpack.github.io) and [Browserify](http://browserify.org/) directly.<br>
You can also use module bundlers like [webpack](http://webpack.js.org) and [Browserify](http://browserify.org/) directly.<br>
React documentation includes [a walkthrough](https://facebook.github.io/react/docs/package-management.html) on this topic.
2 changes: 1 addition & 1 deletion packages/react-dev-utils/WebpackDevServerUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const fs = require('fs');
const path = require('path');
const url = require('url');
const chalk = require('chalk');
const detect = require('@timer/detect-port');
const detect = require('detect-port-alt');
const inquirer = require('inquirer');
const clearConsole = require('./clearConsole');
const formatWebpackMessages = require('./formatWebpackMessages');
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
"webpackHotDevClient.js"
],
"dependencies": {
"@timer/detect-port": "1.1.3",
"address": "1.0.1",
"anser": "1.3.0",
"babel-code-frame": "6.22.0",
"chalk": "1.1.3",
"cross-spawn": "4.0.2",
"detect-port-alt": "1.1.3",
"escape-string-regexp": "1.0.5",
"filesize": "3.3.0",
"gzip-size": "3.0.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/react-scripts/config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ module.exports = {
inject: true,
template: paths.appHtml,
}),
// Add module names to factory functions so they appear in browser profiler.
new webpack.NamedModulesPlugin(),
// Makes some environment variables available to the JS code, for example:
// if (process.env.NODE_ENV === 'development') { ... }. See `./env.js`.
new webpack.DefinePlugin(env.stringified),
Expand Down
28 changes: 13 additions & 15 deletions packages/react-scripts/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ To add Flow to a Create React App project, follow these steps:

1. Run `npm install --save-dev flow-bin` (or `yarn add --dev flow-bin`).
2. Add `"flow": "flow"` to the `scripts` section of your `package.json`.
3. Run `npm run flow -- init` (or `yarn flow -- init`) to create a [`.flowconfig` file](https://flowtype.org/docs/advanced-configuration.html) in the root directory.
3. Run `npm run flow init` (or `yarn flow init`) to create a [`.flowconfig` file](https://flowtype.org/docs/advanced-configuration.html) in the root directory.
4. Add `// @flow` to any files you want to type check (for example, to `src/App.js`).

Now you can run `npm run flow` (or `yarn flow`) to check the files for type errors.
Expand Down Expand Up @@ -1082,7 +1082,7 @@ The watcher includes an interactive command-line interface with the ability to r

### Version Control Integration

By default, when you run `npm test`, Jest will only run the tests related to files changed since the last commit. This is an optimization designed to make your tests runs fast regardless of how many tests you have. However it assumes that you don’t often commit the code that doesn’t pass the tests.
By default, when you run `npm test`, Jest will only run the tests related to files changed since the last commit. This is an optimization designed to make your tests run fast regardless of how many tests you have. However it assumes that you don’t often commit the code that doesn’t pass the tests.

Jest will always explicitly mention that it only ran tests related to the files changed since the last commit. You can also press `a` in the watch mode to force Jest to run all tests.

Expand Down Expand Up @@ -1244,7 +1244,6 @@ Popular CI servers already set the environment variable `CI` by default but you
```
language: node_js
node_js:
- 4
- 6
cache:
directories:
Expand Down Expand Up @@ -1322,30 +1321,30 @@ If you use [Visual Studio Code](https://code.visualstudio.com), there is a [Jest

![VS Code Jest Preview](https://cloud.githubusercontent.com/assets/49038/20795349/a032308a-b7c8-11e6-9b34-7eeac781003f.png)

<!--
## Developing Components in Isolation

Usually, in an app, you have a lot of UI components, and each of them has many different states.
For an example, a simple button component could have following states:

* With a text label.
* With an emoji.
* In a regular state, with a text label.
* In the disabled mode.
* In a loading state.

Usually, it’s hard to see these states without running a sample app or some examples.

Create React App doesn’t include any tools for this by default, but you can easily add [React Storybook](https://github.com/kadirahq/react-storybook) to your project. **It is a third-party tool that lets you develop components and see all their states in isolation from your app**.
Create React App doesn’t include any tools for this by default, but you can easily add [Storybook for React](https://storybook.js.org) ([source](https://github.com/storybooks/storybook)) to your project. **It is a third-party tool that lets you develop components and see all their states in isolation from your app**.

![React Storybook Demo](http://i.imgur.com/7CIAWpB.gif)
![Storybook for React Demo](http://i.imgur.com/7CIAWpB.gif)

You can also deploy your Storybook as a static app. This way, everyone in your team can view and review different states of UI components without starting a backend server or creating an account in your app.
A storybook can also be deployed as a static app.
This way, everyone in your team can view and review different states of UI components without starting a backend server or creating an account in your app.

**Here’s how to setup your app with Storybook:**
### Setup your app with Storybook

First, install the following npm package globally:

```sh
npm install -g getstorybook
npm install -g @storybook/cli
```

Then, run the following command inside your app’s directory:
Expand All @@ -1359,10 +1358,9 @@ After that, follow the instructions on the screen.
Learn more about React Storybook:

* Screencast: [Getting Started with React Storybook](https://egghead.io/lessons/react-getting-started-with-react-storybook)
* [GitHub Repo](https://github.com/kadirahq/react-storybook)
* [Documentation](https://storybooks.js.org/docs/react-storybook/basics/introduction/)
* [Snapshot Testing](https://github.com/kadirahq/storyshots) with React Storybook
-->
* [GitHub Repo](https://github.com/storybooks/storybook)
* [Documentation](https://storybook.js.org/basics/introduction/)
* [Snapshot Testing UI](https://github.com/storybooks/storybook/tree/master/addons/storyshots) with Storybook + addon/storyshot

## Making a Progressive Web App

Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/template/src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import './index.css';

ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();

0 comments on commit 16c642e

Please sign in to comment.