BREAKING CHANGE: pub 1.4.0 will require barback 0.13.0

142 views
Skip to first unread message

Nathan Weizenbaum

unread,
Apr 11, 2014, 8:13:03 PM4/11/14
to General Dart Discussion
Hi folks,

I mentioned last week that barback 0.13.0 would include a breaking change to the signature of Transformer.isPrimary. That change was released early this week, but most of you won't have seen it yet, since pub 1.3 has a version constraint on barback <0.13.0.

Now we're preparing the first dev channel release of version 1.4 of the SDK, whose pub will have a version constraint on barback >=0.13.0 <0.14.0. This means that it will be incompatible with existing packages that implement the old version of the Transformer.isPrimary API.

What if I have a package that defines a transformer?

Luckily, it's easy to update your transformers to be compatible with both 1.3 and 1.4. All you need to do is check whether the parameter to Transformer.isPrimary is an Asset or an AssetId. For example, if you used to have

    Future<bool> isPrimary(Asset asset) =>
        new Future.value(asset.id.path.endsWith("/myfile.txt"));

you can change it to

    Future<bool> isPrimary(assetOrId) {
      var id = assetOrId is Asset ? assetOrId.id : assetOrId;
      return new Future.value(id.path.endsWith("/myfile.txt"));
    }

What if I have a package that uses a transformer?

You don't need to do anything! Once a new barback-0.13.0-compatible version of the transformer you use is released, just run "pub get" and everything will work great. Until then, either stick with 1.3 or submit a pull request to the transformer author.

Let me know if you have any questions!

- N

Don Olmstead

unread,
Apr 11, 2014, 8:15:39 PM4/11/14
to mi...@dartlang.org
Unrelated to pub but will the 1.4 SDK come with Chromium 35?


--
For other discussions, see https://groups.google.com/a/dartlang.org/
 
For HOWTO questions, visit http://stackoverflow.com/tags/dart
 
To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.

Bob Nystrom

unread,
Apr 14, 2014, 12:44:29 PM4/14/14
to General Dart Discussion

On Fri, Apr 11, 2014 at 5:15 PM, Don Olmstead <don.j.o...@gmail.com> wrote:
Unrelated to pub but will the 1.4 SDK come with Chromium 35?

I'm not sure, but I'd suggest starting a new thread for this so the right people are more likely to notice it.

Cheers!

- bob
Reply all
Reply to author
Forward
0 new messages