3 ms·
Best practice is to use a zero-config build tool like create-react-app or angular-cli. Or a next-gen static site generator like GatsbyJS. From the developers po
by Wintamute 8y ago
Best practice is to use a zero-config build tool like create-react-app or angular-cli. Or a next-gen static site generator like GatsbyJS. From the developers point of view this is one moving part and one devDependency. I think your assessment of the SPA ecosystem is out of date, it has stabilised hugely in the last few years.
- slimsag 8y agoInteresting! Thank you for mentioning that. I think that does resolve a lot of the problems I have mentioned, but it is still telling that I've tried to start two React SPAs in the past two years and didn't manage to find create-react-app. I wonder how many others are in the same boat.
- smsx 8y agoIt depends on how long ago you last tried to make a React app. If it was recently, I'm quite surprised you didn't find it as it's heavily mentioned on the official React site, but if was say earlier than a couple years ago, that would be understandable.
- unscaled 8y agoIt's right there in the official tutorial: https://reactjs.org/tutorial/tutorial.html#setup-option-2-local-development-environment https://reactjs.org/tutorial/tutorial.html#setup-option-2-lo... But I think it wasn't this easy 2 or 3 years ago.
- simion314 8y agocreate-react-app or similar tools work only for toy projects , in the end you are forced to learn how things work under the hood, this includes all the automagic tools, eventually something goes bad or you need to change something and you are forced to go dig and look at the code.
- Wintamute 8y agoI'm a senior JavaScript dev and consultant - we ship create-react-app and angular-cli apps to production frequently, having to eject and dig into the build process is the exception rather than the norm. The win for keeping things zero-config is so huge, its worth working around some of the restrictions.
- simion314 8y agoI assume that most senior developers in the team had to learn all the components used and how they work, you can use npm without knowing what package.json is but you will have to learn the details eventually, if you use gulp you will have to learn how to edit the gulp file when you need to do a specific task,l you probably had to learn what source files are and how to set them up and others. If you do not know this eventually you will have to learn them. Other platforms have similar magic, like Visual Studio hides complexity from you but on complex projects or weird issues you will have to learn how it works under the hood(compiler, linker , compiler flags, you may want to drop the GUI for building and use the CLI for flexibility)