In response to @ebidel's answer. I Dart this means running pub build from the command line instead of DartEditor.
When launched from the command line, mode=release used by default. DartEditor calls pub build using mode=debug . Release mode makes jitter and minimization of the tree, which leads to a decrease in code. As far as I know, other vulcanize things for Polymer.js are done by the Dart Polymer Transformer.
Some tips
admin_service_repository / admin_service_repository.dart
@observable List serviceDescriptions = toObservable([]); // instead of // @observable List serviceDescriptions = [];
therefore, Polymer receives notification of changes even when loading data after the polymer has already created a view from the serviceDescriptions list.
for (Map service in services) { //String name = service['name']; //ServiceDescription sd = new ServiceDescription(name, service['defaultUrl'], service['description'], service['exampleContent']); //addService(sd); serviceDescriptions.addAll( services.map((s) => new ServiceDescription(s['name'], s['defaultUrl'], s['description'], s['exampleContent']))); }
creating a list and adding items to services can be a little simplified.
admin_service_repository / node_view.dart
@observable get allChildren { // List list = []; // for (Node child in node.children.values) { // list.add(child); // } // return list; return node.children.values.toList(); }
In lib/invoke_service you create a list of strings and concatenate them in the constructor.
You can create multi-line string literals like
String someString = r''' { xxxx } ''';
I added
- polymer: inline_stylesheets: lib/bootstrap/css/bootstrap.min.css: false lib/bootstrap/css/bootstrap.min.css: false lib/css/op.css: false lib/font-awesome-4.2.0/css/font-awesome.min.css: false
in pubspec.yaml to get rid of warnings after upgrading to Polymer 0.15.xxx.