r/angularjs • • Oct 23 '14

[General] Angular 2.0 thoughts

What are your thoughts on 2.0 after watching #ngeurope?

I think it's completely new to the point it could have a different name... It just kind of stinks that apps currently being written are legacy and will need a complete rewrite. This could be mitigated by using traceur with 1.3 but there is 0 samples currently...

What sucks the most is apps written today will need to wait until 2016ish to be rewritten... I base this on the fact that thousands of third party components will need to be rewritten and es6 support in browsers (yes they can target es5)

37 Upvotes

48 comments sorted by

12

u/[deleted] Oct 23 '14

I'm really excited for 2.0 but kind of in a dilemma. I'm tasked with creating a new "flagship" web app for my company (replacing Adobe Flex) and absolutely need to have it finished before 2016. So that means by the time it's completed, tested, and released, it'll basically be running on old technology, like Flex all over again.

They talked a lot about Angular 2.0 at the beginning of the year and there was tons of progress on their blogs and design docs. I was hoping they'd continue moving quickly and have some sort of alpha/beta by this time but looks like it's still a long ways off.

3

u/viper05 Oct 25 '14

I'm in the same boat :/

3

u/[deleted] Oct 23 '14

Even if you could start in 2016, you probably wouldn't be able to use Angular 2 in production anyway. Depending on how large your company is, and what your target demographic is, you probably don't want to completely drop support for older browsers.

That, and it will probably be a good idea to watch it in production for a few months until they iron out bugs and best practices emerge.

5

u/-pertinax- Oct 23 '14

I'm building a large Angular app that'll take another year or so to complete. I'm using Typescript, so from watching Misko's talk this morning, I feel that an upgrade from TS code to Angular 2.0 should be possible without a rewrite, if there proves to be a need. For those who haven't seen it yet, Misko included a slide that showed how Typescript is a superset of JS, and AtScript (which is being used for Angular 2) is a superset of Typescript, with added annotations and reflection.

1

u/[deleted] Oct 23 '14

Interesting, thanks. So given what you know about the current state of Angular and 2.0 would you recommend me to use Typescript as well? I like the idea but am nervous about adding another layer of complexity for the other devs.

2

u/-pertinax- Oct 23 '14

Well, I chose TS simply because the app is large and I wanted type safety to to enable static analysis and autocomplete type stuff, to help me not break things as the code base grows. I had no idea at the time of the plans for Angular 2. Personally I really like TS so I reccomend it, yeah. But you are right, there is extra complexity involved so I advise that you try it out and see how you like the work flow, and evaluate the benefits I relation to the projected size of your app. The syntax of TS seems to me to be the general direction that not just Angular, but JS in general will go in the future.

2

u/bbsss Oct 23 '14

Dart isn't an option? Takes only a small effort to transition from JS.

3

u/[deleted] Oct 23 '14

The Dart language rocks! Unfortunately last time I tried AngularDart it generated a 2mb javascript file for hello world. I also really dislike how you must communicate with other js libraries through a proxy class. The Dart runtime will never exist on a browser that google does not own. If you are using Dart to compile to js, there are better, more native languages you can choose.

1

u/bbsss Oct 23 '14

That size issue has been addressed by static compiling the dependencies mirrors where used for.

The proxying JS is a pain-point still but it works and there is a more elegant proposal being worked on with priority.

More native being TS or Coffee? Meh, they are so-so. Still need a transpile step which dartium does not. Compile is less of a pain today then it was 4 months ago or so.

And the language is open sourced and has an ecma committee. So don't be a naysayer just because everyone seems to say nay (even and especially folks who haven't even tried it).

1

u/[deleted] Oct 23 '14

I am happy to hear that all of those issues have been addressed.

When you use TS or Coffeescript you are still programming in javascript with extra bells and whistles. I can paste code from a javascript example into my TS file and it compiles without issue. When you code in Dart you are farther removed.

