r/angularjs • • Dec 15 '15

Angular 2 Beta is here!!

http://angularjs.blogspot.com/2015/12/angular-2-beta.html
97 Upvotes

46 comments sorted by

10

u/[deleted] Dec 16 '15

This is awesome.

I really like what I have seen so far of Angular 2.

I have a couple of concerns though:

==

The upgrade path seems very messy.


Earlier on in the development of Angular2, there basically wasn't one.

The advice was to componentize your 1.x app, and that would make it easier to upgrade to 2.

This is what I did, and I know other Angular devs who did the same thing.

The thing is, I feel as though this was the right advice!

I now have an Angular 1.4.x app which I feel as though I can rewrite in 2.x, without too much pain, having followed the early advice of rigorous componentization (although time will tell).

I think that creating a new project for your 2.x version and actively developing it, while putting your 1.x app into maintenance-mode, is the correct advice here. Especially if you followed the advice given earlier on about componentization.

Instead what we seem to have is a system where you load Angular 1.x alongside angular 2.x, alongside a third bridging library potentially, and upgrade gradually.

That is at least one more, fairly heavy (even when GZipped) HTTP request when anybody lands on your website. It also makes everything much less simple, and I have the impression that many developers will begin to upgrade their apps, but never really see it though, leaving them in a bit of a limbo, which really bothers me.

2.

The name!


Because it has very little in common with 1.x, I feel as though it should have been given a new name.

3.

3rd party libraries.


This follows on from point 2.

When looking for 3rd party libraries, especially the less well known ones, it is going to be really unclear which libraries are compatible with 1.x, which with 2.x, and which with both!

Both frameworks are incompatible with each other, but yet a search for angular markdown editor, for example, will in the future return a mix of results for Angular 1 and 2. I can see a lot of developers finding this frustrating (especially new ones) and eventually throwing in the towel and giving up.

4.

Third party libraries (again).


Another point about third party libraries is that there are a lot of them, and many of them are really good, and essential to our apps.

I know that the team behind Angular Directives for Bootstrap are working on a version for 2.0 which is awesome, but what about other 3rd party libraries, such as TextAngular, or Angular UI Router, or the many many more?

When a really good 3rd party library is a key part of your app, but the project is a bit stagnant on Github, it makes upgrading to 2.0 that much more difficult.

5:

Routing


What is the deal with routing in the beta? I have been following the development quite closely of Angular 2.0 and I don't have a clue, can somebody bring me up to speed on that?

That is all

Just wanted to share my concerns as a regular Joe AngularJS developer.

In general I think it looks great, very excited to dive into TypeScript, and happy to see that a lot of the more cumbersome aspects of 1.x are gone, but still a few key concerns.

Cheers

1

u/meenie Dec 16 '15

With regards to upgrading, have you looked at the new tutorial that was recently published? https://angular.io/docs/ts/latest/guide/upgrade.html

2

u/elprophet Dec 16 '15

2

u/[deleted] Dec 16 '15

Yes, cool, thanks!

IIRC they started off with one router early in development, and then dropped it after a while?

1

u/elprophet Dec 16 '15

There were early plans to create a separate router component to work with both 1.x and 2.0. That was dropped in favor of just having 2.0 understand how to interoperate with 1.x components.

13

u/NYKHouston43 Dec 15 '15

This is pretty cool. I'm more inclined to mess with Angular 2. I'm still waiting on something like Angular UI Bootstrap to come along. Hopefully the Angular Material for Angular 2 gets a beta or something.

9

u/RICHUNCLEPENNYBAGS Dec 16 '15

Hm, it's interesting to see someone like it. I personally found Angular-UI Bootstrap too "clever" and got rid of it (like, it was guessing wrong what I wanted and I was spending more time wrestling it than just making a simpler directive myself).

3

u/elprophet Dec 16 '15

Angular Material is at a 1.0.0 release. They intend to continue expanding the components in the 1.x branch, and concurrently are beginning work on a 2.0 branch to rewrite them in Typescript & Angular 2.

