Does Angular 2 live up to the hype?
cycligent.com
cycligent.com
We're using it for an internal app at walmartlabs and its been great coming from angular 1. Working with angular-cli today is very stable and fully featured. I published a quick test module yesterday using angular-cli https://scttcper.github.io/ng2-adsense/ after gzip its small even with all of bootstrap v4's css included. It sounds like with ahead of time compilation we could see even faster first paint times combined with lazy loading of routes and modules it should be very fast even without using angular universal.
Typescript is good, but I don't like tslint. I'm excited to see if eslint support for typescript goes anywhere: https://github.com/eslint/typescript-eslint-parser
One thing I haven't decided yet is what to use to build the "pre-login pages". The SPA itself will be only accessible after a login page, but before login there will be a bunch of pages (Home/Blog/Help/etc..). Should I use Angular for those pages as well?
In angular this is usually achieved by watching for state/route change events and deducing whether or not a route should be redirected or allowed to progress based on the status of the currentUser.
It sounds a little hairy but in my experience there are ample resources detailing the process and realistically it's about ~30 LOC.
Module loading is easy.
Template expressions are powerful.
Typescript is actually pretty cool. You don't use it very much at first and aren't required to.
It saves a lot of time to use something that just works. I spend much less time wading through blog posts and fringe git repos to do simple stuff.
Overall though I love the framework and will def be my go to for front-end apps. Typescript is a huge plus. Lovely dev experience now that it's stable.
I am aware that it is possible, but I've yet to read anything about someone really living with that. Everyone just talks about rewriting all code from scratch, which we're just not going to do.
[1]: https://github.com/Urigo/meteor-angular-socially/blob/step_1...
[2]: https://github.com/Urigo/meteor-angular2.0-socially/blob/ste...
IMO neither of those examples are good benchmarks for Angular 1 or 2 because they have boilerplate for interop with MeteorJS. Plain Angular2 is much cleaner FWIW.
For the most part, its pretty straightforward. Unfortunately, if your ng1 code still uses ng-controller extensively, you'll probably be stuck at the rc4 release of Angular 2. Everytime I've tried to upgrade past that point, none of the controllers initialize.
Aside from that and the inability to mix attributes and directives from different versions, I haven't really dealt with any major problem upgrading. For any services you have which are returning promises instead of observables, I highly recommend creating a re-usable adapter class as it allows you to drop-in replace legacy implementations with new observable based services without changing the consuming ng1 code.
I personally like the framework though.
For more differences, consider this (likely biased) comparison: http://vuejs.org/guide/comparison.html#Angular-1
Aurelia stays out of the way and sticks to web standards, it has been a joy to work with.
Of course the more important question is how soon it will be abandoned. Considering Google is currently advocating Web Components with Polymer as the future of the web (google "PRPL" for the details) I think Angular 2 is technically dead on arrival.
However Google has a tendency never to settle on a single solution (see TypeScript vs Dart vs Go, Hangouts vs Allo vs Duo, Android vs ChromeOS and even Orkut vs Google+). So they will probably keep Angular around until they come up with something new.
That said, Google has a tendency to yank out support as they see fit in the name of progress (e.g. how Angular 1 dropped IE8 support on the spot). So I wouldn't expect any obvious warning signs in advance to Angular 2's eventual demise.
For me, imho React + Redux + fetch api go a really long way to get you there, combined with material ui, or react-bootstrap with react-icons you're all but set for getting started. The boilerplate can be painful at first.
I found getting Angular up and running (before their cli) was really much more painful... It's gotten better. I just don't like the indirection and the angular templating dsl. I find JSX and feature organizational structure much easier to accomplish and grow with in React. I find that Redux is a great middle ground for a unidirectional state management paradigm (combined with async functions and redux-thunk). Redux has some more cognative overhead in getting started, but once you have it, growing it is all more of the same, instead of leading to a path of spaghetti.
I don't think TFA really answers if it lives up to the hype, I think the hype has died down at this point, and a lot of people are wanting to move on.
The functional approach via Redux is what a lot of people look at, but I prefer to look at the developer tools and the state of debugging.
JSX is easier for me to debug since you can just drop breakpoints in your javascript and step through with the debugger. This encourages more vanilla javascript usage, which is easier to debug and reason about.
That's not to say that React isn't great too! I like it lot.
On the bright side, if you don't mind diving one layer below the surface, the code for react-router-redux is short, well written, and easy to understand: https://github.com/reactjs/react-router-redux
Even if the equivalent already exists for the current iteration, you could probably write your own in an afternoon without rushing yourself too much.
If I have to use ng2 again will take the time... aside, I really wish they'd renamed it to Angular 3 (3.0) for release, given the massive changes to "Angular 2" over its' lifetime and the number of broken blog articles and tutorials...
Angular 2 is an entire platform while React is a library for building UI components.
You can also combine React with an Angular 2 app if you wanted to.
The answer here is use the right tool for the job - both are great.
That's probably why people are so confused. They might not be an exact comparison, but you use them both for the same purpose, building responsive, data-driven websites.
Or should we just use JQuery until the dust settles?
You should read the official tutorial on the React website [1], it take like 1 hour and you will know everything about React (the API is incredible simple). Then start your app with the official Create-React-App [2] (it installs for you a webpack/babel configuration and a fetch polyfill, so you can use out-of-the-box JSX, classes, import/export, async/await, a cross browser fetch for your AJAX calls, etc..). You don't need Redux, but probably React-Router if your app has several pages.
And that's it! The React/Babel/Webpack stack has completely changed how we develop web applications. And with Create-React-App you avoid all the boilerplate.
It's pretty tedious creating components without it. Plus as you mentioned if you create a base component than the derived component's don't need the declare some dependencies again.