Live data from Hacker News

Angular 5.0.0

blog.angular.io

111–120 of 189 posts

Re: Angular 5.0.0

#111
post #32
post #14

This rapid pace of major releases is a little scary. We're stuck running Angular 1.x because there's no reasonable upgrade path for us. We're a .NET shop and really like Angular, but after the 2.x cluster fuck, we're now thinking about going with something else entirely.

Angular 2 will not help your team deliver valuable web experiences to customers any more quickly or reliably than Angular 1. Probably almost certainly the opposite. I'd argue most teams, if they're willing to go all-in on an SPA framework (which for most apps is a waste of time and money imo) would be better off with React + TSX. Edit: Vue is probably closer to the "Angular way" with databinding, but component to com…

This is false. Angular 2 is a remarkable improvement over Angular 1. I started off with Angular 2 and Angular 1 code makes me want to barf. Typescript is a major improvement over vanilla javascript.

Re: Angular 5.0.0

#112
post #97

Earlier quoted context omitted.

I don't agree. react-router has changed enough in the last 2 years to throw me off quite a bit when I started a new project

React and react-router are not the same thing at all. They're developed by different teams at different organisations. It's not fair to compare the two.

Of course it's fair. When comparing React with Angular it's only fair to compare the react ecosystem with angular.

Nobody ever built an SPA in production with just React.

Re: Angular 5.0.0

#113
post #14

This rapid pace of major releases is a little scary. We're stuck running Angular 1.x because there's no reasonable upgrade path for us. We're a .NET shop and really like Angular, but after the 2.x cluster fuck, we're now thinking about going with something else entirely.

From a purely technical standpoint, the upgrade path from AngularJS to Angular seems better thought out than some things I've had to handle before - you can run the 2 in one Angular app as you upgrade pieces and there is a whole library aimed at easing some of the annoyances of upgrading. https://angular.io/guide/upgrade

you can't run on aot than (at least if you use the ng cli)

Re: Angular 5.0.0

#114
post #98
post #32

Earlier quoted context omitted.

Angular 2 will not help your team deliver valuable web experiences to customers any more quickly or reliably than Angular 1. Probably almost certainly the opposite. I'd argue most teams, if they're willing to go all-in on an SPA framework (which for most apps is a waste of time and money imo) would be better off with React + TSX. Edit: Vue is probably closer to the "Angular way" with databinding, but component to com…

I'd consider Ember to also be a top choice (if not the top choice) for teams who want to just go all-in on a framework and reap the productivity benefits. From all the frameworks I've tried, it's the one that's allowed me to focus the most amount of my time on actual product code, not plumbing.

Same here! Although it seems that Ember is getting little love from the HN crowd, we are very happy that we chose it for our company two years ago. I would encourage everyone who is looking be extremely productive and don't worry about plumbing too much to take a deeper look into it.

Re: Angular 5.0.0

#115
post #92
post #31

Earlier quoted context omitted.

Angular 2+ is much better than 1 - it fixes pretty much all of the warts with 1. On the flip side, there are some tradeoffs, some that is not quite Angular’s fault, although they’re tradeoffs chosen by the Angular team in designing the framework. Angular doubles down on the component-based model it tried to emphasize in Angular 1. It also is very performant. The main router is much better than Angular 1’s. I haven’t…

That's surprising to me! My main complaints of Angular 2+ are around testing, but I've had nothing but love for React testing (enzyme, chai, karma) EDIT: whoops, mistyped. We don't use karma anymore in our React testing stack. It's mocha now.

Chai and karma aren't specific to react. I remember using them with angular 1.x back in the day.

Re: Angular 5.0.0

#117
post #6

Earlier quoted context omitted.

I love it. It is small if I want to, but it has lots of features if I need them. I don't have to worry about 3rd party libraries, because the official router, forms modules, http client, material components, flex layout etc. are all high-quality. The CLI not only helps with new projects, but also makes testing, linting, building, serving, generating new components/services/etc. easy. Implementing lazy loading with th…

Has testing components become any easier? I remember having to write a lot of boilerplate code every time that I wanted to test a component.

Not really. Testing components is still really a pain: there's lots of boilerplate and the tests are extremely slow. In a medium-size project, they're far too slow to treat as unit tests: I break out all the TestBed stuff into a separate karma integration test config.

Angular is in desperate need of something like Enzyme.

Re: Angular 5.0.0

#118
post #13
post #9

Earlier quoted context omitted.

Dare I say - but you can use Typescript with other frameworks too.. just because it's built in here / there are more resources?

I found especially that working with a project that requires a lot of extra bits to be installed (like the react ecosystem) makes working with JavaScript libraries from typescript especially painful, since you need to get typescript definitions for all of them, and they may not always mesh well together.

You can easily install types from @types these days: https://www.npmjs.com/~types

I believe the latest version of Visual Studio Code can automatically install the type dependencies from the IDE (e.g. a quick fix if the type definitions are missing).

Re: Angular 5.0.0

#119
Woah! static injector and typescript transforms! does this mean i can use angulars dependency injection framework for any typescript project without including any 'real angular' so i can start writing node services like i would with spring!? (or perhaps closer to dagger2?)

Re: Angular 5.0.0

#120

Earlier quoted context omitted.

This is part of what v5 is fixing by enabling AOT by default in development (and production). AOT compilation converts an Angular template to TypeScript that is then type-checked. So on v4+, an `ng build --aot` performs type-checking. But since that's not great developer ergonomics, v5 has included enough performance improvements on AOT that it's reasonable to enable in development (see "TypeScript Transforms"). And…

That's an improvement, but what about syntax coloring, intellisense suggestions and instant squiggly-lines when you make a typo? These are all important for productivity. You get all this when you use .tsx templates (which by the way, are not limited to React, see https://github.com/wisercoder/uibuilder )

As others have mentioned, this is all possible with Angular >=4, both in WebStorm and VSCode. The main issue is with performance and debugging. Using Angular's AoT compilation is still extremely slow and your squiggly lines take several seconds to show up after you modify a template in your editor. And no stepping through templates either when trying to debug why something isn't rendering properly.

But, imho, the biggest problem with Angular, by far, are it's NgModules. You can't just import a component normally and use it in your template. You need to also add it to an NgModule to make it available in the templates of the components inside that NgModule. And if for some reason you stop using a component, you need to remember to clean up the module as well since nothing will warn you about unused declarations or imports in NgModules.

And then there is also the fact that you can't directly import a function/constant and use it directly in the template because, like Components, the template engine needs to be told about it. So you need to add properties to your component class which are just providing access to things you imported above. So. Much. Pain.

Some people really like templating languages but imho just using TSX (which is just mapping to function calls) and normal ES modules is the best solution by far.

Post reply on HN