Dart Bindings: Breaking Change

25 views
Skip to first unread message

Zach Anderson

unread,
May 16, 2016, 6:38:10 PM5/16/16
to mojo...@chromium.org
Hello again,

If you don't use the Dart bindings you can stop reading now.

tl;dr: When using generated stubs: E.g. stub.onError -> stub.ctrl.onError.

After the CL here [1] lands and a new mojo package is published to pub, users of the Dart bindings will need to update their application code. In particular:

1. Functions for manipulating a generated Stub have been moved to a field named 'ctrl', so for example:

stub.onError

becomes

stub.ctrl.onError

Rationale: This refactoring mirrors the recently landed change to Proxies. Going forward, Stubs and Proxies will both implement the same interfaces so that we may begin improving static types in the Mojo bindings.

I plan to land this change and push a new package to pub by the end of the day tomorrow. Please let me know here on the list or in person if you have any concerns.

Cheers,
Zach

Zach Anderson

unread,
May 20, 2016, 3:51:52 PM5/20/16
to mojo...@chromium.org
If you don't use the Dart bindings you can stop reading now.

tl;dr: FooProxy.connectToService => Foo.connectToService, FooStub.serviceDescription => Foo.serviceDescription.

After the CL here [1] lands and a new mojo package is published to pub, users of the Dart bindings will need to update their application code. In particular:

1. The factory constructor "connectToService" on generated Proxy classes is moving to a static method on the generated interface class. For example:

new FooProxy.connectToService(...);

becomes

Foo.connectToService(...)

Raionale: The change in [1] aims to begin allowing Mojo applications to avoid directly referencing Proxies and Stubs, instead using generated Interface and InterfaceRequest classes to match Mojo terminology.

2. The static getter "serviceDescription" on generated Stub classes is moving to a static getter on the generated interface class. For example:

FooStub.serviceDescription

becomes

Foo.serviceDescription.

Rationale: ditto.

Note: While the change in [1] adds interfaces with names more closely aligned with Mojo concepts, existing code using Proxies and Stubs will continue to work.

I plan to land this change and push a new package to pub by the end of the day Monday. Please let me know here on the list or in person if you have any concerns.

Cheers,
Zach

Reply all
Reply to author
Forward
0 new messages