eredo / dartson

Dartson is a Dart library that can be used to convert Dart objects into a JSON string.
MIT License
79 stars 29 forks source link

Missing a MirrorsUsed annotation #3

Closed sethladd closed 10 years ago

sethladd commented 10 years ago

Hi,

To help get the size down for the compiled JS, please add a @MirrorsUsed annotation where you import dart:mirrors.

Since your library uses annotations, I think something like this should work:

@MirrorsUsed(metaTargets: const [DartsonEntity]);
import 'dart:mirrors';
sethladd commented 10 years ago

Let me know if that works. Thanks!

eredo commented 10 years ago

Hi,

I added the MirrorsUsed annotation and it works. The size of compiled (minified) test_dartson.dart to 230kb (240kb before). DartsonEntity is currently not used, I marked it as deprecated. DartsonProperty is still required though.

Thanks for the tip!