1

u/C14L Dec 18 '15

No Dart?

1

u/elprophet Dec 18 '15

The Angular team writes in Typescript. They use a ts2dart transpiler to emit Dart output. So, yes, it should work just fine with Dart.

2

u/Necator Dec 16 '15

Angular Material 1.0 is now available - just in time. Maybe worth a try with Angular 2 Beta.

http://angularjs.blogspot.de/2015/12/angular-material-10-now-available.html

1

u/jeffwhelpley Dec 16 '15

We have the guys working on ng-bootstrap (for Angular 2) on Angular Air January 5th: https://plus.google.com/u/1/b/104335210120652090229/events/cn6og48n6l1s070im5b5qjac7ts

6

u/[deleted] Dec 15 '15

Hide your kids hide your wife

20

u/akujinhikari Dec 15 '15

<kids ng-hide="true"></kids>

<wife ng-hide="true"></wife>

24

u/synalx Dec 15 '15

Nope, now it's:

<kids *ngIf="false"></kids>
<wife *ngIf="false"></wife>

:)

3

u/akujinhikari Dec 15 '15

Was gonna actually type that, but I wasn't sure if anyone would get it yet. ha ha

1

u/Xerxero Dec 16 '15

Are you sure about the *

1

u/synalx Dec 16 '15

Indeed.

<kids *ngIf="false"></kids>

desugars to

<template [ng-if]="false">
  <kids></kids>
</template>

which is how NgIf works in Angular2. The template is rendered or not depending on the expression.

5

u/joshmanders Dec 15 '15 edited Dec 15 '15

I'm just not liking the way they're going. I understand that TypeScript is cool, but they're going in the wrong direction. They had a clean slate with Angular 2, and they're not making smart moves in my opinion.

Look at this boilerplate, just to get a simple Hello World app up on Angular 2 TypeScript, Angular 2 ES2015, and React.

/*
 *
 * Angular 2 "Hello World" TypeScript Application.
 *
 */

import { Component } from 'angular2/core'

@Component({
    selector: 'hello-world',
    template: '<h1>Hello World</h1>'
})
export class HelloWorld {}


/*
 *
 * Angular 2 "Hello World" JavaScript Application.
 *
 */

import Angular from 'angular2/core'

const AppComponent = Angular.Component({
    selector: 'hello-world',
    template: '<h1>Hello World</h1>'
  })
  .Class({
    constructor: function() {}
  })


/*
 *
 * React "Hello World" ES2015 Application.
 *
 */

import React from 'react'
  
export class HelloWorld extends React.Component {
  render () {
    return <h1>Hello World</h1>
  }
}

This bothers me a lot, because I love Angular 1.x and I'm not sure I can bet on that by the time 1.x is no longer supported, 2.x will not be so boilerplatey. I may be going to React.

Edit://

And React Stateless Components can make that even smaller boilerplate:

import React from 'react'

const HelloWorld = () => <h1>Hello World</h1>

9

u/Redditisshit11 Dec 16 '15

Agreed, but to play devil's advocate, its because they're making angular2 more focused on large scale apps and trying to make it as modularly defined as possible.

5

u/AbsoluteZeroK Dec 16 '15

Exactly. It's the same reason to love/hate java. So much boilerplate, but modular as fuck. I can see Angular2 being loved by the big enterprise level type places for the reason they love java.

1

u/joshmanders Dec 16 '15

I'm not sure how the difference between a React component is less modular than an Angular2 component.

2

u/ogrechoker Dec 15 '15

I think react is great, but personally I think framework "boilerplate" is actually pleasant. Ember is awful (sorry wycats) because it tries to hide so many things from you.

5

u/vinnl Dec 16 '15

The main reason React has little boilerplate is not because it hides things from you, but because it does a lot less/has a more focused purpose.

1

u/codemuffins Dec 16 '15

Nice. Can't wait to mess around with this. Hopefully the docs got better.

1

u/[deleted] Dec 16 '15

