Live data from Hacker News

Angular 5.0.0

blog.angular.io

21–30 of 189 posts

Re: Angular 5.0.0

#21

Lack of compile-time checks for the template (and embedded expressions) is a major limitation of Angular. This may be OK for small projects. For large projects with many developers this is a huge problem. Here's what happens: a developer modifies code he's not familiar with. He introduces a bug due to a typo. He builds the code without errors, and runs the application, and everything seems to be OK. The bug is not fo…

This isn't true and hasn't been true for a while. Angular's ahead-of-time compiler converts the template strings into TypeScript which are then type checked, all at compile time.

Re: Angular 5.0.0

#22
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.

The 2+ updates are really more like point releases which might add some features and/or break some things here and there, but are in no way comparable to the huge 1.x -> 2 "just rewrite it all" jump.

Naming matters though, since the Angular ebook I was reading saw fit to end update support at 2.x and not support 4+, even though there's not much difference from what I can see.

Re: Angular 5.0.0

#23
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…

> It is small if I want to Did they finally fix it to be actually possible to make it small? I remember them quoting some ridiculous number, and none of my colleagues, nor I, could get it below a megabyte using the suggested methods, nor below a few hundred k for a hello world.

It's been possible for quite some time. Hard to say why you weren't able to without more information.

Re: Angular 5.0.0

#24

Lack of compile-time checks for the template (and embedded expressions) is a major limitation of Angular. This may be OK for small projects. For large projects with many developers this is a huge problem. Here's what happens: a developer modifies code he's not familiar with. He introduces a bug due to a typo. He builds the code without errors, and runs the application, and everything seems to be OK. The bug is not fo…

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 then that means that development includes the type-checking compilation step!

Re: Angular 5.0.0

#25

Has anyone had success using the AOT tools to build a package of reusable angular components? I was able to use AOT pretty easily for a stand-alone app, but keep running into issues when trying to create a shareable component, and there is not a lot of documentation around this.

I have for my day job, but it's _hard_. There isn't a lot of good info out there. Here are a few good sources that I found helpful:

https://medium.com/@isaacplmann/getting-your-angular-2-libra... http://dbarnes.me/writing-an-aot-compliant-angular-library/ https://angular.io/guide/aot-compiler https://angular.io/guide/metadata

Re: Angular 5.0.0

#26
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.

Vue.js can be a good option for shops coming from Angular 1.x.

Re: Angular 5.0.0

#27
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.

It's not just Angular. To me it feels like everything in the JS world releases way faster than it's reasonable to keep up with these days.

Re: Angular 5.0.0

#28
post #23

Earlier quoted context omitted.

> It is small if I want to Did they finally fix it to be actually possible to make it small? I remember them quoting some ridiculous number, and none of my colleagues, nor I, could get it below a megabyte using the suggested methods, nor below a few hundred k for a hello world.

It's been possible for quite some time. Hard to say why you weren't able to without more information.

To be fair the situation has changed drastically over the past 12 months.

After 2.0, AOT got enabled by default, drastically reducing size, then 4.0 drastically reduced size, then the build-optimizer (default with 5.0) drastically reduced size.

Re: Angular 5.0.0

#29
post #16
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…

I hate CLIs that do too much. Just give me a sane starter generator and I`ll take it from there. And please don`t hide webpack from me like angular cli does. And this part "generating new components/services/etc. easy" I always find strange. Creating a component or whatever takes like 1-2 shortcuts in a normal IDE. And you can also use templates to expand various reusable/common parts. Why would I ever want to learn…

> Just give me a sane starter generator

ng new my-project

> And please don`t hide webpack from me like angular cli does

ng eject; that gives you the webpack config and basically disables the CLI

> Why would I ever want to learn some cli command that would create ordinary file for me which I can create as usual with the tool I already use.

You don't have to use it, it's optional

Re: Angular 5.0.0

#30
We have invested time into Angular 2 and leveraged a fair amount of its features and ecosystem, but implementation specifics on some have been a great challenge.

We watched the Google I/O presentation from 2016 where the team pitched a lot of exciting stuff coming to angular like SSR/Universal rendering, and decided to buy in and use ng2, but using universal with the CLI was near impossible to get done given how undocumented it was. There was a CLI fork that was quite promising, and with a bit of work we managed to get client side AOT optimization and SSR.

Bundle sizes after all this were unacceptably high. The documentation and talks had discussed things like tree shaking and other such optimization processes, but there was a tussle between webpack and rollup where the CLI used one and not the other, and rollup did tree shaking better, so we had to either drop tree shaking or the CLI. It was not a fun experience.

Eventually angular 4 dropped and there was a timeline on getting the CLI up to speed with universal, the guys at Google I/O 2017 did a talk on universal rendering, but they used some cryptic command line tools that were also fairly undocumented at the time. The angular 2 app sat in production using the old CLI fork that had been abandoned and we weren't able to migrate because universal documentation for angular 4 was also relatively unclear.

Finally for future projects we opted to go with Vue, which has been relatively nicer. We used localization, token based authentication via cookies to enable authenticated universal rendering for logged in users, PWA features (offline). The project was analogous to Yelp, with product and service suggestions displayed to the user depending on their browsing habits and other aspects of their profile. Roughly 300k monthly uniques. Universal was essential for SEO and performance since 90% of traffic was search.

Other than struggles with universal and SEO, there were some issues with getting customizations to the webpack build process since the CLI fork we used didn't allow for many changes like adding minification, etc. We also wanted stuff at the express end of things like HTML minification, but there was no clear-cut way to do caching across things like authenticated vs unauthenticated. Maybe we couldn't think of the best way to go about this. Other frameworks seemed to have a painless way of doing this stuff, so we spent a lot of time wondering if we had made the right choice. Most of the plain client side stuff was very satisfying to use. RxJS is great as well, and it was nice to see it become popular across the JS ecosytem. I am not sure if I would go with angular for future work because the bundle size seems to be overwhelmingly high - perhaps due to a knowledge gap at our end. What would be fantastic some sort of sample kitchen sink demo application that employs all the best practices for everything - auth, localization, seo, universal, build process customization, etc.

At the time of our evaluation, we looked at a number of quickstart and bootstrap/boilerplate/starter kit projects, but each one seemed to lack one thing that we really wanted, with no clear path to integrating it in.

Post reply on HN