Hacker News new | ask | show | jobs
by d2kx 3150 days ago
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 the router was easy, so that only the modules that I need for a certain route get loaded and my home site isn't 500kb+ for no good reason.

It has a predictable release schedule.

3 comments

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.

Well if you use the Angular CLI it will generate the boilerplate test code for you, I don’t find them slow to run personally (my dev machine is pretty well specced though)
> 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.

There was no clear way on how to do this if you wanted to use universal though. The CLI never supported it for ages. Does it support it now?
It does, there is a wiki page on it.
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 some cli command that would create ordinary file for me which I can create as usual with the tool I already use. Heavy CLI tools just add another layer of unnecessary complexity to the project. Why don't just learn webpack which you can use on any project, and you will have much more power at your fingertips.
> 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