The Tour of Heroes tutorial is only half finished. Has anyone gotten the as-yet-unlinked page 3 of the tutorial working? Specifically the hero-detail.component? Is there a Git repo that has the whole thing working?

1

u/gbajere Dec 22 '15

I personally think we will just start new projects in 2.0 in a years time.

Having an app that's half 1 and 2 will cause lots of development pain and hold ups, imo... Easier to just stick to 1. If the app will still be around in 3 years time, then plan for a full re-write. With that said, lots of businesses won't be happy about paying new money for old rope.

Also, the guy that pays the dev bills will hit the roof if you tell him the £200,000 they just spent on the app is now dead, and we are rewriting it all as 2.0 is out. Google have money to throw down the pan, and start projects to just throw in the bin, but everyday business do not. Ultimately, the business will decide if this takes off, not devs who want to use something as its 'new cool'.

I'm going to look into 2.0, but i cannot see me using it for anything real until 2017... I'll probably learn and land a React project before a 2.0 one

1

u/dmackerman Dec 15 '15

Looks like they updated the docs quite a bit. Nice!

-4

u/ihsw Dec 15 '15

Wow, my hatred for Blogspot knows no bounds.

7

u/Poltras Dec 15 '15

Have you tried focusing on the content instead of the container?

-1

u/KyleG Dec 15 '15

The medium is the message, homedog.

0

u/db__ Dec 15 '15

Marshall McLuhan called

1

u/KyleG Dec 16 '15

Oh, no shit? You mean I didn't just invent that really famous aphorism?

0

u/[deleted] Dec 15 '15

[deleted]

2

u/synalx Dec 16 '15

It means that when we do breaking changes, we will do them via a deprecation process if at all possible.

0

u/SulfurousAsh Dec 15 '15

Certainly not.. While "closer to stable", there will still be backwards incompatibilities ahead on the road to a full 1.0 release.

0

u/[deleted] Dec 15 '15

[deleted]

3

u/RICHUNCLEPENNYBAGS Dec 16 '15

I haven't spent a lot of time with it yet, but overall I agree with you. Great, the tutorials all look nice. I'm less convinced with a real application where you have to deal with more complicated issues, and I just don't see what Angular 2 is offering that 1 is not that I really care about.

2

u/SergeiGolos Dec 16 '15

Speed? If nothing else. At the end of that video, there is a Angular 2 example that blows away the performance of the hybrid solution.

1

u/lax4mike Dec 16 '15

Make sure you watch to the very end of the video...

https://www.youtube.com/watch?v=XQM0K6YG18s&t=17m38s

1

u/RICHUNCLEPENNYBAGS Dec 16 '15 edited Dec 16 '15

I understand that Angular 1.x is slower. But in practice I've rarely had any issues with performance in Angular. I'm more concerned with speed of development than runtime speed (within reason obviously).

2

u/Mael5trom Dec 16 '15

The nice thing (as pointed out in the post) is that you can start using v2 for new work in your v1.x app. And then you can rewrite 1.x pieces as time permits, while continuing to build 2.x+.

There really are some things that v1.x doesn't do well. I really like v1, and I will probably continue to use it for quite a bit longer, but I will switch to 2.0 at some point, and be glad to do it.

2

u/vinnl Dec 16 '15

Eh, Angular 1.x was set to fall to the wayside anyway. Angular 2 is a reasonable attempt to stay relevant, and time will tell whether it'll be enough, but only developing Angular 1 isn't a serious option.

2

u/[deleted] Dec 16 '15

1.x is just fundamentally flawed.

3

u/CarlFarbman Dec 16 '15

Can you elaborate on that? Im fairly new to angular.

1

u/cactussss Dec 16 '15

saying that it's "fundamentally flawed" is a huge overstatement. There are known issues, and just like @RICHUNCLEPENNYBAGS points out - "There are known ways of coping with [them]"

1

u/RICHUNCLEPENNYBAGS Dec 16 '15

There are known ways of coping with all of its issues. That is obviously not true of Angular 2.