News for hackers. Stuff that matters.
Re:Why We Moved to React by tracker1 on Friday February 26, 2016 @03:30PM (#11183991)
In this way, it seems that React makes a lot of sense as a migration path. Honestly, I find flux/redux and other unidirectional data flows are much easier to scale than most patterns for UI development, especially class/oo ones.

That said, React is just a part of it, and some flows are counter-intuitive in React. This must be said because it is true... that said, I find that React is far better, all around than most of the other options I've used, and I've been building web apps for two decades now.

I'm currently working on supporting an Angular 1.x app, have a proof of concept built in Redux+React, and another app I've been instructed to write in Angular 2. I've also built a couple of SPAs using Backbone. In the end the Redux flow has meant less code as features are added, and I'm working towards writing my Angular 2 app with that in mind. Modern React takes a lot of tooling setup to get started (or starting with someone's existing boilerplate), but the shear amount of boilerplate code that you have to write with Angular2 is just unnerving. The DI model is awkward, and I'm not enjoying it at all...

The Redux+React proof of concept is for half the functionality of the Angular 1.x app, I'm pushing for the change in the next version... with about 1/3 the functionality, the code is 1/10th the size, and there's a lot less complexity... A single state tree, in the end is easier to reason with, even if you're only looking at part of it. It's much easier to deal with, even with scale than trying to add more message channels in an application between components. Getting used to separating actions via a single dispatcher, and the resulting state changes takes getting used to... but so much easier in the end.

Re:Why We Moved to React by iSnow on Saturday February 27, 2016 @03:18AM (#11186515)
> with about 1/3 the functionality, the code is 1/10th the size

Yeah, that's the usual 80/20 rule at play.

Re:Why We Moved to React by doczoidberg on Saturday February 27, 2016 @07:23AM (#11186909)
Angular CLI helps much with the Angular 2 boilerplate code: https://github.com/angular/angular-cli
Re:Why We Moved to React by tomekowal on Saturday February 27, 2016 @02:21AM (#11186392)
Have you checked Elm? I know there is a big difference between switching frameworks and entire language, but the benefits are really nice. Elm really enforces unidirectional data flows throughout entire application. For me it's like react on steroids.
Re:Why We Moved to React by novaleaf on Saturday February 27, 2016 @10:19AM (#11187283)
I've been using Redux, and it is pretty much required if you have multiple components who need to update when a single state changes.... but pretty unhappy as the amount of scafolding required. It's not nearly as "isolated concerns" as it should be.
Re:Why We Moved to React by alias240 on Saturday February 27, 2016 @12:40PM (#11187764)
Take a look at MobX. It's a different paradigm that requires very little boilerplate and results in more isolated components that react independently upon changes to state. https://github.com/mobxjs/mobx
Re:Why We Moved to React by true_religion on Saturday February 27, 2016 @01:36PM (#11187936)
Right. I can give two alternatives.

1. Elm. I was just about to throw away the idea of Flux in a web app till I saw TodoMVC implemented in Elm. In Elm everything is immutable, and as a functional language, it has a lot of helpful syntax to help you deal with immutability. Shoehorning immutability into Javascript seems to require a lot of scaffolding by comparison.

2. MobX, it's been mentioned elsewhere but I can't help but sing its praises. Writing in MobX means that using controllers/dispatchers/actions/supervisors or another form of managing dataflow returns to being an architectural concern you can pattern to your application's needs, rather than being something that's required by default for anything more than a Todo app.

Re:Why We Moved to React by jsprogrammer on Saturday February 27, 2016 @01:32AM (#11186301)
Do you know of a worthy Redux+React boilerplate project?
Re:Why We Moved to React by phereford on Saturday February 27, 2016 @02:29AM (#11186403)
Re:Why We Moved to React by acemarke on Saturday February 27, 2016 @01:26PM (#11187904)
I've got a list of some particularly good ones at https://github.com/markerikson/react-redux-links/blob/master... . There's also a link to a little "starter kit search engine" someone built that lets you filter about 50-60 of them by various attributes.
Re:Why We Moved to React by afarrell on Saturday February 27, 2016 @10:58AM (#11187420)
http://teropa.info/blog/2015/09/10/full-stack-redux-tutorial... is good if actually want a hand-holding walkthrough rather than just a boilerplate.
Re:Why We Moved to React by sidmitra on Saturday February 27, 2016 @01:51AM (#11186332)
Re:Why We Moved to React by carsie on Saturday February 27, 2016 @02:38AM (#11186425)
https://github.com/GordyD/3ree is a good starting point for React + Redux (+ RethinkDB).
Re:Why We Moved to React by tracker1 on Saturday February 27, 2016 @09:46PM (#11189565)
My anagram is r3k[1] (React, Redux, RethinkDB, Koa) ... Still a work in progress. Wanting to get to the point where I have an adaptive login (local account, google, facebook, twitter) and some public/private pages with universal rendering. Been working on it as time permits.

[1] https://github.com/tracker1/r3k-example