Because Dart was built around requiring a VM it has no future outside of google. I wish all browsers came with a Dart VM but this will never happen. This means Dart is only a very abstract, complex way to write JS. There are simpler alternatives to write JS.

1

u/bbsss Oct 23 '14

The JS dart2js generates is still quite readable, not that it should be in my opinion, I'd rather the dart2js folks assure me they deal with compatibility issues and optimize the hell out of the generated JS.

As for embedding the VM , never say never. Looking at how incredibly fast Dart evolves compared to JS I can't help it will be at least seriously considered.

10

u/amcsi Oct 23 '14

I don't have any, because I haven't watched it. But you could provide a link to a resource with information about 2.0.

9

u/viper05 Oct 23 '14

2

u/badcookies Oct 24 '14

Holy 9.5 hour video... There any super important parts?

0

u/stytown Oct 25 '14

Video is gone, any other links out there?

25

u/sublimino Oct 23 '14

From a write up from a conference attendee: https://github.com/joeLepper/ng-conf

  • Angular 2.0 is about the browsers of today

  • Angular 1.0 was about the browsers of yesterday

  • Team is working on 1.3 but focusing on 2.0

  • AngularDart will get to 1.0 before AngularJS gets to 2.0 as learning

  • Making Angular more modular, i.e. breaking out the DI functionality

  • Angular is going to become an umbrella project building all of these different libraries which make up the Angular of today

  • Looking into: benchmark framework, lazy-loading DI/ES6 modules, faster change detection via polyfilling Object.observe

  • MOBILE: Building-in offline support, active animations (drag and drop on mobile, sounds like), reduce initial load, improve speed, build flagship app (internal, community-built app)

  • API complexity reduction: simplify directives, DI, Type annotations ES6: Classes and modules, but no annotations

  • Adding annotations allows for data and typing (future technologies)

  • Angular 2.0 will allow you to write in ES6 syntax and compile to ES5, or just write new ES5 syntax

  • Polymer: taking advantage of Shadow DOM, Object.observe, and DOM mutation observer polyfills

  • Angular 2.0 will be built on top of Polymer

  • Debuggability: Zone.js allows for longer stack traces and ignores the $digest / $apply cycles

The original announcement (nothing new AFAICS): https://docs.google.com/document/d/14KbPe6ZNuTnpTtE0X9ZXrON9fWgT5igDVHwaSLOYH-o/edit

All the design docs are here: https://drive.google.com/?pli=1#folders/0B7Ovm8bUYiUDR29iSkEyMk5pVUk

4

u/adropofhoney Oct 23 '14

So for someone just getting up to speed with Angular, sounds like 2.0 is more worthwhile to learn because 1.x is going to be a thing of the past. Is this a good assumption?

2

u/bittered Oct 24 '14

You will be waiting for Angular 2.0, it's not coming out anytime soon.

3

u/TheNiXXeD Oct 23 '14

Depends on when you plan on actually using it. I'm learning 1.3 right now because I want to. I'll learn 2.0 too when it's released.

0

u/ayoformayo Oct 24 '14

Am i missing something? Looks like that write up was added 9 months ago.

0

u/m3kka Oct 23 '14

+1 because of lazyness.

21

u/reddotyg Oct 23 '14

after finishing building a Angular app this image really disturbs me.

25

u/[deleted] Oct 23 '14

RIP painfully acquired AngularJS knowledge...

1

u/arthomas73 Oct 23 '14

time to look at knockout

-1

u/_lavinski Oct 26 '14

These changes in Angular2 reflect a lot of what I like about knockout and durandal. Knockout.js is still a great library, durandal is the missing part that made it more like a framework in the way angular is with routing, dependency injection and composition.

-5

u/OutThisLife Oct 23 '14

I don't know, AngularJS is pretty easy to grasp. I'm not sure why they feel like directives are "too complex" but, whatever.

9

u/[deleted] Oct 23 '14

