Hey everyone,
If you've been playing with the polymer pre-releases, then check out the version we pushed last Friday (0.10.0-pre.5).
What's new in 0.10.0-pre.5?
The polymer-build process removes all dependencies on 'dart:mirrors' in polymer apps, and replaces those with generated code.
Why avoid mirrors?
Removing uses of mirrors helps dart2js do a better job optimizing your code (creating smaller, possibly faster apps). What I'm most excited about is that, as a developer, you won't need to worry about @reflectable or @MirrorsUsed anymore. If an expression is mentioned in a template, then we include it in the generated code. The idea is that if it works in Dartium, it should work after we compile it with dart2js without having to add any extra annotations.
How do I use it?
Upgrade to 0.10.0-pre.5 and invoke pub build.
Some details you should be aware of:
- In order to generate the appropriate information, we have to analyze your program in more detail. This means in part that compilation might be slower (we use the analyzer's resolver in our pub-build), but more importantly, that we need to be able to extract expressions in templates and figure out which classes correspond with polymer-element tags. This works great if you are using polymer the usual way, but it might not work property if you override the template expression syntax or if you rely heavily on calling Polymer.register instead of using @CustomTag.
- Some breaking changes were introduced along the way. For example, evaluation of polymer expressions and path-observers may throw exceptions when it didn't use to do so. So you may discover that some parts of your apps need to be fixed as you try things out.
Please give it a try and let us know how it's working out for you. So far, we've tried this in TodoMVC and the dardoc-viewer app, but I'm sure we'll discover bugs as we try this on other apps out there. If it doesn't work for you, you can always revert back an older package (polymer 0.10.0-pre.4) or tweak your code to make it default to the old behavior. Hopefully this wont be necessary, but let us know if you need more details.
Cheers,
Siggi