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

document how to add redux (or an example) #630

Closed
talkingtab opened this issue Sep 11, 2016 · 6 comments
Closed

document how to add redux (or an example) #630

talkingtab opened this issue Sep 11, 2016 · 6 comments

Comments

@talkingtab
Copy link

Redux is an essential part of my react development. I like create-react-app, but now I need to find a way to add in redux. Do I "eject" and then add redux or ...? At that point it is more helpful [for me] to use another boiler plate project project. Put another way, create-react-app lowers the barrier to starting a react project, but it does not lower the barrier to starting a react-redux project.

@gaearon
Copy link
Contributor

gaearon commented Sep 11, 2016

CRA only handles the build process. Redux, or any React components, are regular dependencies. To install them, you run npm install. They have no relation to build process so you use them the same way you used them before.

@gaearon
Copy link
Contributor

gaearon commented Sep 11, 2016

Also, to clarify, this project is not meant to provide the "boilerplate" code for your app. We think that it is important that you write app code yourself, and understand the libraries you are using, and their APIs.

This project exists to make build process easy. This means you don't have to think about configuring Babel, Webpack or ESLint. Everything needed so you can write JSX and ES6 and have a good development experience.

However it doesn't make choices about which runtime libraries you use, or how you structure your app. So it's not an opinionated "starter kit".

Such starter kits could be built on top of Create React App. In fact all examples in Redux repo use it, so you might want to check them out.

@talkingtab
Copy link
Author

I did not know you had ported the redux examples to CRA, that is very helpful - thanks. I'm finding it hard to grasp the conceptual model of CRA. Not boilerplate, not starter kit, abstracts away webpack and babel complexity, yet build system doesn't seem right either. Having it generate code, while good, is also a bit misleading if it is a build process. Not complaining, just thinking.

@gaearon
Copy link
Contributor

gaearon commented Sep 12, 2016

Well, tools like this weren't very popular before so I don't think we ever came up with a name. It does a few things:

  • Creates an empty project for you with a single component. In this case it's sensible to generate some code so people don't have blank page syndrome. Especially important for beginners. Fiddling with a component that already works is easier than trying to create your first component from scratch. We don't include something like Redux because it is pretty opinionated, and you can build React apps without it just fine.
  • Hides development dependencies behind a single development dependency. I would call this a "tool facade" if this makes sense. It tries to unite several tools into a cohesive experience without burdening you with configuration.
  • Running "eject" moves all build dependencies and configuration into your project so it becomes more like a build boilerplate, but you can do it at any time, even when you already have an app written.

So yeah, it doesn't cleanly fit those roles, but that's precisely because we think those roles are problematic and didn't work well, and we wanted to try something different.

@talkingtab
Copy link
Author

names:

 - react virtual build environment

 - react integrated tool set

 - react federated build tools.

create-react-app --add_redux --add_whatever --no_app (only generates
index.js) --add api_server

Just speculations, not even suggestions.

:-)

Terry

On 9/12/16 5:55 AM, Dan Abramov wrote:

Well, tools like this weren't very popular before so I don't think we
ever came up with a name. It does a few things:

  • Creates an empty project for you with a single component. In this
    case it's sensible to generate /some/ code so people don't have
    blank page syndrome. Especially important for beginners. Fiddling
    with a component that already works is easier than trying to
    create your first component from scratch. We don't include
    something like Redux because it is pretty opinionated, and you can
    build React apps without it just fine.
  • Hides development dependencies behind a single development
    dependency. I would call this a "tool facade" if this makes sense.
    It tries to unite several tools into a cohesive experience without
    burdening you with configuration.
  • Running "eject" moves all build dependencies and configuration
    into your project so it becomes more like a build boilerplate, but
    you can do it at any time, even when you already have an app written.

So yeah, it doesn't cleanly fit those roles, but that's precisely
because we think those roles are problematic and didn't work well, and
we wanted to try something different.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#630 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAC5Im28mVe6UQQpxhZW3KOkA2u863Iiks5qpSGFgaJpZM4J6ESN.

@gaearon
Copy link
Contributor

gaearon commented Sep 24, 2016

For now, I feel this is out of scope so closing.
People who just start learning React generally don’t need Redux, and those who do should already be comfortable with installing libraries from npm by that point.

@gaearon gaearon closed this as completed Sep 24, 2016
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants