5 ms·
The 3REE Stack: React, Redux, RethinkDB and Express.js
- shaun123 11y agoA good read, i need to brush up on my JavaScript!
- shaun12345 11y agoA good read, i need to brush up on my JavaScript!
- bryanlarsen 11y ago3 shiny new techs, and one clunky older one. Why use Express.js instead of its successor Koa.js?
- GordyMD 11y agoFair point. I didn't really give this layer too much thought considering the focus of the blog. It could really be any Node.js framework. Although saying that, if I had chosen Koa.js the stack would have to be called 3REK, or 3RKE :/
- madeofpalk 11y agoIn my React (+Redux) applications, Express only plays a very minor part of being the entry point for the server. Check this out https://github.com/joshhunt/reactapus/blob/master/src/server/index.js https://github.com/joshhunt/reactapus/blob/master/src/server.... Koa or Express.js wouldn't really make that much of a difference.
- bryanlarsen 11y agoIf there is no server side functionality, why not use one of the many react static site generators?
- fbonetti 11y agoBecause this isn't a static site. Updates are being fed to the client via websockets.
- bryanlarsen 11y agoBut neither koa.js nor express.js do websockets. You're holding up a site that would probably be simpler without both koa and express as an example to say that it doesn't make much of a difference whether you choose koa.js or express.js.
- jkarneges 11y agoWe've built a pretty cool library for Express that makes it easy to do WebSocket stuff through Pushpin (a proxy server). http://blog.fanout.io/2015/03/09/stateless-websockets-with-express-and-pushpin/ http://blog.fanout.io/2015/03/09/stateless-websockets-with-e... Not that this was covered in the article, but it would be a reason to choose Express as the backend. It would be cool to build something similar for Koa though.
- LoSboccacc 11y agoAh, the "Making debugging impossible because we're cool" kind of stack
- dang 11y agoPlease don't post dismissive comments to HN. A substantive point about the impact on debugging would of course be welcome.
- GordyMD 11y agoI think if you take a lot at the motivations that Dan Abramov had for creating Redux [1], you'll see that improving debugging was at the centre of it. Check out his talk he gave at React-Europe. He basically is talking about improving developer tools. The functional approach Redux takes allows for you to see state transitions and replay actions - making it relatively trivial (compared to say Angular.js) to understand how to reproduce a buggy state. [1] https://github.com/rackt/redux https://github.com/rackt/redux [2] https://www.youtube.com/watch?v=xsSnOQynTHs https://www.youtube.com/watch?v=xsSnOQynTHs
- bonobo3000 11y agoDude, this is half the point of redux. Theres a debugger that lets you visually step through every state of the store and your corresponding app - https://github.com/gaearon/redux-devtools https://github.com/gaearon/redux-devtools
- eonw 11y agoyawn. another stack. what are its merits?
- kking50 11y ago"However, out of this wonderfully frustrating evolution of JavaScript I think things are beginning to settle down." React - first commit May 29, 2013 Flux - first commit July 23, 2014 ExpressJS - first commit July 31, 2012 RethinkDB - first commit Oct 3, 2009 Yeah, I doubt it.
- PhrosTT 11y agoI'm using React + Redux + Koa (+postgresql). The most annoying thing with JavaScript right now is that Babel gives you all ES6 features in your front end bundle, but node 4 only has a subset, so you have to remember when you to stop using features. (No I don't want to transpile back end code).
- desuvader 11y agoYou can use Babel with node on the back end. See https://babeljs.io/docs/usage/require/ https://babeljs.io/docs/usage/require/. Definitely not the most ideal solution, but it allows you to easily transition into ES6 when all the features land in node.
- odiroot 11y agoIt's not really a problem now. I use the auto-transpilation trick with Babel. You can see a small example in my repo: https://github.com/odiroot/songs-to-spotify/blob/master/src/syncer.js https://github.com/odiroot/songs-to-spotify/blob/master/src/... Then in required modules you're free to use ES2015.