Ask HN: Why would I spend time upgrading my Angular1 code to Angular2 when I can migrate to React Or Vue.js. I am honestly intrigued as to what Angular2 offers, that other JS frameworks wont?
They are competitors. People will make arguments to either side.
In my point of view react is easier to use while angular is better for testing.
My personal choice is angular. I'm really excited for v2. But both are super powerful.
Lots more work to do here, but we're pretty happy with how the core looks! For those worried about size (which has absolutely been a fair concern over the alpha/beta process) - here's a "hello world" built with Rollup and our offline template precompilation. Clocks in at 200kb min/47k gzipped, with a bit more room from optimization over the next couple of weeks... https://ng2-compiler-test2.firebaseapp.com/
How are we tracking with: https://github.com/rollup/rollup/issues/280 Do you rollup angular or is it still an external dependency?
The new npm packages have an ES6 directory included and use the jsnext:main pointer in their package.json files to allow rollup-plugin-node-resolve to pick up the ES6 distro as normal. I'll drop a note in that issue later this week after I've gotten some sleep!
Just out of curiosity what exactly can you do with React that you can't with Angular 2?
React with redux allows to write most of the code in a purely functional / no side effects manner, which makes testing code almost a joy.
I've used flux and redux in angular for years. You can write purely functional directives. Angular is much more than just a view library. I've built quite a bit in both react and angular.
How are we tracking with: https://github.com/rollup/rollup/issues/280 Do you rollup angular or is it still an external dependency?
The new npm packages have an ES6 directory included and use the jsnext:main pointer in their package.json files to allow rollup-plugin-node-resolve to pick up the ES6 distro as normal. I'll drop a note in that issue later this week after I've gotten some sleep!
Ask HN: Why would I spend time upgrading my Angular1 code to Angular2 when I can migrate to React Or Vue.js. I am honestly intrigued as to what Angular2 offers, that other JS frameworks wont?
this is a release candidate, wait for actual release before diving into details.
I think a lot is preference. I think HTML in JS is dirty just like HTML in server side strings. Other people feel the opposite, that putting new tags which are similar to inline onclicks and other events that we moved away from w jQuery is dirty. There is truth to both. Angular gives a lot of flexibility in code style and structure. You can componetize everything and have all your component files in one folder. You c…
> Other people feel the opposite, that putting new tags which are similar to inline onclicks and other events that we moved away from w jQuery is dirty. Not even remotely the same thing. HTML has a hierarchical structure which isn't a particularly good structure for a web application. Javascript syntax allows far more control over the hierarchy. Your example is akin to saying putting a tank in an airplane is the same…
> Not even remotely the same thing. HTML has a hierarchical structure which isn't a particularly good structure for a web application.
Is there a "good" structure for a web application that jumps to your mind?
I'm happy to see Angular2 getting closer to a release, and as many other companies we are in the case of what decision after Angular1. One thing I think will be a great push for Angular2 is Ionic2 which alone is reason enough but to be honest I prefer the `Aurelia way` when it comes to writing web apps which sounds more natural, Sad to see Aurelia hype haven't took much so far (understandable that it's getting harder…
aurelia hype is there for those who research before choosing a frontend framework.
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.
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.
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).
I'm happy to see Angular2 getting closer to a release, and as many other companies we are in the case of what decision after Angular1. One thing I think will be a great push for Angular2 is Ionic2 which alone is reason enough but to be honest I prefer the `Aurelia way` when it comes to writing web apps which sounds more natural, Sad to see Aurelia hype haven't took much so far (understandable that it's getting harder…
I too like the look of aurelia. However, I really like the auto import management, refactoring, syntax highlighting. I use Webstorm & didn't see any blog posts or anything about how to set up Webstorm with Aurelia. So I'll go on learning Angular 2 for now.
Half off topic but I want just to add that Webstorm IDE has already quite a good NG2 support. For example you can jump from html to a component function via F12 or auto import unresolved statements. You see VS Code on many NG2 presentations. I think Webstorm helps more getting quicker into NG2. Also Angular-CLI helps a lot. I mention this here because many people seem to struggle with the boilerplate code.
WebStorm has been pretty amazing in keeping up with us, a fair number of our team use it. Even more exciting is upcoming tooling integrations we'll get from Typescript - there's a cool GIF in this issue tracking the work https://github.com/Microsoft/TypeScript/issues/6508