nandtotetris / computer-visualizer

0 stars 0 forks source link

`react-app-rewired` vs webpack configuration from scratch #4

Closed mezzzi closed 4 years ago

mezzzi commented 4 years ago

This is quite an important decision, since it will affect how the project will be run throughout development. React boiler plates like react-app-rewired have the advantage of taking care of the initial heavy lifting configuration wise. While from scratch webpack configuration provides an openness and flexibility that will come in handy when trying to add some important plugin later on during development, also might give a light weight build. Anyways, we should discuss this and choose which one will suit our project more.

henites72 commented 4 years ago

@mezzzi I don't think we need more flexibility in adding plugins for our project, even if we need some plugins we can override webpack using react-app-rewired. If you have any plugins in your mind that may appear in our project, you can list out here, that may have an impact on the decision.

@Buranch can you share your experience on this, how many of the projects you are/were working on, set up the webpack from scratch?

Buranch commented 4 years ago

@henites72 most of them use the standard create-react-app which takes care of the webpack configuration. The downside of using this is that it hides the webpack implementation, which may limit our flexibility.

The approach i prefer is to bootstrap the project with create-react-app and see how it goes and if we need some extra flexibility we can always inject(which makes the configuration unhidden)

I don't know much about react-rewind, a quick look at it, i think its over complicate things at this point.

Buranch commented 4 years ago

And to add few points from experience, working on projects with weback from scratch tends to be complicated and prone to bugs and nothing is more frustrating than a webpack bug.

henites72 commented 4 years ago

@Buranch @mezzzi I also prefer using CRA. Using react-app-rewired, we can customize the webpack without ejecting it. We may use it, if we really need to add plugins.

I think we can go with CRA.

mezzzi commented 4 years ago

@henites72 @Buranch Ok, you guys seem to have agreed on going with either create-react-app or react-app-rewired. And for some reason I am inclined to configuring webpack manually, it just makes the code base more transparent and open (no mysteries) ... also I am using it in another project I am working on. How about each of us create a PR with the setup we like, and make the judgment from there. Simply talking about it might not do us much good.

henites72 commented 4 years ago

@mezzzi react-app-rewired is a single npm module, https://www.npmjs.com/package/react-app-rewired, not a boilerplate. So I'm saying we can use CRA and if we need to customize webpack, we can use react-app-rewired.

We can also set up the project, on different branch and see the differences.

mezzzi commented 4 years ago

Ok, I guess we can always eject when the need arises. And maybe it is better to keep it simple till then. We can go ahead and setup with create-react-app.