6 ms·
Someone in the video asked a question about how AngularJS compares against Flux+React. Anyone has a more detailed explanation?
by sarhus 12y ago
Someone in the video asked a question about how AngularJS compares against Flux+React.
Anyone has a more detailed explanation?
- sehr 12y agoI've found a couple of links regarding React without Flux vs Angular: http://www.quora.com/Pete-Hunt/Posts/Facebooks-React-vs-AngularJS-A-Closer-Look http://www.quora.com/Pete-Hunt/Posts/Facebooks-React-vs-Angu... http://www.reddit.com/r/javascript/comments/1oo1y8 http://www.reddit.com/r/javascript/comments/1oo1y8 Though they're both from a member of the React team and might be a little biased, they were very informative.
- grayrest 12y agoFor a long explanation, Pete Hunt gave a talk [1] as the extended justification for using React. [1] http://www.confreaks.com/videos/3221-mwjs-be-predictable-not-correct http://www.confreaks.com/videos/3221-mwjs-be-predictable-not... Flux is just Facebook's internal usage pattern. Doesn't really have an Angular equivalent other than the somewhat nebulous Angular best practices.
- pacala 12y agoReally good video. Made me clearly understand that React is Javascript as if it were to natively support the spreadsheet / reactive programming model. Update a cell, dependent cells / signals get updated automagically. The huge upside is that cells / signals are plain JS values that can be composed using plain JS functions, and all the JS tooling just works. Technically, this is done by simply using an unique dirty bit, which triggers the recomputation of the rendered scene. Which is fast enough in practice, and even supports unchanged hints to reduce the costs of expensive DOM updates. This is eerly similar to 3d scene rendering. The unchanged hints are the equivalent of viewport clipping, though require more work from the coder to setup right.
- couchand 12y agoI've been doing a fair amount of Angular development at work and recently been getting into React on the side (and now introducing it for a new project at work!). I'd say they have the same general goal - build your app with declarative and expressive markup. However, Angular tries to shoehorn custom components into the regular DOM, which gets problematic in many cases. For instance: the directives `ng-show` and `ng-hide` simply apply CSS styles. As far as I know it's not possible to completely remove an Angular component from the DOM and then replace it later (without getting too deep into imperative JS). However, that's trivial to do in React. Angular chokes on large data sets, probably because it's doing everything directly on the DOM. React handles huge numbers of records effortlessly. Getting comparable performance with Angular requires much more imperative voodoo than I'd like out of an ostensibly declarative system. I also find it harder to reason about Angular's data flow, since there are many ways to pass things around: nested scope, isolate scope, sibling scope, same scope, dependency injection to name a few. Finding where a particular handler or value comes from is sometimes quite the hunt. With React, it's all pretty much self-contained.
- optymizer 12y ago> As far as I know it's not possible to completely remove an Angular component from the DOM Wouldn't ng-if be appropriate for this?
- couchand 12y agoAh yes, that's exactly what `ng-if` is for. Thanks for pointing that out. The only downside is that it creates another nested scope, which can be surprising.