News for hackers. Stuff that matters.
Re:Angular 2 Release Candidate by zkhalique on Tuesday May 03, 2016 @01:30AM (#11618160)
React is just about dirty-checking the view, while Angular dirty-checks the model.

I mean, seriously, that's the main difference conceptually. You just modify some data structure and both frameworks will update some view.

Re:Angular 2 Release Candidate by kansface on Tuesday May 03, 2016 @02:09AM (#11618306)
Angular embraces two way data binding while React does everything humanly possible to avoid it.

I will also point out that Angular essentially re-implements JavaScript in the form of extensions to html. EG, if you want to iterate over something in React, you use map while Angular makes use of ng-repeat.

Re:Angular 2 Release Candidate by cowkingdeluxe on Tuesday May 03, 2016 @03:25AM (#11618608)
I've found that using :: to disable two-way binding where needed and using 'track by $index' in ng-repeat removes both of those performance concerns (in my usage).
Re:Angular 2 Release Candidate by jhall1468 on Tuesday May 03, 2016 @02:14AM (#11618326)
Ugh, this lacks any contextual reason on why one is better than the other. Dirty checking a model requires a direct comparison on every digest loop, regardless of whether or not the state has changed (because we don't know if the state has changed).

React runs its dirty check only after a state change obligates it to. As your model gets larger and larger, dirty-checking the model on every digest loop starts to have performance problems.

Oversimplification can be incredibly misleading.

Re:Angular 2 Release Candidate by robwormald on Tuesday May 03, 2016 @02:42AM (#11618435)
This was the case in Angular 1 - in Angular2, not so much. The component-tree structure (much like React) allows far smarter optimization on change detection - both with immutable data structures and observables - entire subtrees of components can be removed from the change detection step until the state notifies it of a change.

Good reading material by a team member - http://victorsavkin.com/post/110170125256/change-detection-i... and http://victorsavkin.com/post/114168430846/two-phases-of-angu...

An early beta comparo - http://www.roblog.io/js-repaint-perfs/angular2/opt.html vs http://www.roblog.io/js-repaint-perfs/react/opt.html - should probably update these with the latest RC.

Re:Angular 2 Release Candidate by zxv on Tuesday May 03, 2016 @02:13AM (#11618321)
I was surprised to find that Angular has a limited duration time window during which changes will update the view. In my case, symptoms were observed only after deployment, for user who had a high latency connection between their browser and the server.

One could mitigate this by calling $scope.$apply() after every change. But if you have to apply() all changes, then what's the point of having angular handle synchronization?

Re:Angular 2 Release Candidate by zkhalique on Thursday May 05, 2016 @10:00AM (#11636134)
In our platform, we just let the developer call a function manually after updating the state of a tool. So it is event-driven reactive changes.

Yes, shockingly, we don't save those keystrokes, but we also don't have the elaborate dirty checking. The developer of a component is extremely likely to make sure during development that the update to a state has updated the view. Of course, you could just hook up React or VDOM or mirthril and it's totally complementary to what we do.