7 ms·
I wonder where the happy medium is. Setting up React/Redux/React-redux/react-router/react-redux-router/react-redux-router-thunk/webpack-hot-module-oh-my-god-wha
by andys627 10y ago
I wonder where the happy medium is. Setting up React/Redux/React-redux/react-router/react-redux-router/react-redux-router-thunk/webpack-hot-module-oh-my-god-what-am-i-doing takes forever.
- thereact 10y agocreate-react-app is their official attempt at a happy medium that basically does bare minimum basic configuration to start building React apps with the latest tools: https://facebook.github.io/react/blog/2016/07/22/create-apps-with-no-configuration.html https://facebook.github.io/react/blog/2016/07/22/create-apps... HN Discussion link: https://news.ycombinator.com/item?id=12144371 https://news.ycombinator.com/item?id=12144371
- ng12 10y agoYou don't need all of that from scratch. You can just build React components, and when it comes time to add a store or a router the only thing you need to change are the glue components that bind things together. I think it works out nicely -- the dev process is as composable as the app itself.
- nightski 10y agoYea I've noticed that. The react community likes to focus on examples involving a sign up form with 3 fields where you "really don't need all of that". Except that is not what most of us SPA devs are building. We need most of that.
- shados 10y agoEither you need all of that, and the time to set it up is absolutely insignificant compared to the lifetime of the project. Or you don't need all of that. It's very, very rarely a different situation.
- msane 10y agoIs that really an argument? that you don't need to write it at the beginning? you still have to do it...
- ng12 10y agoMy argument is that it's a net benefit. Composable architectures are not boilerplate. Remember that there was a time when almost all React apps where written with Flux -- this model is what allowed Redux gain traction.
- ergo14 10y agoA good way to start is to use polymer components :-)
- grkg8tr 10y agoMaybe something like http://aurelia.io http://aurelia.io ?
- desireco42 10y agoWow, really nice!
- yogthos 10y agoHonestly, the fact that people put up with this in Js ecosystem amazes me to no end. I've been working with ClojureScript on the front-end for the past year, and it's just night and day. There's a single build tool (http://leiningen.org/ http://leiningen.org/), and it manages dependencies, tests, builds, etc. Things just work. Setting up a new project is as simple as: lein new reagent-frontend myapp I can go and start developing it by running lein figwheel After it starts I can open the browser at localhost:3449 and any changes I make in the source will be immediately reflected. Once I want to package for release I just do: lein clean lein release That's it, I now have minified and pruned Js file that's ready for production.
- cheez 10y agoCLJS is just a language.
- yogthos 10y agoIt's really much more than that. There's an ecosystem around ClojureScript that's completely separate from Js, and I find the CLJS ecosystem to be far better in many respects.
- danabramov 10y agoThis is pretty much what we’re doing with Create React App. npm i -g create-react-app create-react-app my-app cd my-app npm start # start devserver npm run build # build for production
- yogthos 10y agoSure, but how do you go about doing things like managing dependencies, doing hot code loading, running tests, and so on?
- hugozap 10y agoHere's how to have a great starting point in less than 10 seconds: npm install -g create-react-app && create-react-app hello-world