4 ms·
There are a few things in React ecosystem that need to be abstracted. 1. Redux 2. React Router 3. Smart components 4. Dumb components 5. Services (This is
by smdz 9y ago
There are a few things in React ecosystem that need to be abstracted.
1. Redux
2. React Router
3. Smart components
4. Dumb components
5. Services (This is combination of Redux, redux-thunk and axios(or whatever))
6. Webpack (CSS loader, SCSS, fonts, html, etc...)
7. And hopefully, everything with TypeScript if they can get over Flow.
Having worked on quite a few React projects, I have a boilerplate that mashes up the above combination and makes it work. With new project, I upgrade the dependencies.
But each time I start a new project in 3-4 months, something would have changed. Either its TS type defs or something in core React.
And as I discovered recently few days back - Webpack2, Router4 broke my boilerplate setup. Well, they actually improved react-router, and that made me remove some workarounds.
Every time I start, I end up spending at least half-to-one day setting up the same "Hello world" page and making sure the wiring works okay before I proceed to add functionality. That is just a waste of time. React core is cool, but I hope they had one highly-opinionated version of React that works out of the box.
- asdfgadsfgasfdg 9y agocreate-react-app
- buchanaf 9y agoThis quite frankly is answer to approximately 75% of the complaints that you hear about the React/JS community. Unless you are doing something relatively cutting edge like isomorphic rendering (next.js), you are basically wasting your time if you aren't leveraging create-react-app for your scaffolding.
- smdz 9y agoI get thrown that a lot, but unfortunately create-react-app is not the solution. It simply summarizes all the complexities in one place, it doesn't abstract those out. For starters - yes, definitely. They should start with it
- spicyj 9y agoIf there are areas where create-react-app is a leaky abstraction, please file bugs. My understanding is that the maintainers aspire to have it completely shield you from configuring the underlying tools.
- haukur 9y agoMost of the tooling is stable enough that you can lock your dependencies to minor versions (the default behaviour in Yarn/NPM) and only update when you want the new features. There's no need to stay on the bleeding edge unless you want to. I've fallen prey to this myself before, but there's much to be said about just keeping it simple.