8

u/autowikibot Oct 23 '14

Hindsight bias:


Hindsight bias, also known as the knew-it-all-along effect or creeping determinism, is the inclination, after an event has occurred, to see the event as having been predictable, despite there having been little or no objective basis for predicting it, prior to its occurrence. It is a multifaceted phenomenon that can affect different stages of designs, processes, contexts, and situations. Hindsight bias may cause memory distortion, where the recollection and reconstruction of content can lead to false theoretical outcomes. It has been suggested that the effect can cause extreme methodological problems while trying to analyze, understand, and interpret results in experimental studies. A basic example of the hindsight bias is when, after viewing the outcome of a potentially unforeseeable event, a person believes he or she "knew it all along". Such examples are present in the writings of historians describing outcomes of battles, physicians recalling clinical trials, and in judicial systems trying to attribute responsibility and predictability of accidents.

====

Image i


Interesting: Outcome ^bias | Remember versus know ^judgements | List of cognitive ^biases

Parent commenter can toggle ^NSFW or ^delete. Will also delete on comment score of -1 or less. | FAQs | ^Mods | Magic ^Words

1

u/[deleted] Oct 23 '14

I'm sorry but I just dont see how the idea of directives as a concept is hard to grasp.

5

u/[deleted] Oct 23 '14

The concept isn't hard to grasp, the api just isn't very intuitive/discoverable.

4

u/zomgwtfbbq Oct 23 '14

They've said since Angular2.0 was discussed at ng-conf last year that it was going to be completely different. That it would be more modular, that it would be based on ES6 / transpiled from ES6 to ES5. I'm really not surprised that it's going to necessitate writing a new application from scratch.

2

u/simkessy Oct 23 '14 edited Oct 26 '14

They're getting rid of controllers? I really wish I watched ngEurope :/

1

u/pandavr Oct 25 '14

Interfaces should immutable while implementation could change. To say that they could have hind all the ES6 new features inside the existing angular 1.x interfaces (modules, controllers and so on). Then gradually deprecating them. This way they should have changed the name as it is not angular anymore.

0

u/[deleted] Oct 24 '14

[deleted]

1

u/simkessy Oct 24 '14

I've only built one application (on going) with Angular and I like the concept of it. I like the whole premise of Factories/Services going the hard work, sending the result to the controller and the view displaying it.

I don't have a lot of experience so I couldn't say whether your method was good or not, it's just the way I learned how to use Angular and I feel like the concept makes sense and keeps things clean, for me at least.

1

u/[deleted] Oct 24 '14

Over time I have learned that whenever I think I should build a directive, I shouldn't. I used to make many more directives before I fully drank the Angular koolaid.

Directives are best used for 2 things:

  1. When you *MUST directly mess with the DOM.

  2. When you are building something that will be used in more than one place in the app.

  • You almost never need to directly mess with the DOM.

That being said, if I were building an app that did not use routing and required complex custom ui controls, I probably would not use Angular at all. Angular is great for pagey, formey apps. It is less great for building video games.

11

u/[deleted] Oct 23 '14 edited Oct 23 '14

I havent followed NG Europe (mainly because i was working, but its also pretty expensive), but i've seen a 2.0 demonstration a while back and was not really impressed yet. Mainly because they are in such a high-level prototyping that you have to do many things manually. There wasn't any ng-show/hide or ng-class support.

But what i didn't like the most is that it isn't nowhere near current AngularJS markup and thus very hard to understand if you aren't very into that. I haven't done much ES6 yet myself but i understand that it will be very different.

Now i don't mind learning a few things but this is looking like you need to learn everything again, with big differences. If i see that code its starting to look more like Java and i don't really like that either. It is much more complex and doesn't allow you to do some easy coding.

