But first I need to get the darn thing to run.
The dependencies in my
name: angular_example dependencies: angular: any polymer: any angular_node_bind: any dev_dependencies: unittest: any transformers: - polymer: entry_points: - web/index.html - test/index.htmlSo the first think I do is a
pub upgrade, which works just fine. I am unsure if
angular_node_bind, which facilitates double binding of attributes between Polymer and Angular, is strictly necessary anymore, but I will find out.
Next, I update the setup of the
web/index.htmlsmoke test page that I have, fire up the server and find that the update needs an update:
[Warning from polymer (Linter) on angular_example|web/index.html]: line 27, column 7 of web/index.html: definition for Polymer element with tag name "ng-view" not found. <ng-view> ^^^^^^^^^ [Warning from polymer (Linter) on angular_example|web/index.html]: line 24, column 3 of web/index.html: To run a polymer application you need to include the following HTML import: <link rel="import" href="packages/polymer/polymer.html">. This will include the common polymer logic needed to boostrap your application. The old style of initializing polymer with boot.js or initPolymer are now deprecated. <body> ^^^^^^ Build completed successfullyI will ignore the
<ng-view>warning for now. I do wonder if there is a way to tell the linter to ignore certain tags that are under the control of another library—grist for another day (maybe). The other warning is worrisome. I had just moved all of my Polymer.dart elements over to sourcing the
packages/web_components/platform.jsscript and now it seems that Polymer.dart has changed under my feet.
Except it hasn't.
I wonder if this same message is occurring for the chapter projects currently being tested every day (to accumulate new dependencies). This message is not present for any of these chapters, which leads me to check the
pubspec.lockfile revealing that Polymer.dart is still back at 0.10:
It seems that angular_node_bind has not been updated for 4 months, leaving it constrained to an old Polymer version. So I drop it from
# ... polymer: description: polymer source: hosted version: "0.10.0-pre.12"
pub upgradeand find… that the really old version of Polymer is still being installed:
$ pub upgrade .... polymer 0.10.0-pre.12 (0.15.0 available) ...Yeah, thanks Dart Pub, I know 0.15 is available, why the heck aren't you installing it?!
Hey, there is no need to get angry with pub, it can answer the question if I ask nicely—by upgrading just the problem dependency:
$ pub upgrade polymer Resolving dependencies... (8.4s) Incompatible version constraints on browser: - angular 0.0.8 depends on version >=0.8.7 <0.9.0 - polymer 0.15.0 depends on version >=0.10.0 <0.11.0Wait... that is a really old version of Angular.dart—it should be up to 0.14 nowadays. What gives pub?
$ pub upgrade angular polymer Resolving dependencies... (7.9s) Incompatible version constraints on args: - angular 0.14.0 depends on version >=0.10.0 <0.11.0 - polymer 0.15.0 depends on version >=0.11.0 <0.13.0Gosh. Darn. It.
This does not seem like a problem that I am going to solve in one night, but I would still like to have some idea of the extent of the problem. So I fork Angular.dart, clone it locally and hand-edit their
pubspec.yamlto include a more recent of
name: angular version: 0.14.0 # ... dependencies: args: '>=0.10.0 <0.12.0' # ...To use this forked Angular.dart repo, I switch the
pubspec.yamlin my chapter project code to point to this local package:
name: angular_example dependencies: angular: path: /home/chris/repos/angular.dart polymer: any # angular_node_bind: anyWith that, I get:
$ pub upgrade Resolving dependencies... (21.8s) Incompatible version constraints on analyzer: - angular 0.14.0 depends on version >=0.15.0 <0.19.0 - polymer 0.10.0-pre.0 depends on version >=0.12.2 <0.13.0Bleh. Now I am back to trying to install an old version of Polymer. I explicitly stick with the most recent by pub upgrading the polymer dependency:
$ pub upgrade polymer Resolving dependencies... (1.6s) Incompatible version constraints on code_transformers: - angular 0.14.0 depends on version >=0.1.4+2 <0.2.0 - polymer 0.15.0 depends on version >=0.2.3 <0.3.0So I need to again hand-edit Angular.dart's
pubspec.yaml, after which I find:
$ pub upgrade polymer Resolving dependencies... (1.7s) Incompatible version constraints on html5lib: - angular 0.14.0 depends on version >=0.10.0 <0.11.0After another hand edit, I am finally able to
$ pub upgrade polymer ... * angular 0.14.0 from path /home/chris/repos/angular.dart (was 0.12.0) ... > polymer 0.15.0 (was 0.10.0-pre.12) ...In the end I had to change three different dependencies to get the latest Angular.dart and Polymer.dart installed side-by-side:
name: angular # ... dependencies: args: '>=0.10.0 <0.12.0' # ... code_transformers: '>=0.1.4+2 <0.3.0' # ... html5lib: '>=0.10.0 <0.13.0' # ...That is very much a bummer. It is especially troublesome for the book. Do I pursue this path and attempt to figure out if Angular.dart works with these new dependencies? Or do I stick with the old version of the packages? Neither is particularly appealing, but I will likely start with a limited attempt at working with a dependency augmented version of Angular.dart. I would hope that these two packages will be eventually consistent and dependency augmentation would position me best for that eventual future.