5 ms·
For economical reasons. We decided between ng2, React and Vue.JS: https://docs.google.com/spreadsheets/d/1ULB2GjA3ytXAN_Sn-fEyDFq9BlKbpaS3iGG_MdhL1Cs/edit?usp=s
by philippz 10y ago
For economical reasons. We decided between ng2, React and Vue.JS: https://docs.google.com/spreadsheets/d/1ULB2GjA3ytXAN_Sn-fEyDFq9BlKbpaS3iGG_MdhL1Cs/edit?usp=sharing 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.
- elmigranto 10y ago> 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.
- philippz 10y agoThat 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.
- shados 10y agoat 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.
- tomasduda 10y agoWould you mind sharing the code for this?
- shados 10y agoI 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 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).