Dart Bindings: Breaking Change

25 weergaven
Naar het eerste ongelezen bericht

Zach Anderson

ongelezen,
16 mei 2016, 18:38:1016-05-2016
aan 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

ongelezen,
20 mei 2016, 15:51:5220-05-2016
aan 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

Allen beantwoorden
Auteur beantwoorden
Doorsturen
0 nieuwe berichten