You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardexpand all lines: README.md
+43-21
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
# [Redux](http://rackt.github.io/redux)
2
2
3
-
Redux is a predictable state container for JavaScript apps.
3
+
Redux is a predictable state container for JavaScript apps.
4
4
5
5
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).
6
6
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.
>[Getting Started with Redux](https://egghead.io/series/getting-started-with-redux) (30 free videos)**
19
19
20
20
### Testimonials
21
21
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)
23
23
>Jing Chen, creator of Flux
24
24
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)
26
26
>Bill Fisher, author of Flux documentation
27
27
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)
29
29
>André Staltz, creator of Cycle
30
30
31
31
### Developer Experience
@@ -34,7 +34,7 @@ I wrote Redux while working on my React Europe talk called [“Hot Reloading wit
34
34
35
35
### Influences
36
36
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/).
38
38
Whether you have used them or not, Redux only takes a few minutes to get started with.
39
39
40
40
### Installation
@@ -45,21 +45,43 @@ To install the stable version:
45
45
npm install --save redux
46
46
```
47
47
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:
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.
49
73
50
74
```
51
75
npm install --save react-redux
52
76
npm install --save-dev redux-devtools
53
77
```
54
78
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).
58
80
59
81
### The Gist
60
82
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.
63
85
To specify how the actions transform the state tree, you write pure *reducers*.
64
86
65
87
That’s it!
@@ -118,24 +140,24 @@ This architecture might seem like an overkill for a counter app, but the beauty
118
140
119
141
[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.**
120
142
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)
122
144
>Sandrino Di Mattia
123
145
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)
125
147
>Chris Dhanaraj
126
148
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)
128
150
>Eddie Zaneski
129
151
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)
131
153
>Dan
132
154
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)
134
156
>Laurence Roberts
135
157
136
158
So, what are you waiting for?
137
159
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)
139
161
140
162
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.
141
163
@@ -184,12 +206,12 @@ Special thanks to [Jamie Paton](http://jdpaton.github.io) for handing over the `
184
206
185
207
### Change Log
186
208
187
-
This project adheres to [Semantic Versioning](http://semver.org/).
209
+
This project adheres to [Semantic Versioning](http://semver.org/).
188
210
Every release, along with the migration instructions, is documented on the Github [Releases](https://github.com/rackt/redux/releases) page.
189
211
190
212
### Patrons
191
213
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).
193
215
Meet some of the outstanding companies that made it possible:
0 commit comments