-
Notifications
You must be signed in to change notification settings - Fork 33
Dart development compiler support #721
Comments
There is a lot more involved here than just strong mode errors, as I don't think that the dev compiler supports reflection to the degree that un-transformed polymer apps would need it. |
thanks for the quick response - are you saying there there might be a solution involving running the transformers up-front? |
The real solution here is to migrate polymer and all of its related transformers over to package:build (or source_gen, which uses build). Ultimately I think this comes down to some work in package:initialize and package:reflectable, which rewrite their own sources in a transformer (see https://github.com/dart-lang/initialize/blob/master/pubspec.yaml#L22 and https://github.com/dart-lang/reflectable/blob/master/reflectable/pubspec.yaml#L24). This is how they switch between reflective/codegen modes, and is not possible in package:build since rewriting sources is banned. Angular solves this with a separate entrypoint that you use for bootstrapping the app (angular2/platform/browser[_static].dart). If you are doing codegen always you can just import the static one directly instead of relying on the transformer. For package:initialize the same approach can easily be taken, but I think its more difficult for package:reflectable. |
The alternative using transformers is you have to run pub build and then dartdevc each as part of your dev cycle, which would be quite painful (and slow). |
cc @eernstg for reflectable |
I haven't been working on reflectable for a while (the time just melts away On Fri, Nov 18, 2016 at 6:41 PM, Jacob MacDonald notifications@github.com
Erik Ernst - Google Danmark ApS |
Ok, I can't remember the specifics @eernstg but Ideally we wouldn't have to actually change any imports outside of the entry point file. I think in the reflectable case that would require some additional boilerplate in the entrypoint even for reflective apps though (you would have to register some reflective implementation, which you would import via reflectable_mirrors.dart or something). Is that an option do you think? Overall it would probably make things a lot more sane (and this is what polymer/web_components/initialize do). |
I still haven't had an opportunity to spend time on reflectable, but I just noticed this remark:
You should be able to use arbitrary transformers by writing your code in a package, specifying the transformers in 'pubspec.yaml', running them via |
Will the polymer support dartdevc in the future? |
it's already supporiting it : https://pub.dartlang.org/packages/polymerize |
Description
Steps to Reproduce
Some (general) steps to reproduce are:
dartdevc
The text was updated successfully, but these errors were encountered: