Skip to content

Commit 5a2c460

Browse files
authored
New README
1 parent ba90df1 commit 5a2c460

File tree

1 file changed

+64
-50
lines changed

1 file changed

+64
-50
lines changed

README.md

Lines changed: 64 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,103 @@
1+
12
# Create React App
23

3-
A new blessed “getting started” experience for building SPAs in React that we can actually ship.
4+
Create React apps with no build configuration.
45

5-
## Goal
6+
* **One Dependency:** Once you create an app, there is just one build dependency. Internally we use Webpack, Babel, ESLint, and other amazing projects, but we manage their versions and provide a curated experience on top of them.
67

7-
Make it easy to get started with React.
8+
* **Zero Configuration:** There are no configuration files or command line options. Let us take care of configuring the build both for development and production so you can focus on creating an app.
89

9-
## Why This Won't Fail
10+
* **No Lock-In:** You can “graduate” to a custom setup at any time. Run a single command, and we will remove the tool and copy all the configuration and dependencies into your project, so you can pick up where we left off.
1011

11-
* We hide a small curated set of tools behind a CLI with zero configuration. The scope is very limited: we intentionally offer the minimal tools we think are useful, and we don't allow any addons or feature creep.
12-
* We let you exit the "getting started" experience at any time. A single CLI command removes the dependency on React CLI and replaces it with real Webpack/ESLint/Babel configs and commands. You are on your own now.
13-
* We promote the hell out of it on in the docs. This is built by the team so people trust it.
12+
## Installation
1413

15-
## Philosophy
14+
Install it once globally:
1615

17-
### Zero Configuration
16+
```sh
17+
npm install -g create-react-app
18+
```
1819

19-
This is a hard constraint. We are committed to having zero configuration in the project.
20+
## Usage
2021

21-
If you use `create-react-app`, you should have `src/index.js`, your bundle will be compiled to `build/index.html`, and it will run at http://localhost:3000 in development. You can’t change this.
22+
To create a new app, run:
2223

23-
It will have Babel, ESLint, Autprefixr and some other stuff we think it useful for getting started, but you won’t be exposed to it, and won’t be able to configure it. We curate the setup completely.
24+
```sh
25+
create-react-app my-app
26+
cd my-app
27+
```
2428

25-
### Exit Strategy
29+
This will create a directory called `my-app` inside the current folder.
2630

27-
You can say goodbye to `create-react-app` at any time. Type `npm run export-scripts`, and it will create the configs and replace the generated `scripts` in `package.json` with the equivalent "real thing" (e.g. `webpack-dev-server` and `webpack` calls). You're on your own now.
31+
Inside that directory, we will generate the initial project structure and install the transient dependencies.
32+
Once it’s finished, you can run some commands inside the project folder!
2833

29-
This is why "zero configuration" can work as a constraint. We can punt on many real-world features (code splitting, Google Analytics, custom Babel plugins) because we let you leave the "getting started" experience any time.
34+
### `npm start`
3035

31-
This makes Create React App a feasible way to get started with a "real" React project without learning the tools. Once you export, you can't go back.
36+
Runs the app in the development mode.
37+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
3238

33-
### One Dependency
39+
The page will reload if you make edits.
40+
You will also see any lint errors in the console.
3441

35-
It works like `react-native-cli`. There is just one thing in your `devDependencies`, and it hides Babel, ESLint, and all the other stuff. But as I wrote above, you can `npm run exports-scripts` at any time.
42+
### `npm run build`
3643

37-
## How to use
44+
Builds the app for production to the `build` folder.
45+
It correctly bundles React in production mode and optimizes the build for the best performance.
3846

39-
Install once:
47+
The build is minified and the filenames include the hashes.
48+
Your app is ready to be deployed!
4049

41-
```bash
42-
npm install -g create-react-app
43-
```
50+
### `npm run graduate`
4451

45-
When creating a new app:
52+
**Note: this is a one-way operation. Once you “graduate”, you can’t go back!**
4653

47-
```
48-
create-react-app my-app
49-
cd my-app
50-
npm start
51-
```
54+
If you aren’t satisfied with the defaults we provide, and want to change or extend your build configuration, you can graduate at any time. This command will remove the single build dependency we provided from your project.
5255

53-
Done!
56+
Instead, it will copy all the configuration files and the dependencies we have been using under the hood into your project so you have full control over them. All of the commands except `graduate` will still work, but we will point them to the copied scripts so you can tweak them. At this point you’re on your own.
5457

55-
If you want to build it for production
58+
You don’t have to ever graduate. We intend to keep the curated feature set suitable for small and middle deployments, and you shouldn’t feel obliged to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
5659

57-
```
58-
npm run build
59-
```
60+
## Limitations
6061

61-
and if you want to tweak it
62+
We don’t currently intend to support advanced features such as server rendering, experimental Babel plugins, custom ESLint configuration, etc. Our goal is to provide a tool that bootstraps a minimal production-ready React project with a great developer experience and sane defaults. If you want an advanced feature, you can still use this tool, and later run `npm run graduate` to customize the experience (but then there’s no going back!)
6263

63-
```
64-
npm run exports-scripts # Beware, this is a one-way operation, can't go back!
65-
```
64+
## What’s Inside?
6665

67-
## How to develop it
66+
The tools used by Create React App are subject to change.
67+
Currently we use:
6868

69-
You first need to
69+
* [webpack](https://webpack.github.io/)
70+
* [webpack-dev-server](https://github.com/webpack/webpack-dev-server)
71+
* [Babel](http://babeljs.io/) with [preset-es2015](https://www.npmjs.com/package/babel-preset-es2015), [preset-es2016](https://www.npmjs.com/package/babel-preset-es2016) and [transform-rest-spread](https://babeljs.io/docs/plugins/transform-object-rest-spread/)
72+
* [Autoprefixer](https://github.com/postcss/autoprefixer)
73+
* [html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin)
74+
* [style-loader](https://github.com/webpack/style-loader)
75+
* [ESLint](http://eslint.org/)
76+
* [eslint-config-airbnb](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb)
77+
* and some more.
7078

71-
```
72-
npm install
73-
```
79+
We hide all of them behind our npm package so you don’t need to worry about upgrading them or solving conflicts.
7480

75-
Once it is done, you can modify any file locally and do
81+
## You Don’t Have to Use This
7682

77-
```
78-
npm start
79-
npm run build
80-
```
83+
This is not the “one true way” to create React apps. You don’t need to port your project to use this if you’re happy with your setup. There are also many things we won’t provide (see “Limitations” above).
84+
85+
Historically we’ve made it easy to gradually adopt React, but many people create new single-page React apps every day, and we’ve heard [loud and clear](https://medium.com/@ericclemmons/javascript-fatigue-48d4011b6fc4) that this process can be error-prone and tedious, especially if this is your first JavaScript build stack.
86+
87+
This project is our attempt to figure out a good way to start developing React apps. We don’t claim it’s the best possible stack, and there are intentional limitations, but we think you can ship a production app with it, and we’ll make it even better over time.
88+
89+
We also want you to feel in control so you can “graduate” from this tool at any time (see instructions above!).
90+
91+
## Contibuting
92+
93+
Clone the repo and run `npm install`.
8194

82-
If you want to try out the end to end flow with the global cli
95+
Once it is done, you can modify any file locally and run `npm start` or `npm run build` just like in a generated project.
96+
If you want to try out the end-to-end flow with the global CLI, you can do this too:
8397

8498
```
8599
npm run create-react-app my-app
86100
cd my-app
87-
npm run
88101
```
89102

103+
and then run `npm start` or `npm run build`.

0 commit comments

Comments
 (0)