3 ms·
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
by floitsch 13y ago
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 https://github.com/jbdeboer/angular-dart-js-size
- Max_Horstmann 13y agoMaybe 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 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.
- jbdeboer 13y agoYes. You need to add a @MirrorsUsed annotation in your main.dart file. See https://github.com/jbdeboer/angular-dart-js-size/blob/master/main.dart https://github.com/jbdeboer/angular-dart-js-size/blob/master... for our current best practices. You should get ~173KB gzipped, minified dart2js output.
- Max_Horstmann 13y agoBeautiful. Thanks!
- lennel 13y agoSo are you using that the full tree shaking algo works with angular now?