News for hackers. Stuff that matters.
Re:Angular 2 Final Released by philippz on Thursday September 15, 2016 @04:42AM (#12504394)
For economical reasons. We decided between ng2, React and Vue.JS: https://docs.google.com/spreadsheets/d/1ULB2GjA3ytXAN_Sn-fEy...

React would mean to rewrite your whole application as it has a totally different basic concept. Following the ng2 migration path you're able to migrate slowly.

Re:Angular 2 Final Released by shados on Thursday September 15, 2016 @02:09PM (#12508393)
at my last job we did a gradual migration from Angular 1 to React. Its similar to the path to Angular 2 really. React and Angular can live side by side... All we did was build an Angular directive that can render a react component in a subtree (that's easy), and a React component that could render an Angular directive (that's a little harder, but not that bad).

With that, we could put a React component anywhere in our Angular app, and reuse Angular directives inside of React until we got around to rewriting them.

That ended up quite smooth.

Re:Angular 2 Final Released by tomasduda on Thursday September 15, 2016 @04:45PM (#12509680)
Would you mind sharing the code for this?
Re:Angular 2 Final Released by shados on Friday September 16, 2016 @10:14AM (#12514117)
I wanted to open source it at the time...then my employer had layoffs :)

The "React component inside of Angular directive" is fairly trivial and there's a million examples on the net. Just make a directive that calls ReactDOM.render on the element in the link function.

Angular inside of a React component is harder to google for, namely because there's so much misinformation saying its impossible.

It ended up being a variation of the discussion here: https://github.com/ngReact/ngReact/issues/80

(The code in the example isn't quite there...and its been a very long time since I did it, so I don't quite remember the tweaks I had to make).

Re:Angular 2 Final Released by elmigranto on Thursday September 15, 2016 @09:11AM (#12505773)
> React would mean to rewrite your whole application

I don't see what is a problem to just drop in React into `<script>` tag and use for single part of the page, gradually refactoring stuff.

Re:Angular 2 Final Released by philippz on Friday September 16, 2016 @05:14AM (#12512769)
That would mean to live with a hybrid solution, more overhead and a bigger footprint. We currently deploy our JS base to web, Android and iOS (Cordova/Phonegap). It is and will remain one code base to be flexible and fast until we get "product/market fit" and until we have KPIs where we want them. This is cost effective but comes with the slowness of web-engine rendered apps. Therefore performance is big factor and we're optimizing for that. By switching to ng2 we have have a cost-effective and performant compromise.