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

Facebook 1.0.10 #104

Merged
merged 98 commits into from
Aug 7, 2017
Merged
Changes from 1 commit
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
6a48c7c
Print file sizes with correct build folder path. (#2361)
fezhengjin May 25, 2017
a3b4de1
Update README.md for `now` deployments (#2372)
purplecones May 26, 2017
bfeb950
Removed the overriding of reduce_vars to false since webpack v2.6.0 i…
Zaccc123 May 27, 2017
9114aea
Disable comparisons feature in uglify compression in production (#2379)
davidascher May 27, 2017
993fd30
Consistently set environment variables (#2382)
gaearon May 27, 2017
a9e9921
Update webpack to 2.6.1 (#2383)
gaearon May 27, 2017
9b4c53e
Add changelog for 1.0.7 (#2384)
gaearon May 27, 2017
bef6ec6
Publish
gaearon May 27, 2017
78886fd
Catch "No tests found" during CI (#2387)
EnoahNetzach May 27, 2017
c16a178
Suggest just "yarn build" (#2385)
gaearon May 27, 2017
4a18386
Fix wrong path expansion in end-to-end test (#2388)
gaearon May 27, 2017
55c2cc6
Revert "Catch "No tests found" during CI" (#2390)
gaearon May 27, 2017
e447c79
Fix kill command in e2e-kitchensink.sh cleanup (#2397)
ro-savage May 29, 2017
57095b4
Added cache clear to e2e scripts (#2400)
ro-savage May 29, 2017
4c80b02
Fix detection of parent directory in ModuleScopePlugin (#2405)
May 29, 2017
3d6ead5
docs: update `jest-enzyme` section (#2392)
luftywiranda13 May 29, 2017
1cb5fbb
Add WebStorm >2017 launchEditor Support (#2414)
wirmar May 30, 2017
a537444
Fix docs typo (#2420)
ruskakimov May 31, 2017
c7f79f7
Update Travis CI Node versions in User Guide (#2454)
ryansully Jun 2, 2017
864ef28
re-add storybook && update the documentation and links (#2331)
ndelangen Jun 4, 2017
ad5b884
Prioritize index.css over the implicit App.css (#2470)
bryankang Jun 5, 2017
e9f1371
Added NamedModulesPlugin in webpack.config.dev.js (#2458)
Zaccc123 Jun 6, 2017
349caa4
Unscope detect-port (#2483)
Timer Jun 6, 2017
8a59fe6
Update webpack links to point to webpack 2 (#2492)
Jun 7, 2017
2b79b46
chore(templates): Move GitHub templates to hidden .github folder (#2489)
glennreyes Jun 7, 2017
89b42aa
Fix minor docs typo (#2500)
AlexxNica Jun 8, 2017
19c7bf7
Fix link to Storybook docs (#2521)
shilman Jun 12, 2017
733a177
Simplify flow init docs (#2522)
khanglu Jun 12, 2017
64b69b4
Upgrade fsevents to 1.1.2 (#2550)
josephfrazier Jun 18, 2017
e1f7da4
Fix broken link to React Router docs (#2538)
romanyanke Jun 18, 2017
4aa42e2
Fix wrong comment on Proxy guide (#2447)
hellowin Jun 18, 2017
d68ed30
Show warning when trying to run on port below 1024 without admin perm…
levrik Jun 19, 2017
1f4db46
Check if CI variable is set to `'false'` (#2501)
varnav Jun 19, 2017
96709b7
Fix a potential issue (#2569)
Timer Jun 19, 2017
d76b7bd
Warn about npm 5 in issue template
gaearon Jun 23, 2017
b2c89d3
Update issue & PR templates (#2618)
gaearon Jun 26, 2017
fbdb0dc
Whitespace
gaearon Jun 26, 2017
6f2db44
Update ISSUE_TEMPLATE.md
gaearon Jun 26, 2017
c3b74f5
Update ISSUE_TEMPLATE.md
gaearon Jun 26, 2017
015ca60
Update ISSUE_TEMPLATE.md
gaearon Jun 26, 2017
b68c39e
Support PhpStorm in launchEditor (#2622)
Jun 26, 2017
ec0f811
Add empty mock for dgram (#2600)
micopiira Jun 26, 2017
936fb90
Docs: Added link to tutorial on code splitting (#2427)
jayair Jun 26, 2017
3d6ebe7
Update sw-precache-webpack-plugin to lastest version (#2429)
goldhand Jun 26, 2017
3fa1499
Determines whether PUBLIC_URL is same-origin before registering SW. (…
jeffposnick Jun 26, 2017
e12710b
webpack no need for `ident` if using complex options anymore (#2430)
andykenward Jun 26, 2017
408ba25
add docs for setting up CircleCI for CRA (#2423)
knowbody Jun 26, 2017
4a6c5b4
E2E testing enhancements (#2408)
EnoahNetzach Jun 26, 2017
d69e441
Use Babel compact mode in production (#2389)
gaearon Jun 26, 2017
6d42a3c
turn on ascii_only for issue with emoji and regex (#2596)
viankakrisna Jun 27, 2017
d585b5a
add check to filter out custom scripts in eject command (#2562)
paweljedrzejczyk Jun 27, 2017
7478e24
Don't run yarn after ejecting (#2634)
gaearon Jun 27, 2017
88e03ce
Set npm loglevel to 'error' (#2635)
gaearon Jun 27, 2017
b9cbf5c
Auto-detect running editor on Windows for error overlay (#2552)
levrik Jun 27, 2017
2a4fe99
docs: added REACT_EDITOR to `Advanced Configuration` section (#2445)
wirmar Jun 27, 2017
03039aa
Fix sourcemap directory organizing on Windows (#2456) (#2610)
pluscubed Jun 27, 2017
dd4ad7d
Add simplified service worker invalidation (#2551)
ro-savage Jun 27, 2017
2bd9c8b
Add yarn example under "Installing a Dependency" (#2362)
Jun 27, 2017
9fc3780
Update docs with WebSocket proxy information (#2305)
jamesblight Jun 27, 2017
330f480
Add more info about OOM build failiure [docs] (#2060)
GAumala Jun 27, 2017
9e2c334
Update README.md (#1813)
iheng Jun 27, 2017
0cda9ee
Fix CLI grammar (#1945)
ColinEberhardt Jun 27, 2017
6d87749
Added instruction on how to install Prettier (#2006)
MrHus Jun 27, 2017
7d8c31b
Less passive-aggressive issue template
gaearon Jun 27, 2017
ae62952
Add Brackets to launchEditor.js (#2637)
petetnt Jun 27, 2017
b73d693
Update ISSUE_TEMPLATE.md (#2643)
ashtonsix Jun 27, 2017
a3fc196
Add React Styleguidist (#2044)
sapegin Jun 27, 2017
4e3e06b
Ignore "Skipping static resource" message from SW precache (#2645)
gaearon Jun 27, 2017
6f4c696
Add instructions to use source-map-explorer (#1641)
colingalindo Jun 27, 2017
a9c8b81
Warn about large bundle sizes (#2648)
gaearon Jun 27, 2017
8536426
Put react-scripts in dependencies, not devDependencies (#2657)
gaearon Jun 28, 2017
a7efc39
Don't ask to install webpack for using Styleguidist (#2656)
gaearon Jun 28, 2017
9e64ca3
Minor code style edits to user guide (#2660)
gaearon Jun 28, 2017
55df6e1
Bump dependencies (#2658)
gaearon Jun 28, 2017
e8e2926
Better React Native Web support (#2511)
mini-eggs Jun 28, 2017
8aca5fd
Local testing docker links (#2662)
EnoahNetzach Jun 28, 2017
25ca9ac
Update ISSUE_TEMPLATE.md
gaearon Jun 28, 2017
10bd98c
Reformat source code with Prettier 1.5.2
gaearon Jun 28, 2017
45cb6fd
Changelog for 1.0.8 (#2664)
gaearon Jun 28, 2017
8d156ed
Publish
gaearon Jun 28, 2017
6bf95f2
Add a note about fixed vulnerability in 1.0.8
gaearon Jun 28, 2017
22a9503
Add json and css to lint-staged in template README (#2671)
jbovenschen Jun 28, 2017
3ad87f7
Test Node 8 on Travis (#2659)
gaearon Jun 28, 2017
6cafdfc
Add more info about apache client side routing (#2666)
viankakrisna Jun 29, 2017
03a52d4
Bootstrap with Yarn when available (#2673)
Timer Jun 29, 2017
a720aa0
Fix minor typo (#2679)
dbanck Jun 29, 2017
761fe6f
Fix external CSS imports (#2680)
gaearon Jun 29, 2017
d5da1e8
Changelog for 1.0.9 (#2682)
gaearon Jun 29, 2017
ed23d62
Fix typo in README link (#2684)
ForbesLindesay Jun 29, 2017
7db4e87
Fix typo (#2683)
BenBrostoff Jun 29, 2017
3bc8dcd
Downgrade `strip-ansi` package to 3.0.1 (#2692)
pdhoopr Jun 29, 2017
07347f2
Upgrade flow (#2693)
Timer Jun 29, 2017
d6025a3
Update CHANGELOG.md
gaearon Jun 29, 2017
4d9c829
Changelog for 1.0.10 (#2694)
gaearon Jun 29, 2017
7014aed
Fix Code Review
Jul 11, 2017
f2a5c5f
Fix tslint
Jul 11, 2017
4dad65c
Default to empty string for PUBLIC_URL
wmonk Aug 7, 2017
3afca81
! PUBLIC_URL
wmonk Aug 7, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Minor code style edits to user guide (#2660)
* Minor code style edits to user guide

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md
  • Loading branch information
gaearon authored and wmonk committed Aug 7, 2017
commit 9e64ca399999c0707311d260d9c4d8dd89fef5d8
187 changes: 125 additions & 62 deletions packages/react-scripts/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,14 @@ Prettier is an opinionated JavaScript formatter. With Prettier you can format th

To format our code whenever we make a commit in git, we need to install the following dependencies:

```
npm install --save-dev husky lint-staged prettier
```sh
npm install --save husky lint-staged prettier
```

or if you use Yarn:
Alternatively you may use `yarn`:

```
yarn add --dev husky lint-staged prettier
```sh
yarn add husky lint-staged prettier
```

* `husky` makes it easy to use githooks as if they are npm scripts.
Expand All @@ -293,29 +293,26 @@ Now we can make sure every file is formatted correctly by adding a few lines to

Add the following line to `scripts` section:

```js
{
// ...
```diff
"scripts": {
// ...
"precommit": "lint-staged"
},
// ...
}
+ "precommit": "lint-staged",
"start": "react-scripts start",
"build": "react-scripts build",
```

Next we add a 'lint-staged' field to the `package.json`, for example:

```js
{
// ...
"lint-staged": {
"src/**/*.{js,jsx}": [
"prettier --single-quote --write",
"git add"
]
}
}
```diff
"dependencies": {
// ...
},
+ "lint-staged": {
+ "src/**/*.{js,jsx}": [
+ "prettier --single-quote --write",
+ "git add"
+ ]
+ },
"scripts": {
```

Now, whenever you make a commit, Prettier will format the changed files automatically. You can also run `./node_modules/.bin/prettier --single-quote --write "src/**/*.{js,jsx}"` to format your entire project for the first time.
Expand All @@ -336,15 +333,17 @@ If you use a custom server for your app in production and want to modify the tit

The generated project includes React and ReactDOM as dependencies. It also includes a set of scripts used by Create React App as a development dependency. You may install other dependencies (for example, React Router) with `npm`:

```
npm install --save <library-name>
```sh
npm install --save react-router
```

Alternatively you may also use `yarn`:
Alternatively you may use `yarn`:

```sh
yarn add react-router
```
yarn add <library-name>
```

This works for any library, not just `react-router`.

## Importing a Component

Expand Down Expand Up @@ -519,9 +518,16 @@ Following this rule often makes CSS preprocessors less useful, as features like

First, let’s install the command-line interface for Sass:

```sh
npm install --save node-sass-chokidar
```
npm install node-sass-chokidar --save-dev

Alternatively you may use `yarn`:

```sh
yarn add node-sass-chokidar
```

Then in `package.json`, add the following lines to `scripts`:

```diff
Expand Down Expand Up @@ -557,8 +563,14 @@ At this point you might want to remove all CSS files from the source control, an

As a final step, you may find it convenient to run `watch-css` automatically with `npm start`, and run `build-css` as a part of `npm run build`. You can use the `&&` operator to execute two scripts sequentially. However, there is no cross-platform way to run two scripts in parallel, so we will install a package for this:

```sh
npm install --save npm-run-all
```
npm install --save-dev npm-run-all

Alternatively you may use `yarn`:

```sh
yarn add npm-run-all
```

Then we can change `start` and `build` scripts to include the CSS preprocessor commands:
Expand Down Expand Up @@ -716,9 +728,14 @@ You don’t have to use [React Bootstrap](https://react-bootstrap.github.io) tog

Install React Bootstrap and Bootstrap from npm. React Bootstrap does not include Bootstrap CSS so this needs to be installed as well:

```sh
npm install --save react-bootstrap bootstrap@3
```
npm install react-bootstrap --save
npm install bootstrap@3 --save

Alternatively you may use `yarn`:

```sh
yarn add react-bootstrap bootstrap@3
```

Import Bootstrap CSS and optionally Bootstrap theme CSS in the beginning of your ```src/index.js``` file:
Expand Down Expand Up @@ -757,7 +774,7 @@ Recent versions of [Flow](http://flowtype.org/) work with Create React App proje

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`).
1. Run `npm install --save flow-bin` (or `yarn add 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.
4. Add `// @flow` to any files you want to type check (for example, to `src/App.js`).
Expand Down Expand Up @@ -1226,12 +1243,20 @@ This test mounts a component and makes sure that it didn’t throw during render

When you encounter bugs caused by changing components, you will gain a deeper insight into which parts of them are worth testing in your application. This might be a good time to introduce more specific tests asserting specific expected output or behavior.

If you’d like to test components in isolation from the child components they render, we recommend using [`shallow()` rendering API](http://airbnb.io/enzyme/docs/api/shallow.html) from [Enzyme](http://airbnb.io/enzyme/). You can write a smoke test with it too:
If you’d like to test components in isolation from the child components they render, we recommend using [`shallow()` rendering API](http://airbnb.io/enzyme/docs/api/shallow.html) from [Enzyme](http://airbnb.io/enzyme/). To install it, run:

```sh
npm install --save enzyme react-test-renderer
```

Alternatively you may use `yarn`:

```sh
npm install --save-dev enzyme react-test-renderer
yarn add enzyme react-test-renderer
```

You can write a smoke test with it too:

```js
import React from 'react';
import { shallow } from 'enzyme';
Expand Down Expand Up @@ -1270,18 +1295,24 @@ Additionally, you might find [jest-enzyme](https://github.com/blainekasten/enzym
expect(wrapper).toContainReact(welcome)
```

To setup jest-enzyme with Create React App, follow the instructions for [initializing your test environment](#initializing-test-environment) to import `jest-enzyme`.
To enable this, install `jest-enzyme`:

```sh
npm install --save jest-enzyme
```

Alternatively you may use `yarn`:

```sh
npm install --save-dev jest-enzyme
yarn add jest-enzyme
```

Import it in [`src/setupTests.js`](#initializing-test-environment) to make its matchers available in every test:

```js
// src/setupTests.js
import 'jest-enzyme';
```


### Using Third Party Assertion Libraries

We recommend that you use `expect()` for assertions and `jest.fn()` for spies. If you are having issues with them please [file those against Jest](https://github.com/facebook/jest/issues/new), and we’ll fix them. We intend to keep making them better for React, supporting, for example, [pretty-printing React elements as JSX](https://github.com/facebook/jest/pull/1566).
Expand Down Expand Up @@ -1392,14 +1423,22 @@ The build command will check for linter warnings and fail if any are found.
By default, the `package.json` of the generated project looks like this:

```js
// ...
"scripts": {
// ...
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom"
}
```

If you know that none of your tests depend on [jsdom](https://github.com/tmpvar/jsdom), you can safely remove `--env=jsdom`, and your tests will run faster.<br>
If you know that none of your tests depend on [jsdom](https://github.com/tmpvar/jsdom), you can safely remove `--env=jsdom`, and your tests will run faster:

```diff
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
- "test": "react-scripts test --env=jsdom"
+ "test": "react-scripts test"
```

To help you make up your mind, here is a list of APIs that **need jsdom**:

* Any browser globals like `window` and `document`
Expand Down Expand Up @@ -1473,18 +1512,22 @@ Styleguidist combines of a style guide, where all your components are presented
First, install Styleguidist:

```sh
npm install --save-dev react-styleguidist
npm install --save react-styleguidist
```

Then, add these scripts to your `package.json`:
Alternatively you may use `yarn`:

```sh
{
"scripts": {
"styleguide": "styleguidist server",
"styleguide:build": "styleguidist build"
}
}
yarn add react-styleguidist
```

Then, add these scripts to your `package.json`:

```diff
"scripts": {
+ "styleguide": "styleguidist server",
+ "styleguide:build": "styleguidist build",
"start": "react-scripts start",
```

Then, run the following command inside your app’s directory:
Expand Down Expand Up @@ -1608,21 +1651,36 @@ bloat is coming from.

To add Source map explorer to a Create React App project, follow these steps:

```sh
npm install --save source-map-explorer
```
npm install source-map-explorer --save-dev

Alternatively you may use `yarn`:

```sh
yarn add source-map-explorer
```

Then in `package.json`, add the following line to `scripts`
On Windows you will have to type the full file path out.
Then in `package.json`, add the following line to `scripts`:

```diff
"scripts": {
+ "analyze": "source-map-explorer build/static/js/main.*",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
+ "analyze": "source-map-explorer build/static/js/main.* "
```

>**Note:**
>
>This doesn't quite work on Windows because it doesn't automatically expand `*` in the filepath. For now, the workaround is to look at the full hashed filename in `build/static/js` (e.g. `main.89b7e95a.js`) and copy it into `package.json` when you're running the analyzer. For example:
>
>```diff
>+ "analyze": "source-map-explorer build/static/js/main.89b7e95a.js",
>```
>
>Unfortunately it will be different after every build. You can express support for fixing this on Windows [in this issue](https://github.com/danvk/source-map-explorer/issues/52).

Then to analyze the bundle run the production build then run the analyze
script.

Expand Down Expand Up @@ -1827,18 +1885,23 @@ Now, whenever you run `npm run build`, you will see a cheat sheet with instructi
To publish it at [https://myusername.github.io/my-app](https://myusername.github.io/my-app), run:

```sh
npm install --save-dev gh-pages
npm install --save gh-pages
```

Alternatively you may use `yarn`:

```sh
yarn add gh-pages
```

Add the following scripts in your `package.json`:

```js
// ...
```diff
"scripts": {
// ...
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
}
+ "predeploy": "npm run build",
+ "deploy": "gh-pages -d build",
"start": "react-scripts start",
"build": "react-scripts build",
```

The `predeploy` script will run automatically before `deploy` is run.
Expand Down