Ask HN: Why is Angular 2 size acceptable?

2 points by cutler ↗ HN
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?

7 comments

[ 2.9 ms ] story [ 29.5 ms ] thread
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.

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#.
Angular 2? It's all about React now, and I think, in the future.
It wasn't that long ago that Angular 1 was considered a bit hefty but its successor is now 320% heavier and it's considered to be an improvement. I don't get it.
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

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.

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?