Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify installation instructions #1181

Conversation

@jamesplease
Copy link
Contributor

@jamesplease jamesplease commented Dec 26, 2015

When I read the installation instructions, it didn't come across to me that the npm package could be used without a CJS module bundler. I tried to reorganize the instructions here to make it a bit more clear.

The rest of the commit msg:

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.

@@ -135,7 +135,7 @@ This architecture might seem like an overkill for a counter app, but the beauty
So, what are you waiting for?

#### [Watch the 30 Free Videos!](https://egghead.io/series/getting-started-with-redux)
#### [Watch the 30 Free Videos!](https://egghead.io/series/getting-started-with-redux)
Copy link
Contributor Author

@jamesplease jamesplease Dec 26, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can revert this change if ya want. My text editor stripped out the extra space.

Loading

Copy link
Contributor

@gaearon gaearon Jan 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do :-)

Loading

@gaearon
Copy link
Contributor

@gaearon gaearon commented Dec 26, 2015

Let's add an explicit paragraph explaining how to install and use the UMD build.
It's available both inside NPM package and standalone via npmcdn.
In fact you can even use it with Bower:

bower install redux=https://npmcdn.com/redux/dist/redux.js

Loading

@timdorr
Copy link
Member

@timdorr timdorr commented Jan 13, 2016

@jmeas Can you add that npmcdn link? Other than that, this looks good! 😄

Loading

@timdorr
Copy link
Member

@timdorr timdorr commented Jan 27, 2016

@jmeas Any chance you can get to this? I can cherry pick in and add the npmcdn link for you, if not.

Loading

@jamesplease
Copy link
Contributor Author

@jamesplease jamesplease commented Jan 27, 2016

I'll add it to my to-do list, and try to get to it in a few days.

Since all of the builds export UMD, I think there's some good rephrasing that can be done to capture that important detail.

Loading

@timdorr
Copy link
Member

@timdorr timdorr commented Jan 27, 2016

There's also the counter-vanilla example now that uses npmcdn, which you may way to point to.

Loading

@jamesplease
Copy link
Contributor Author

@jamesplease jamesplease commented Jan 27, 2016

Hmmm..."counter-vanilla"? Not sure if I know what ya mean.

Loading

@timdorr
Copy link
Member

@timdorr timdorr commented Jan 27, 2016

Loading

@jamesplease
Copy link
Contributor Author

@jamesplease jamesplease commented Jan 27, 2016

Ah, right, haha. Cool, and that's a great idea. I'll add a link to that!

Loading

@jamesplease jamesplease force-pushed the update-installation-instructions branch 2 times, most recently from 96f7f29 to b0ac82d Jan 28, 2016
@jamesplease
Copy link
Contributor Author

@jamesplease jamesplease commented Jan 28, 2016

Mmk, updated with some of the feedback y'all gave. Let me know what ya think, and if there are any other changes you think I should make.

Loading


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).

You can use Redux together with [React](https://facebook.github.io/react/), or with any other view library.
You can use Redux together with [React](https://facebook.github.io/react/), or with any other view library.
Copy link
Contributor

@gaearon gaearon Jan 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These spaces are significant. They force Markdown to make a newline.

Loading

@jamesplease
Copy link
Contributor Author

@jamesplease jamesplease commented Jan 29, 2016

I can fix the spaces. That aside, how are the text changes?

Loading

@jamesplease jamesplease force-pushed the update-installation-instructions branch 2 times, most recently from b38696d to 2a104ce Jan 29, 2016
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.
@jamesplease jamesplease force-pushed the update-installation-instructions branch from 2a104ce to d221deb Jan 29, 2016
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).

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/).
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).
Copy link
Member

@timdorr timdorr Jan 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the death by a thousand comments...

I'd change "Use of the extensions requires that you’re using npm" back to something like "This assumes you are using npm", so you avoid having "use" and "using" in the same sentence.

But good catch changing "npm package manager" to just "npm". That's like saying "ATM machine" 😄

Loading

Copy link
Contributor Author

@jamesplease jamesplease Jan 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the death by a thousand comments...

No problem at all! I want this to be good. I appreciate the thorough feedback.

I'd change "Use of the extensions requires that you’re using npm" back to something like "This assumes you are using npm", so you avoid having "use" and "using" in the same sentence.

I agree that the current wording is awkward. At the same time, I want to say something a little stronger than "this assumes," because that leaves it open that there are other methods (perhaps the CDNs above, or Bower). The existing text (before I made any changes) made it out that these tools can only be used with npm, or only with CommonJS. I just pulled down react-redux, though, and it includes a UMD build all the same. I then checked cdnjs and saw it there, too.

Perhaps the recommendation to stick with npm isn't as strong as it was originally worded, and how I've worded it to be? It looks like the three install methods (npm, Bower, CDNs) may work for all of 3 of these libraries?

If that's the case, I might want to do another restructuring to make that more clear.

Another thought is that maybe the original wording was referring to popular React libraries outside of the mini-Redux ecosystem described here. Is that the case?

Sorry I'm not more knowledgeable, I haven't used Redux much yet :)

But good catch changing "npm package manager" to just "npm". That's like saying "ATM machine"

Heh heh. Maybe not...

Loading


However, if you don’t yet use [npm](https://www.npmjs.com/) or a modern module bundler, you have a few options.

##### Bower
Copy link
Contributor

@gaearon gaearon Mar 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don’t want to see us contributing to “Bower is still a good choice for front-end devs” meme by even dedicating it a header. Instead, I would suggest to merge the below two sections, remove cdnjs reference and keep only npmcdn (it’s a better project IMO), and add Bower commend as an afterthought (“If you use an alternative package manager such as Bower, it is possible that your package manager allows installing libraries from URLs, for example: ”). This way it doesn’t look like we encourage it.

Loading

gaearon added a commit that referenced this issue Apr 14, 2016
@gaearon
Copy link
Contributor

@gaearon gaearon commented Apr 14, 2016

This hasn’t been updated in a while so I made some changes inspired by this in 7b85962.
Thank you!

Loading

@gaearon gaearon closed this Apr 14, 2016
@jamesplease
Copy link
Contributor Author

@jamesplease jamesplease commented Apr 14, 2016

Thanks @gaearon ✌️

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants