Skip to content

Commit 16c642e

Browse files
backstroke-botpaweljedrzejczyk
authored andcommitted
Update from upstream repo facebookincubator/create-react-app (#1)
* 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`
1 parent 89361b5 commit 16c642e

File tree

8 files changed

+20
-20
lines changed

8 files changed

+20
-20
lines changed
File renamed without changes.
File renamed without changes.

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Some of them might get added in the future if they are stable, are useful to maj
199199
The tools used by Create React App are subject to change.
200200
Currently it is a thin layer on top of many amazing community projects, such as:
201201

202-
* [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)
202+
* [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)
203203
* [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))
204204
* [Autoprefixer](https://github.com/postcss/autoprefixer)
205205
* [ESLint](http://eslint.org/)
@@ -248,5 +248,5 @@ Notable alternatives also include:
248248
* [dev-toolkit](https://github.com/stoikerty/dev-toolkit)
249249
* [sku](https://github.com/seek-oss/sku)
250250

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

packages/react-dev-utils/WebpackDevServerUtils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const fs = require('fs');
1313
const path = require('path');
1414
const url = require('url');
1515
const chalk = require('chalk');
16-
const detect = require('@timer/detect-port');
16+
const detect = require('detect-port-alt');
1717
const inquirer = require('inquirer');
1818
const clearConsole = require('./clearConsole');
1919
const formatWebpackMessages = require('./formatWebpackMessages');

packages/react-dev-utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333
"webpackHotDevClient.js"
3434
],
3535
"dependencies": {
36-
"@timer/detect-port": "1.1.3",
3736
"address": "1.0.1",
3837
"anser": "1.3.0",
3938
"babel-code-frame": "6.22.0",
4039
"chalk": "1.1.3",
4140
"cross-spawn": "4.0.2",
41+
"detect-port-alt": "1.1.3",
4242
"escape-string-regexp": "1.0.5",
4343
"filesize": "3.3.0",
4444
"gzip-size": "3.0.0",

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

+2
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ module.exports = {
249249
inject: true,
250250
template: paths.appHtml,
251251
}),
252+
// Add module names to factory functions so they appear in browser profiler.
253+
new webpack.NamedModulesPlugin(),
252254
// Makes some environment variables available to the JS code, for example:
253255
// if (process.env.NODE_ENV === 'development') { ... }. See `./env.js`.
254256
new webpack.DefinePlugin(env.stringified),

packages/react-scripts/template/README.md

+13-15
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ To add Flow to a Create React App project, follow these steps:
690690

691691
1. Run `npm install --save-dev flow-bin` (or `yarn add --dev flow-bin`).
692692
2. Add `"flow": "flow"` to the `scripts` section of your `package.json`.
693-
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.
693+
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.
694694
4. Add `// @flow` to any files you want to type check (for example, to `src/App.js`).
695695

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

10831083
### Version Control Integration
10841084

1085-
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.
1085+
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.
10861086

10871087
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.
10881088

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

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

1325-
<!--
13261324
## Developing Components in Isolation
13271325

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

1331-
* With a text label.
1332-
* With an emoji.
1329+
* In a regular state, with a text label.
13331330
* In the disabled mode.
1331+
* In a loading state.
13341332

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

1337-
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**.
1335+
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**.
13381336

1339-
![React Storybook Demo](http://i.imgur.com/7CIAWpB.gif)
1337+
![Storybook for React Demo](http://i.imgur.com/7CIAWpB.gif)
13401338

1341-
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.
1339+
A storybook can also be deployed as a static app.
1340+
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.
13421341

1343-
**Here’s how to setup your app with Storybook:**
1342+
### Setup your app with Storybook
13441343

13451344
First, install the following npm package globally:
13461345

13471346
```sh
1348-
npm install -g getstorybook
1347+
npm install -g @storybook/cli
13491348
```
13501349

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

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

13671365
## Making a Progressive Web App
13681366

Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3+
import './index.css';
34
import App from './App';
45
import registerServiceWorker from './registerServiceWorker';
5-
import './index.css';
66

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

0 commit comments

Comments
 (0)