Skip to content

Commit 96f7f29

Browse files
committed
Clarify installation instructions
The previous instructions may have come across that the only way to use Redux with npm was with a module bundler, like Browserify or Webpack. This reorganizes the text in an effort to more explicitly explain that it's only the extensions require a CJS module bundler.
1 parent 891a97c commit 96f7f29

File tree

1 file changed

+43
-21
lines changed

1 file changed

+43
-21
lines changed

README.md

+43-21
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# [Redux](http://rackt.github.io/redux)
22

3-
Redux is a predictable state container for JavaScript apps.
3+
Redux is a predictable state container for JavaScript apps.
44

55
It helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test. On top of that, it provides a great developer experience, such as [live code editing combined with a time traveling debugger](https://github.com/gaearon/redux-devtools).
66

7-
You can use Redux together with [React](https://facebook.github.io/react/), or with any other view library.
7+
You can use Redux together with [React](https://facebook.github.io/react/), or with any other view library.
88
It is tiny (2kB) and has no dependencies.
99

1010
[![build status](https://img.shields.io/travis/rackt/redux/master.svg?style=flat-square)](https://travis-ci.org/rackt/redux)
@@ -14,18 +14,18 @@ It is tiny (2kB) and has no dependencies.
1414
[![#rackt on freenode](https://img.shields.io/badge/irc-%23rackt%20%40%20freenode-61DAFB.svg?style=flat-square)](https://webchat.freenode.net/)
1515
[![Changelog #187](https://img.shields.io/badge/changelog-%23187-lightgrey.svg?style=flat-square)](https://changelog.com/187)
1616

17-
>**New! Learn Redux from its creator:
17+
>**New! Learn Redux from its creator:
1818
>[Getting Started with Redux](https://egghead.io/series/getting-started-with-redux) (30 free videos)**
1919
2020
### Testimonials
2121

22-
>[“Love what you’re doing with Redux”](https://twitter.com/jingc/status/616608251463909376)
22+
>[“Love what you’re doing with Redux”](https://twitter.com/jingc/status/616608251463909376)
2323
>Jing Chen, creator of Flux
2424
25-
>[“I asked for comments on Redux in FB's internal JS discussion group, and it was universally praised. Really awesome work.”](https://twitter.com/fisherwebdev/status/616286955693682688)
25+
>[“I asked for comments on Redux in FB's internal JS discussion group, and it was universally praised. Really awesome work.”](https://twitter.com/fisherwebdev/status/616286955693682688)
2626
>Bill Fisher, author of Flux documentation
2727
28-
>[“It's cool that you are inventing a better Flux by not doing Flux at all.”](https://twitter.com/andrestaltz/status/616271392930201604)
28+
>[“It's cool that you are inventing a better Flux by not doing Flux at all.”](https://twitter.com/andrestaltz/status/616271392930201604)
2929
>André Staltz, creator of Cycle
3030
3131
### Developer Experience
@@ -34,7 +34,7 @@ I wrote Redux while working on my React Europe talk called [“Hot Reloading wit
3434

3535
### Influences
3636

37-
Redux evolves the ideas of [Flux](http://facebook.github.io/flux/), but avoids its complexity by taking cues from [Elm](https://github.com/evancz/elm-architecture-tutorial/).
37+
Redux evolves the ideas of [Flux](http://facebook.github.io/flux/), but avoids its complexity by taking cues from [Elm](https://github.com/evancz/elm-architecture-tutorial/).
3838
Whether you have used them or not, Redux only takes a few minutes to get started with.
3939

4040
### Installation
@@ -45,21 +45,43 @@ To install the stable version:
4545
npm install --save redux
4646
```
4747

48-
Most likely, you’ll also need [the React bindings](https://github.com/rackt/react-redux) and [the developer tools](https://github.com/gaearon/redux-devtools).
48+
This requires using the [npm](https://www.npmjs.com/) package manager. It includes a [UMD](https://github.com/umdjs/umd) build, which is compatible with many popular JavaScript module loaders and environments.
49+
50+
#### Other Installation Methods
51+
52+
We **strongly** recommend using npm over these other options, as most of [the libraries complementary to Redux](#complementary-libraries) are only available on [npm](https://www.npmjs.com/).
53+
54+
However, if you don’t yet use [npm](https://www.npmjs.com/) or a modern module bundler, you have a few options.
55+
56+
##### Bower
57+
58+
If you're using Bower, this command will install the stable version of Redux:
59+
60+
```
61+
bower install redux=https://npmcdn.com/redux/dist/redux.js
62+
```
63+
64+
#### CDN
65+
66+
Redux is available via [cdnjs](https://cdnjs.com/libraries/redux) and [npmcdn](https://npmcdn.com/redux/dist/redux.min.js). The files on these CDNs are UMD builds, which means that they will export a browser global, `window.redux`, if you're not using a tool like Webpack, Browserify, or RequireJS to build your library.
67+
68+
An example of using the global Redux object can be seen in [the vanilla counter example](https://github.com/rackt/redux/blob/765a3a5742a591adba7ae8b61e0516c49ca594bd/examples/counter-vanilla/index.html).
69+
70+
#### Complementary Libraries
71+
72+
Most likely, you’ll also need [the React bindings](https://github.com/rackt/react-redux) and [the developer tools](https://github.com/gaearon/redux-devtools) while working with Redux.
4973

5074
```
5175
npm install --save react-redux
5276
npm install --save-dev redux-devtools
5377
```
5478

55-
This assumes that you’re using [npm](https://www.npmjs.com/) package manager with a module bundler like [Webpack](http://webpack.github.io) or [Browserify](http://browserify.org/) to consume [CommonJS modules](http://webpack.github.io/docs/commonjs.html).
56-
57-
If you don’t yet use [npm](https://www.npmjs.com/) or a modern module bundler, and would rather prefer a single-file [UMD](https://github.com/umdjs/umd) build that makes `Redux` available as a global object, you can grab a pre-built version from [cdnjs](https://cdnjs.com/libraries/redux). We *don’t* recommend this approach for any serious application, as most of the libraries complementary to Redux are only available on [npm](https://www.npmjs.com/).
79+
Use of the extensions requires that you’re using [npm](https://www.npmjs.com/) in conjunction with a module bundler like [Webpack](http://webpack.github.io) or [Browserify](http://browserify.org/) to consume [CommonJS modules](http://webpack.github.io/docs/commonjs.html).
5880

5981
### The Gist
6082

61-
The whole state of your app is stored in an object tree inside a single *store*.
62-
The only way to change the state tree is to emit an *action*, an object describing what happened.
83+
The whole state of your app is stored in an object tree inside a single *store*.
84+
The only way to change the state tree is to emit an *action*, an object describing what happened.
6385
To specify how the actions transform the state tree, you write pure *reducers*.
6486

6587
That’s it!
@@ -118,24 +140,24 @@ This architecture might seem like an overkill for a counter app, but the beauty
118140

119141
[Getting Started with Redux](https://egghead.io/series/getting-started-with-redux) is a video course consisting of 30 videos narrated by Dan Abramov, author of Redux. It is designed to complement the “Basics” part of the docs while bringing additional insights about immutability, testing, Redux best practices, and using Redux with React. **This course is free and will always be.**
120142

121-
>[“Great course on egghead.io by @dan_abramov - instead of just showing you how to use #redux, it also shows how and why redux was built!”](https://twitter.com/sandrinodm/status/670548531422326785)
143+
>[“Great course on egghead.io by @dan_abramov - instead of just showing you how to use #redux, it also shows how and why redux was built!”](https://twitter.com/sandrinodm/status/670548531422326785)
122144
>Sandrino Di Mattia
123145
124-
>[“Plowing through @dan_abramov 'Getting Started with Redux' - its amazing how much simpler concepts get with video.”](https://twitter.com/chrisdhanaraj/status/670328025553219584)
146+
>[“Plowing through @dan_abramov 'Getting Started with Redux' - its amazing how much simpler concepts get with video.”](https://twitter.com/chrisdhanaraj/status/670328025553219584)
125147
>Chris Dhanaraj
126148
127-
>[“This video series on Redux by @dan_abramov on @eggheadio is spectacular!”](https://twitter.com/eddiezane/status/670333133242408960)
149+
>[“This video series on Redux by @dan_abramov on @eggheadio is spectacular!”](https://twitter.com/eddiezane/status/670333133242408960)
128150
>Eddie Zaneski
129151
130-
>[“Come for the name hype. Stay for the rock solid fundamentals. (Thanks, and great job @dan_abramov and @eggheadio!)”](https://twitter.com/danott/status/669909126554607617)
152+
>[“Come for the name hype. Stay for the rock solid fundamentals. (Thanks, and great job @dan_abramov and @eggheadio!)”](https://twitter.com/danott/status/669909126554607617)
131153
>Dan
132154
133-
>[“This series of videos on Redux by @dan_abramov is repeatedly blowing my mind - gunna do some serious refactoring”](https://twitter.com/gelatindesign/status/669658358643892224)
155+
>[“This series of videos on Redux by @dan_abramov is repeatedly blowing my mind - gunna do some serious refactoring”](https://twitter.com/gelatindesign/status/669658358643892224)
134156
>Laurence Roberts
135157
136158
So, what are you waiting for?
137159

138-
#### [Watch the 30 Free Videos!](https://egghead.io/series/getting-started-with-redux)
160+
#### [Watch the 30 Free Videos!](https://egghead.io/series/getting-started-with-redux)
139161

140162
If you enjoyed my course, consider supporting Egghead by [buying a subscription](https://egghead.io/pricing). Subscribers have access to the source code for the example in every one of my videos, as well as to tons of advanced lessons on other topics, including JavaScript in depth, React, Angular, and more. Many [Egghead instructors](https://egghead.io/instructors) are also open source library authors, so buying a subscription is a nice way to thank them for the work that they’ve done.
141163

@@ -184,12 +206,12 @@ Special thanks to [Jamie Paton](http://jdpaton.github.io) for handing over the `
184206

185207
### Change Log
186208

187-
This project adheres to [Semantic Versioning](http://semver.org/).
209+
This project adheres to [Semantic Versioning](http://semver.org/).
188210
Every release, along with the migration instructions, is documented on the Github [Releases](https://github.com/rackt/redux/releases) page.
189211

190212
### Patrons
191213

192-
The work on Redux was [funded by the community](https://www.patreon.com/reactdx).
214+
The work on Redux was [funded by the community](https://www.patreon.com/reactdx).
193215
Meet some of the outstanding companies that made it possible:
194216

195217
* [Webflow](https://webflow.com/)

0 commit comments

Comments
 (0)