Live data from Hacker News

Create-react-app is great but it lacks something: Redux and its configurations

github.com

1–9 of 9 posts

Re: Create-react-app is great but it lacks something: Redux and its configurations

#2
It's interesting you should bring this up. I'm a Redux maintainer, and I recently opened up an issue for discussion of possible useful "official" libraries or tooling that could be built on top of Redux: https://github.com/reactjs/redux/issues/2295 .

A basic option might be a small library that simply creates a pre-configured store for you, and possibly also includes some common useful utilities (redux-thunk, reselect, redux-actions, etc). At a higher level, Dan Abramov suggested that he would like to see something that has data fetching, normalization, and code splitting built in.

Another approach would be something that sits on top of Create-React-App, kind of like what you've built here. Your tool looks interesting, although it looks considerably more opinionated in terms of React-related libraries than something we might want to dub as an "official" Redux tool.

I'd love to have you join the discussion in that issue and help us come up with ideas for ways to improve Redux and the ecosystem!

Re: Create-react-app is great but it lacks something: Redux and its configurations

#3
post #2

It's interesting you should bring this up. I'm a Redux maintainer, and I recently opened up an issue for discussion of possible useful "official" libraries or tooling that could be built on top of Redux: https://github.com/reactjs/redux/issues/2295 . A basic option might be a small library that simply creates a pre-configured store for you, and possibly also includes some common useful utilities (redux-thunk, reselec…

Awesome. I did not know about that issue. Seems like an interesting read.

I personally would like a standalone tool, like CRA. Will indeed jump into the discussion myself.

Re: Create-react-app is great but it lacks something: Redux and its configurations

#4
Thank god it doesn't contain Redux, entirely optional and entirely complex.

Just recently someone was telling me about how hard ReactJs was to learn and from what I could glean, at least part of the learning challenge was because he felt he had to use Redux because many people perceive react and redux to go hand in hand.

Re: Create-react-app is great but it lacks something: Redux and its configurations

#5

Thank god it doesn't contain Redux, entirely optional and entirely complex. Just recently someone was telling me about how hard ReactJs was to learn and from what I could glean, at least part of the learning challenge was because he felt he had to use Redux because many people perceive react and redux to go hand in hand.

That has to do with people used to frameworks and coming to React expecting that. I personally had the same issue.

If you are used to framework based development (Angular, Vue, Backbone, etc) you are not used to making decisions for yourself and to chose when to use what. Don't get me wrong, opinionated frameworks are good and fill a gap.

But you have to know that when you are developing using libraries you make those decisions yourself and thus you have to think a bit more when you chose something and why.

Redux is just one way to handle state in React apps. Might be the most used one but by any means it is the only one or the silver bullet.

Re: Create-react-app is great but it lacks something: Redux and its configurations

#7
post #6

Why not custom scripts via `--scripts-version`? How do you keep things up-to-date like create-react-app does?

To keep up-to-date with create-react-app just upgrade the react-scripts dependencies. In the case of the Yeoman create-redux-app generator npm install -g generator-create-redux-app

Re: Create-react-app is great but it lacks something: Redux and its configurations

#8
post #2

It's interesting you should bring this up. I'm a Redux maintainer, and I recently opened up an issue for discussion of possible useful "official" libraries or tooling that could be built on top of Redux: https://github.com/reactjs/redux/issues/2295 . A basic option might be a small library that simply creates a pre-configured store for you, and possibly also includes some common useful utilities (redux-thunk, reselec…

I think Redux need an starter like create-react-app. Something official following the best practices, something that covers not only the world of React but also implements Redux and all the libraries necessary to make a real world application. You could have the options of including different libraries (redux-thunk, reselect, redux-actions, etc.) and it would be the devloper decision whether to include these libraries in the project or not. Yeoman offers this solution by asking before installing the dependencies.

Re: Create-react-app is great but it lacks something: Redux and its configurations

#9

Thank god it doesn't contain Redux, entirely optional and entirely complex. Just recently someone was telling me about how hard ReactJs was to learn and from what I could glean, at least part of the learning challenge was because he felt he had to use Redux because many people perceive react and redux to go hand in hand.

I'll point out that both the React team (particularly Dan Abramov) and the Redux team (especially myself) discourage people from trying to jump into both of those together at once. In fact, my copy-paste answer is:

> The standard advice is to focus on learning React itself first. Once you have a good understanding of how React works, you will better appreciate why a state management library like Redux can be useful. Don't over-complicate the learning process by trying to learn many different things at once.

But yes, it does seem like large portions of the community insist that you _must_ use Redux with React, you _must_ use Redux right away, and even that you _must_ put _everything_ into Redux. None of which are true :)