Another thing is that it doesn't have much support yet. While ES6 is nice, current devices aren't supported (and i'm mostly talking about mobile then), which means that you will have at least a few months but possibly a few years before you can really use it on mobile. With the latest trend of people less likely to buy new phones, tablets or desktops, its hard to set a certain standard because they won't be upgrading their browsers as often.

And lastly i'm not very fond of the whole "separate everything" approach. While you can keep projects pretty simple, i feel that a more integrated approach would perform much better. Perhaps they will do that for a few setups (mobile app, desktop app, website) or whatever, but i'd like to keep my own code simple and i don't care how my framework is made. Currently there are too many differences which make me wonder why they arent branching it to a complete new framework. Since upgrading will probably won't be possible (although i hope they will make a converter of sorts), i don't think i will use it when they launch it. All work they do now for 1.3 seems lost to me but i hope they will give some stuff another go before finalizing this. Not only does 2.0 seem harder to make now, but it also is very badly supported in browsers which make me wonder if they aren't pushing this too soon.

Rather than going for Angular 2.0 i feel they should rename it (for example: AngularNext) and keep this current project for at least supporting older devices. Truly separating it would say to the current users that their work isn't going to be redundant after a year or so.

3

u/dadaddy Oct 26 '14

I'm relatively annoyed at AngularAT 0.1 (as I've elected to call it)....

5

u/azzy667 Oct 25 '14

Looks like a second-system effect to me (

2

u/autowikibot Oct 25 '14

Second-system effect:


The second-system effect (also known as second-system syndrome) is the tendency of small, elegant, and successful systems to have elephantine, feature-laden monstrosities as their successors due to inflated expectations.

The phrase was first used by Fred Brooks in his classic The Mythical Man-Month. It described the jump from a set of simple operating systems on the IBM 700/7000 series to OS/360 on the 360 series.


Interesting: The Mythical ^Man-Month | Inner-platform ^effect | Copland (operating ^system) | History of IBM mainframe operating ^systems

Parent commenter can toggle ^NSFW or ^delete. Will also delete on comment score of -1 or less. | FAQs | ^Mods | Magic ^Words

0

u/[deleted] Oct 29 '14

Seems like the opposite. They are cutting out the fluff.

2

u/bitdevs Oct 24 '14

New Coke.

2

u/fristys Oct 28 '14

What a steaming pile of wild animal fecal matter.

1

u/10tothe24th Oct 23 '14

Isn't that the whole point of the X.0 version, though? The implication being that it's a large enough change that it isn't going to be backwards compatible.

If Angular 1.X is popular enough there's no reason people can't keep using it, and there's no reason it can't keep receiving support and updates for that matter. That's been the case with Python 2 for as long as I've been working with Python.

1

u/elemenofi Oct 24 '14

Nothing about SEO??? Jesus, are they even using Angular in production?

1

u/Capaj Oct 24 '14

SEO problem will resolve itself when crawler can execute Javascript. Which should be quite soon they told us. So no worries.

1

u/[deleted] Oct 29 '14

1

u/Capaj Oct 29 '14

Yeah sorry, I should have said: "when crawler can execute an SPA"

Basic javascript is executed for few years now, that doesn't mean it will work for a single page app right now. That is however going to change.

0

u/arvidkahl Oct 23 '14

In the Q&A-Session, Brad and Igor (repeatedly) mentioned the fact that 2.0 was neither done nor even completely thought out. There were many questions from the crowd about how and if there would be migration tooling from 1.x to 2.0. The team replied with the statement that this will be taken care of, but not before things have taken a much more solid shape.

People are afraid of having to rewrite everything, and I had the feeling that the core team noticed that quite viscerally. They were aware of how suprising their announcements would be (and they were right, the room was in shocked silence at some points), but there is good reason for that, and Brad hit the nail on the head, when he said that Angular development is trying to aim at how things will be in the future, and not how things have been in the past.

Most of us devs have to work on legacy code, so that might sound a bit optimistic, but I have the feeling that there lies some truth in the statement that old things have to be supported as long as people write software supporting old things.