
Ask HN: Why is Angular 2 size acceptable? - cutler
The recent release of Angular 2 + Router weighs in at a whopping 697k minified. How does this represent progress considering Angular 1 + Router minified is only 166k? Is this really acceptable for CPU-constrained mobile devices?
======
kylecordes
At that size you are probably still getting the initial, unoptimized
experience. There are tools that already work under the hood, though not quite
surfaced for easy consumption quite yet, which perform Angular 2 template
compilation as part of your build process therefore avoiding the need to ship
a substantial chunk of the JavaScript to the browser. This shrinks download
size, and also makes applications start faster. You can play with it today,
using a seed projects like the one I link below. Sometime soon (work in
progress, did not announce) the official Angular 2 CLI will also make this
very easy.

[https://github.com/mgechev/angular2-seed](https://github.com/mgechev/angular2-seed)

Build time template compilation helps a lot, though depending on what all
features you're using the base size might still be bigger than Angular 1.
Still, for most applications the dominant cost is not the number of bytes on
the wire, it is the development labor to make it an application work. A2 so
far appears to be very strong on this axis.

~~~
kylecordes
There is also an excellent talk on Angular 2 application download size, from
the Angular Connect conference in London this week.

[https://www.youtube.com/watch?v=_VnV7R4Ncwc](https://www.youtube.com/watch?v=_VnV7R4Ncwc)

------
obihill
I guess it would depend on what you're using it to build. If you're using it
via Ionic framework to build an appstore-bound app, then maybe not so much.
However, if your focus is a Progressive Web App for universal use, then it's
definitely a problem.

I'd actually like to know what impact that TypeScript has on all this?

------
coldtea
You can always use something else.

That said, CPU-constrained doesn't matter at all when it comes to size, an 1MB
codebase could use less CPU than a 200K one.

Memory-constrained on the other hand, yes.

~~~
cutler
Individually, yes, I can use something else but if the tech press is anything
to go by Angular 2 is the Next Big Thing especially for corporate devs itching
to turn Javascript into Java/C#.

~~~
coldtea
Angular 2? It's all about React now, and I think, in the future.

