Skip to content

Commit cea81d3

Browse files
gaearonPavel Zhytko
authored andcommitted
Rewrite README
1 parent c1f1f11 commit cea81d3

File tree

1 file changed

+26
-72
lines changed

1 file changed

+26
-72
lines changed

README.md

Lines changed: 26 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Create React apps with no build configuration.
44

5-
* [Getting Started](#getting-started) – How to create a new app.
5+
* [Creating an App](#creating-an-app) – How to create a new app.
66
* [User Guide](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md) – How to develop apps bootstrapped with Create React App.
77

88
Create React App works on macOS, Windows, and Linux.<br>
@@ -28,23 +28,17 @@ They are preconfigured and hidden so that you can focus on the code.
2828

2929
Just create a project, and you’re good to go.
3030

31-
## Getting Started
31+
## Creating an App
3232

33-
### Prerequisites
34-
35-
**You’ll need to have Node >= 6 on your machine**. You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to easily switch Node versions between different projects.
36-
37-
**This tool doesn’t assume a Node backend**. The Node installation is only required for Create React App itself.
38-
39-
### Creating an App
33+
**For the build tools, you’ll need to have Node >= 6 on your machine**. You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to easily switch Node versions between different projects. Note that Create React App **works with any backend** because it produces static HTML/JS/CSS bundles.
4034

4135
To create a new app, run a single command:
4236

4337
```sh
4438
npx create-react-app my-app
4539
```
4640

47-
([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))
41+
*([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))*
4842

4943
It will create a directory called `my-app` inside the current folder.<br>
5044
Inside that directory, it will generate the initial project structure and install the transitive dependencies:
@@ -161,59 +155,48 @@ Please refer to the [User Guide](https://github.com/facebookincubator/create-rea
161155

162156
* **No Lock-In:** You can “eject” to a custom setup at any time. Run a single command, and all the configuration and build dependencies will be moved directly into your project, so you can pick up right where you left off.
163157

164-
## Why Use This?
158+
## What’s Included?
165159

166-
**If you’re getting started** with React, use `create-react-app` to automate the build of your app. There is no configuration file, and `react-scripts` is the only extra build dependency in your `package.json`. Your environment will have everything you need to build a modern React app:
160+
Your environment will have everything you need to build a modern single-page React app:
167161

168162
* React, JSX, ES6, and Flow syntax support.
169163
* Language extras beyond ES6 like the object spread operator.
170-
* A dev server that lints for common errors.
171-
* Import CSS and image files directly from JavaScript.
172164
* Autoprefixed CSS, so you don’t need `-webkit` or other prefixes.
173-
* A `build` script to bundle JS, CSS, and images for production, with sourcemaps.
165+
* A fast interactive unit test runner with built-in support for coverage reporting.
166+
* A live development server that warns about common mistakes.
167+
* A build script to bundle JS, CSS, and images for production, with hashes and sourcemaps.
174168
* An offline-first [service worker](https://developers.google.com/web/fundamentals/getting-started/primers/service-workers) and a [web app manifest](https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/), meeting all the [Progressive Web App](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#making-a-progressive-web-app) criteria.
169+
* Hassle-free updates for the above tools with a single dependency.
175170

176-
**The feature set is intentionally limited**. It doesn’t support advanced features such as server rendering or CSS modules. The tool is also **non-configurable** because it is hard to provide a cohesive experience and easy updates across a set of tools when the user can tweak anything.
177-
178-
**You don’t have to use this.** Historically it has been easy to [gradually adopt](https://www.youtube.com/watch?v=BF58ZJ1ZQxY) React. However many people create new single-page React apps from scratch every day. We’ve heard [loud](https://medium.com/@ericclemmons/javascript-fatigue-48d4011b6fc4) and [clear](https://twitter.com/thomasfuchs/status/708675139253174273) that this process can be error-prone and tedious, especially if this is your first JavaScript build stack. This project is an attempt to figure out a good way to start developing React apps.
179-
180-
### Converting to a Custom Setup
171+
Check out [this guide](https://github.com/nitishdayal/cra_closer_look) for an overview of how these tools fit together.
181172

182-
**If you’re a power user** and you aren’t happy with the default configuration, you can eject” from the tool and use it as a boilerplate generator.
173+
The tradeoff is that **these tools are preconfigured to work in a specific way**. If your project needs more customization, you can ["eject"](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-eject) and customize it, but then you will need to maintain this configuration.
183174

184-
Running `npm run eject` copies all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. Commands like `npm start` and `npm run build` will still work, but they will point to the copied scripts so you can tweak them. At this point, you’re on your own.
175+
## Popular Alternatives
185176

186-
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
177+
This project is a great fit for:
187178

188-
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated 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.
179+
* Learning React in a comfortable and feature-rich development environment.
180+
* Starting new single-page React applications.
181+
* Creating examples with React for your library.
189182

190-
## Limitations
183+
Here’s a few common cases where you might want to try something else:
191184

192-
Some features are currently **not supported**:
185+
* If you want to **try React** without installing hundreds of `node_modules`, consider [using a single HTML file or an online sandbox instead](https://reactjs.org/docs/try-react.html).
193186

194-
* Server rendering.
195-
* Some experimental syntax extensions (e.g. decorators).
196-
* CSS Modules (see [#2285](https://github.com/facebookincubator/create-react-app/pull/2285)).
197-
* Importing LESS or Sass directly ([but you still can use them](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-a-css-preprocessor-sass-less-etc)).
198-
* Hot reloading of components.
187+
* Maybe you are **not building a single-page application** and need to integrate your React code with an existing template-based server framework such as Rails or Django. In this case, consider using projects like [nwb](https://github.com/insin/nwb) or [Neutrino](https://neutrino.js.org/) which are more flexible.
199188

200-
Some of them might get added in the future if they are stable, are useful to majority of React apps, don’t conflict with existing tools, and don’t introduce additional configuration.
189+
* If you need to **publish a React component**, [nwb](https://github.com/insin/nwb) can [also do this](https://github.com/insin/nwb#react-components-and-libraries).
201190

202-
## What’s Inside?
191+
* If you want to do **server rendering** with React, check out [Next.js](https://github.com/zeit/next.js/) or [Razzle](https://github.com/jaredpalmer/razzle). Create React App is agnostic of the backend, and just produces static HTML/JS/CSS bundles.
203192

204-
The tools used by Create React App are subject to change.
205-
Currently it is a thin layer on top of many amazing community projects, such as:
193+
* If your website is **mostly static** (for example, a portfolio or a blog), consider using [Gatsby](https://www.gatsbyjs.org/) instead. Unlike Create React App, it pre-renders the website into HTML at the build time.
206194

207-
* [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)
208-
* [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))
209-
* [Autoprefixer](https://github.com/postcss/autoprefixer)
210-
* [ESLint](http://eslint.org/)
211-
* [Jest](http://facebook.github.io/jest)
212-
* and others.
195+
* Finally, if you need **more customization**, check out [Neutrino](https://neutrino.js.org/) and its [React preset](https://neutrino.js.org/packages/react/).
213196

214-
All of them are transitive dependencies of the provided npm package.
197+
All of the above tools can work with little to no configuration.
215198

216-
Check out [this guide](https://github.com/nitishdayal/cra_closer_look) for an overview of how these tools fit together.
199+
If you prefer configuring the build yourself, [follow this guide](https://reactjs.org/docs/add-react-to-an-existing-app.html).
217200

218201
## Contributing
219202

@@ -231,32 +214,3 @@ We are grateful to the authors of existing related projects for their ideas and
231214
* [@eanplatter](https://github.com/eanplatter)
232215
* [@insin](https://github.com/insin)
233216
* [@mxstbr](https://github.com/mxstbr)
234-
235-
## Alternatives
236-
237-
If you don’t agree with the choices made in this project, you might want to explore alternatives with different tradeoffs.<br>
238-
Some of the more popular and actively maintained ones are:
239-
240-
* [insin/nwb](https://github.com/insin/nwb)
241-
* [mozilla-neutrino/neutrino-dev](https://github.com/mozilla-neutrino/neutrino-dev)
242-
* [jaredpalmer/razzle](https://github.com/jaredpalmer/razzle)
243-
* [NYTimes/kyt](https://github.com/NYTimes/kyt)
244-
* [zeit/next.js](https://github.com/zeit/next.js)
245-
* [gatsbyjs/gatsby](https://github.com/gatsbyjs/gatsby)
246-
* [electrode-io/electrode](https://github.com/electrode-io/electrode)
247-
248-
Notable alternatives also include:
249-
250-
* [enclave](https://github.com/eanplatter/enclave)
251-
* [motion](https://github.com/steelbrain/pundle/tree/master/packages/motion)
252-
* [quik](https://github.com/satya164/quik)
253-
* [sagui](https://github.com/saguijs/sagui)
254-
* [roc](https://github.com/rocjs/roc)
255-
* [aik](https://github.com/d4rkr00t/aik)
256-
* [react-app](https://github.com/kriasoft/react-app)
257-
* [dev-toolkit](https://github.com/stoikerty/dev-toolkit)
258-
* [sku](https://github.com/seek-oss/sku)
259-
* [gluestick](https://github.com/TrueCar/gluestick)
260-
261-
You can also use module bundlers like [webpack](http://webpack.js.org) and [Browserify](http://browserify.org/) directly.<br>
262-
React documentation includes [a walkthrough](https://reactjs.org/docs/installation.html#development-and-production-versions) on this topic.

0 commit comments

Comments
 (0)