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

[Question] key differences between gatsby and create-react-app #1458

Closed
johnryan opened this issue Jul 10, 2017 · 9 comments
Closed

[Question] key differences between gatsby and create-react-app #1458

johnryan opened this issue Jul 10, 2017 · 9 comments

Comments

@johnryan
Copy link

Hi, I was checking out gatsby and it seems like the workflow and features are very similar to create-react-app i.e. live dev server and a build command that builds minified js/css etc. I assume i'm missing something there so I was wondering if you could highlight what gatsby does differently there. Thanks!

@jquense
Copy link
Contributor

jquense commented Jul 10, 2017

Hi there. create-react-app (CRA), is a build cli, it helps you bootstrap a new react app from nothing fairly quickly. It's rather opinionated about how you should do that, and prohibits configuration to reduce complexity for new folks.

Gatsby, is similar is some senses but the end goal of each project is fairly different. Ultimately Gatsby is really "competing" against technologies like Jekyll vs CRA. To that end, Gatsby is a good bit higher level. It's intended to help build static sites quickly and optimizes for that use case. Practically that means you get server-side-rendering built in, and a whole robust data layer and plugin system for working with data, from CRM's like Drupal, Contentful, down to queryable metadata about react components and jsdoc comments in your source code. I'm glossing over a lot of what Gatsby does well, but i'd recommend sifting through the site (https://www.gatsbyjs.org/) and checking out some of the examples to see how it differs and which use cases it's better to choose one over the other.

@PatrickDePuydt
Copy link

Tl;dr - difficult to add Redux or any state management pattern to Gatsby.

Hey @johnryan, I googled with your same question and I've done some digging and I think there might be one more thing I can contribute that @jquense hasn't covered to this discussion if not for you but for someone else wondering.

I started tying to see the difference by way of weighing the pros and cons, and I think a big point of distinction is that Gatsby relies on API calls to interface with a back end service. create-react-app on the other hand, seems to be just a quicker way of getting up and running with React and isn't sure how you're planning on handling data. So put another way, I don't think I can easily hook up Redux to Gatsby, nor would I even need to since it's primary concern is serving static files and component changes.

For the application I'm looking to set up, the client specifically has asked for Redux, so I think that makes Gatsby a difficult choice for me. I'm sure I could rubber-mallet the library into place, but I don't think being able to add libraries like Redux easily was the reason Gatsby was made.

@KyleAMathews
Copy link
Contributor

Hey Patrick, lots of people are using redux with gatsby. The setup is slightly different than with CRA but similar to other SSR setups. Checkout the redux example app https://github.com/gatsbyjs/gatsby/tree/master/examples/using-redux

@tgrrr
Copy link

tgrrr commented Oct 12, 2017

Example is broken as of today @KyleAMathews

@KyleAMathews
Copy link
Contributor

@tgrrr can you describe more how's it broken for you? I just installed fresh packages and ran gatsby develop and it's working as expected.

@tgrrr
Copy link

tgrrr commented Oct 13, 2017

@KyleAMathews , sorry I was unclear: Gatsby works great for me.

To clarify, if you follow the link you just posted above:

Hey Patrick, lots of people are using redux with gatsby. The setup is slightly different than with CRA but similar to other SSR setups. Checkout the redux example app https://github.com/gatsbyjs/gatsby/tree/master/examples/using-redux

The link in the readme.md https://redux.gatsbyjs.org is broken. I assume it originally linked to a redux demo?

@KyleAMathews
Copy link
Contributor

Ah gotcha :-) Wasn't clear what you meant.

And yeah, never did setup that site. But it's up now at https://using-redux.gatsbyjs.org/

I'll update the README to the correct url.

@KyleAMathews
Copy link
Contributor

Closing thoughts — Gatsby is CRA w/ a data layer + more build opinions + runtime. Thanks for those that participated!

@manuelro
Copy link

CRA is a very good option if you want to stay away from frameworks. My motto is that concretions are certainly bad, when you use a framework they tell how to do do things, and sometimes you end up trying to fit a circle within a rectangle in order to make things work for your project. Gatsby on other hand is a concretion, it's a framework which means it's opinionated in many regards, and this translates into more overhead and things you will probably not use at all.

I'd rather make a case study of my requirements and the things one solution offers over the other and start from there. Even though I feel more disengaged with CRA (and that's good) than with Gatsby, this decision should be based on evidence rather than on personal preferences.

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

No branches or pull requests

6 participants