Live data from Hacker News

Angular 2 Final Released

angular.io

51–60 of 452 posts

Re: Angular 2 Final Released

#53
post #23

I have been using Angular 2 for 3 months now and so far have loved it (except for the breaking changes in RC series and updating each time). Glad 2.0.0 is here. Here are the few things I loved, amongst other interesting features: 1. Typescript awesomeness: You can write plain JS or give type hints in Typescript. Typescript is awesome, because it is a superset of Javascript and compiles to Javascript. (Typescript > ES…

We have been using Angular 2 seriously in the past month at my company.

There is a lot of roughness around currently when it came to upgrades during the RCs - Angular 2 was far from full-fledged even during the earlier ones, and has come a long way in the course of their development. Testing has a massive gap in documentation/articles on how to do it right. There are also some pains such as some (IMO somewhat poor) opinionation in the Angular router, especially when combining with server-side routing - had some battles integrating the Angular 2 app with the full server-side app for work, in large part due to hapi's major deficiencies when it comes to delegating routing to a frontend only application. Setting up can be daunting, although I got a large boost from using https://github.com/preboot/angular2-webpack, a great starter pack largely maintained by a member of the Angular docs team. Not all of the benefits are easy to tap into currently, such as the fairly recent AoT compilation, which lacks any plugin support for any build system such as Webpack currently. I intended to write one & open source it, but I was assured by a member of the Angular team that it was on the docket to complete. Documentation also needs a lot of work to be more developer friendly, I have found senior developers making easy mistakes with Angular 2 because they are not familiar with how to structure everything while having to produce on difficult story work. Testing is also a sore point, especially with the need for the karma shim to be produced for each app.

That said, Angular 2 is a phenomenal upgrade over Angular 1 in the ease of structuring apps. It also avoids incorrectly munging everything into components, avoids imperative logic to construct DOM/components, and imposes opinionation & more modern tooling such as the availability of observables to more correctly manage app state & app flow. It is fast, and much easier to tap into optimizations than Angular 1, where one had to be able to work close to the source code in order to understand everything one can and cannot do. It also offers the flexibility to do everything one can do with React, including server-side rendering (with the ability to do so on platforms such as PHP, Java, Node, and .Net in the pipeline), web workers, service workers, and multiplatform apps via React Native or NativeScript.

Re: Angular 2 Final Released

#54
post #48

I evaluated React and Angular 2 several months ago and picked React. Some of the issues I found in Angular 2: The HTML template in Angular 2 is stored in a string. This has several disadvantages: 1. Editors can't do syntax coloring. 2. Editors can't do auto-indenting. 3. Editors can't offer "intellisense" suggestions. 4. Editors can't match tags. You embed variables in this template string like this: ' {{hero.name}}…

The template vs. JSX argument is highly subjective; a lot of people go the other way because language extensions break existing plugins, require extra build tooling, and add complexity.

Re: Angular 2 Final Released

#56
post #48

I evaluated React and Angular 2 several months ago and picked React. Some of the issues I found in Angular 2: The HTML template in Angular 2 is stored in a string. This has several disadvantages: 1. Editors can't do syntax coloring. 2. Editors can't do auto-indenting. 3. Editors can't offer "intellisense" suggestions. 4. Editors can't match tags. You embed variables in this template string like this: ' {{hero.name}}…

Which editors? JetBrains Webstorm has the same things for both Angular2 and React.

https://www.jetbrains.com/webstorm/whatsnew/#v2016-2-angular...

I do agree that I really really was a fan of the backticks for ES6 / react for templating. Avoiding the whole " vs ' escaping nightmare is something i've always looked forward to.

That seems like a very simple fix for them though, potentially.

edit: tone

Re: Angular 2 Final Released

#57

Earlier quoted context omitted.

FWIW as someone who struggled early on with the "How do i use angular with ?" question. It's important to IMMEDIATELY understand that the backend should not matter - so long as it returns JSON (or even XML i suppose) which AngularJS 1.x can consume with $http or $resource (or ng 2.x equivalent). This is an advantageous pattern in my opinion because the front-end angular application is totally decoupled from the backe…

This is great advice! What do you think about routing? angular has it's own router, so can Go have. What to choose?

You don't choose between those two routers, they are not replacements for each other.

At the risk of stating the obvious, the Angular router handles routing for the Angular frontend, the Go router handles routing for the Go backend (the initial page load, the AJAX calls made from Angular to get data...).

Re: Angular 2 Final Released

#58

I expected angular.io to be a flashy example Angular 2 SPA and was disappointed when I realized it was just a regular old static HTML website. I guess most of the content is more suited for a static site. At least the search bar on the docs page looks like it has some Angular going on. Also it would be neat if the docs had dynamic examples instead of screenshots.

But can it compete with this? https://react-bootstrap.github.io/components.html

Opening that link in a new tab beach-balled Firefox for a few seconds. Woof.

Re: Angular 2 Final Released

#59
post #32

Earlier quoted context omitted.

I think ultimately ng-bootstrap* ( https://ng-bootstrap.github.io/ ) will be better, but I'm biased. API signature looks much better than shoehorning everything into components that don't belong there - we have a lot of work to go though, so it currently is still a work in progress. * I am a part of the UI Bootstrap/ng-bootstrap team - we worked on ng-bootstrap starting back in last August/September and have the bene…

Could you elaborate on what you mean by "shoehorning everything into components that don't belong there"?

There seems to be a lot of advocacy for tossing everything into the component tree in the React ecosystem - recently I got linked to a snide remark by Ryan Florence on Twitter implicitly arguing for putting everything in the component tree, including constructs that should have a better separation such as routing (which the tweet appeared to be a reference to).

Some services don't belong in JSX though - this is why you have the idea of stores in Flux/Redux/etc. Some data doesn't make sense to couple to the component hierarchy - doing so makes it very easy to create dependencies on the component tree, which decreases modularity, as well as has perf ramifications by increasing the DOM elements that get rendered unnecessarily by React. Some examples are data models, routing, and interactions with non-element DOM api (window.location, XHR, etc.). This also has a side-effect of increasing difficulty of testing what generally should be vanilla constructs not tied to various frameworks/libraries unnecessarily.

Re: Angular 2 Final Released

#60

I expected angular.io to be a flashy example Angular 2 SPA and was disappointed when I realized it was just a regular old static HTML website. I guess most of the content is more suited for a static site. At least the search bar on the docs page looks like it has some Angular going on. Also it would be neat if the docs had dynamic examples instead of screenshots.

We're all going to get a couple of nights sleep, but that project is in progress and should be out soon. We're making sure it shows off the best of ng2.
Post reply on HN