dart-archive / observe

Support for marking objects as observable, and getting notifications when those objects are mutated
https://pub.dartlang.org/packages/observe
BSD 3-Clause "New" or "Revised" License
13 stars 6 forks source link

observe transform should be usable from pub #51

Closed DartBot closed 9 years ago

DartBot commented 9 years ago

Issue by jmesserly Originally opened as dart-lang/sdk#14888


quoting siggi to web-ui list:

Almost, but not quite, we should open a bug for this.

By default pub would let you say 'observe' to mean "observe/transformer.dart', but in package:observe this file doesn't exist. Pub let's you specify a specific path, so instead of 'observe' you can say:

transformers:

However, the file you specify needs to have a plugin API (a transformer with a constructor named .asPlugin). We have these in polymer, but not in observe. You can add one yourself in your package instead:

mypackage/lib/observe_transformer.dart:

class WorkAround extends ObservableTransfomer {
   WorkAround.asPlugin() : super(); }

Then use this instead in your pubspec: transformers:

DartBot commented 9 years ago

Comment by jmesserly


Removed Priority-Unassigned label. Added Priority-Medium label.

DartBot commented 9 years ago

Comment by sigmundch


The proper fix is simple:

Then you can just say:

transformers:

DartBot commented 9 years ago

Comment by munificent


  • mypackage/observe_transformer.dart # skip the 'lib' here, this is like a package: import

You don't need the ".dart" there either. :)

DartBot commented 9 years ago

Comment by sigmundch


FYI, I needed this for another bug fix, so it's coming in soon. See:

https://codereview.chromium.org/63173009/

DartBot commented 9 years ago

Comment by sigmundch


fix landed in dart-lang/sdk@536f92456dc123ee61f3d268ac0d6cfef22fa625


Added Fixed label.

DartBot commented 9 years ago

Comment by anders-sandholm


Removed Library-Observe label. Added Pkg-Observe label.