Are you sure you are using the latest version?
Angular was an early user of mirrors (reflection) which (more or less) disabled the tree-shaking of dart2js. This was recently improved.
Tracking the size of AngularDart: https://github.com/jbdeboer/angular-dart-js-size
Re:Angular Announces AngularDart
by Max_Horstmann on Tuesday November 05, 2013 @05:27PM
(#6678905)
Maybe I'm missing something, but yes, I think so. Dart version 0.8.10.3_r29803.
pubspec.yaml:
name: test1 dependencies: browser: any angular: git: https://github.com/angular/angular.dart.git
test1.dart:
import 'package:angular/angular.dart'; main() => ngBootstrap();
dart2js launch => builds test1.dart.js, about 5MB, 142,749 loc.
Yes. You need to add a @MirrorsUsed annotation in your main.dart file. See https://github.com/jbdeboer/angular-dart-js-size/blob/master... for our current best practices.
You should get ~173KB gzipped, minified dart2js output.
Re:Angular Announces AngularDart
by Max_Horstmann on Tuesday November 05, 2013 @06:06PM
(#6679146)
Beautiful. Thanks!
So are you using that the full tree shaking algo works with angular now?
There's still a lot of work to be done on code size when using reflection, and teams at Google are definitely interested in incremental updates to cached apps, so that will be worked on too. It's still very early in Dart's lifetime.
One thing I noticed though: transpiling a .dart file with just the import statement for AngularDart (import 'package:angular/angular.dart') generates a non-minified 5MB .js file with almost 150 kloc. Every code change will create a new version of it, invalidating previously cached versions. :/