Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

JavaScript version of "Hello World" is 5570kb #237

Closed
andersforsell opened this issue Oct 28, 2013 · 6 comments
Closed

JavaScript version of "Hello World" is 5570kb #237

andersforsell opened this issue Oct 28, 2013 · 6 comments

Comments

@andersforsell
Copy link
Contributor

Can the annotation "@MirrorsUsed" be used to help dart2js reduce the size of the JavaScript? (I think it was done for Polymer apps lately).

@ghost ghost assigned jbdeboer Oct 28, 2013
@jbdeboer
Copy link
Contributor

I am working on this problem.

@jbdeboer
Copy link
Contributor

Added a @MirrorsUsed to main.dart reduces this number to 182K minified and compressed.

I used:

@MirrorsUsed(targets: const[
  'angular',
  'angular.core',
  'angular.core.dom',
  'angular.filter',
  'angular.perf',
  'angular.directive',
  'angular.routing',
  'angular.core.parser',
  'NodeTreeSanitizer'
  ],
  override: '*')
import 'dart:mirrors';

@jbdeboer
Copy link
Contributor

@andersforsell
Copy link
Contributor Author

@jbdeboer Good idea to track the size using a tool. Just a question: shouldn't the MirrorsUsed annotation be part of the Angular library and not have to be specified in the user's code?

@jbdeboer
Copy link
Contributor

Maybe, but um not sure how that works. If you could put together a pull
request we would gladly accept it.
On Oct 31, 2013 10:51 AM, "Anders Forsell" [email protected] wrote:

@jbdeboer https://github.com/jbdeboer Good idea to track the size using
a tool. Just a question: shouldn't the MirrorsUsed annotation be part of
the Angular library and not have to be specified in the user's code?


Reply to this email directly or view it on GitHubhttps://github.com//issues/237#issuecomment-27509251
.

@sethladd
Copy link
Contributor

sethladd commented Jan 7, 2014

Following the AngularDart tutorial, step one, generated > 3MB of javascript. Can we reopen this issue?

(BTW I'm using 0.9.3)

I edited angular.dart:

@MirrorsUsed(targets: const[
  'angular',
  'angular.core',
  'angular.core.dom',
  'angular.filter',
  'angular.perf',
  'angular.directive',
  'angular.routing',
  'angular.core.parser',
  'NodeTreeSanitizer'
  ],
  override: '*')
import 'dart:mirrors';

jbdeboer added a commit to jbdeboer/angular.dart that referenced this issue Jan 24, 2014
jbdeboer added a commit to jbdeboer/angular.dart that referenced this issue Jan 24, 2014
jbdeboer added a commit to jbdeboer/angular.dart that referenced this issue Jan 28, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants