Live data from Hacker News

Angular 1 and Angular 2 integration: the path to seamless upgrade

angularjs.blogspot.com

51–60 of 102 posts

Re: Angular 1 and Angular 2 integration: the path to seamless upgrade

#51
post #47

One of the biggest benefit of Angular is the vast amount of libraries built on it, like bootstrap-ui and ui-grid to name a few, how can we switch to Angular 2 until the most adopted ones don't switch too? (real question)

Depends on how brave you are, really.

While a lot of the development community will likely be tracking 2.0's development and working to release libraries not long after 2.0 releases...2.0 is effectively a 1.0 release all over again, so it's a matter of production-readiness not only where community support is concerned, but with itself.

I'm waiting to see where things shake out on all sides after a few releases before really judging anything. We'll still kick the tires on our team here in the meantime.

Re: Angular 1 and Angular 2 integration: the path to seamless upgrade

#52
post #15

See , that's how you manage an open source project , you listen to your community , and yes people can have relevant suggestions. Angular JS became successful because of its pragmatism but also because it allowed more than 1000 people to contribute to its core, not because it was a "Google project" . Everybody knows what other project i'm talking about.

I think Polymer is in Google's strategic plan and will be in much more limelight even going forward.

Polymer is a pain to use by comparison to practically everything. My understanding is it's meant as basically just a comparability layer.

Re: Angular 1 and Angular 2 integration: the path to seamless upgrade

#53
post #8

Earlier quoted context omitted.

I don't know that "semantic" is what you mean here. Semantics in HTML is about exposing the meaning of content through the DOM. Adding data-binding via attributes doesn't change that at all. Name still encodes just as much semantics as Name I think what you might have meant, as mariusmg mentioned in a sibling comment, is "separation of concerns"? Personally I think that has diminishing returns as your application get…

I think it's more like "syntactic" then semantic. Is syntatically valid HTML, although ng-model may not be a legal attribute name in standard HTML. On the other hand: Isn't even syntactically valid HTML. It kind of rubs me the wrong way too, although I don't know if it matters in practice, although I'm not sure it doesn't either. It does seem ugly.

Others have pointed out that it is in fact syntactically valid HTML. It's also worth mentioning that this is syntactic sugar, and you can get the same behavior with:

  
Similarly, property bindings surrounded by brackets "[myprop]" and event bindings surrounded by parens "(myevent)" are equivalent to the following:

  
All of angular2's template syntax can be replaced by more normal-looking tag properties with "reserved" prefixes that tell Angular what to do with them.[0] The less verbose symbols are probably easier for the eye to parse than the long forms once you're used to them, and either form can be easily analyzed and highlighted by an IDE.

[0]http://victorsavkin.com/post/119943127151/angular-2-template...

Re: Angular 1 and Angular 2 integration: the path to seamless upgrade

#54
post #43

Seeing a lot of comments about how Angular had no migration plan. Migration was discussed at length at ng-conf back in March, including a large portion of the keynote(s). They made it very clear a smooth and simple migration was top priority. Part of migration talk in keynote: https://youtu.be/QHulaj5ZxbI?t=12m43s Full playlist: https://youtu.be/QHulaj5ZxbI?list=PLOETEcp3DkCoNnlhE-7fovYvq...

Yes, it is a considerable frustration. At the beginning, the Angular team said something along the lines of "we are working on a Angular 2, after we figure out how it should work then we will consider migration and come up with a plan". For some reason this was widely interpreted as "there will be no migration plan".

Re: Angular 1 and Angular 2 integration: the path to seamless upgrade

#55
post #31
post #15

See , that's how you manage an open source project , you listen to your community , and yes people can have relevant suggestions. Angular JS became successful because of its pragmatism but also because it allowed more than 1000 people to contribute to its core, not because it was a "Google project" . Everybody knows what other project i'm talking about.

What other project are you talking about?

Dart?

Re: Angular 1 and Angular 2 integration: the path to seamless upgrade

#56
post #39

The dramatic shift from version 1 to 2 is generally a sign of design mistakes. Angular 1 should have been angular beta.

Browsers and JavaScript have changed quite a bit since 2009. You couldn't have created something like Angular 2 6 years ago or even 2 years ago for that matter. Angular 2 is possible today thanks to technological advancements.

For example?

Re: Angular 1 and Angular 2 integration: the path to seamless upgrade

#57
Every time I use Angular it feels like it's doing things the right way and it's becoming the Rails or Django of the JavaScript world. Wish I had fought to use AngularJs directives and $resource instead of messing about with ReactJS and jQuery ajax calls.

With this migration plan it seems silly not to keep hacking with AngularJS 1.x

Re: Angular 1 and Angular 2 integration: the path to seamless upgrade

#58
post #6

For the curious, this is the official repository for the ng2-to-ng1 engine: https://github.com/ngUpgraders/ng-forward

ng-forward contributor here: that is not the ng2-to-ng1 engine. ng-forward is an Angular team sanctioned library for eventually enabling Angular 2 syntax in Angular 1. It shares a lot of goals with what is outlined in today's announcement but is more catered for teams that want to start an app today with the quickest possible migration strategy. The code for the ng2-to-ng1 engine (called ng-upgrade) is either not pub…

Ahh, I was mistaken with what I saw in the gitter then - thanks for correcting me!

Re: Angular 1 and Angular 2 integration: the path to seamless upgrade

#59
post #30
post #22

Earlier quoted context omitted.

Two way data binding is awesome and neat and shiny and chrome. It's also pretty slow; a lot of pragmatic angular work involves keeping the number of watchers firing during digest cycles minimized. If you have a lot of data that's all two-way-bound by default, but aren't making any use of the bindings, that's a lot of wasted cycles. I mean, my app has a lot of data in it, stuff like {{username}} which rarely ever chan…

I think two-way binding going by the way side because developers are tired of having to deal with unintended loop backs. You start having to add weird flags to your data to indicate that data changes were the result of user actions and not changes from the backend to avoid endless event loops. Two-way binding results in more code that's buggier whereas one-way binding with actions results in much more organized and u…

I'm thinking that's a framework-specific or coding-style issue? From using a number of frameworks, I've virtually never had issues with endless loops. Perhaps it helps that frameworks like Knockout, etc don't trigger change events when the value is the same.

Re: Angular 1 and Angular 2 integration: the path to seamless upgrade

#60
post #22
post #19

I see 2-way data-binding is mentioned here and will still be supported (good). Curious why has 2-way now become 'uncool' recently, e.g. React? 2-way is what got me excited about client side JS due to the code reduction in an average app. Is just that Angular 1's implementation was non-performant? (lots of other frameworks use it as well, e.g. Knockout, RactiveJS, etc).

Two way data binding is awesome and neat and shiny and chrome. It's also pretty slow; a lot of pragmatic angular work involves keeping the number of watchers firing during digest cycles minimized. If you have a lot of data that's all two-way-bound by default, but aren't making any use of the bindings, that's a lot of wasted cycles. I mean, my app has a lot of data in it, stuff like {{username}} which rarely ever chan…

> Two way data binding is awesome and neat and shiny and chrome. It's also pretty slow;

No it's not, Angular's implementation of two way data binding is slow; dirty checking is what's slow.

Post reply on HN