On Thu, Nov 19, 2015 at 6:36 AM, Tim Guan-tin Chien <[email protected]> wrote:
> Nice write up, should we start filing bugs and work on it? > I filed bug 1226497 <https://bugzilla.mozilla.org/show_bug.cgi?id=1226497> for an optional variant of Service.request() per Etienne's comment. (I don't think we need to file bugs for individual refactorings.) I'm not sure where we'll need that optional variant, but I can see the use case. Greg's right that using Service doesn't address what happens when interfaces change; the bulk of this, as Greg noted, is in explicitly exposing things we care about, and not anything else. Service does require us to explicitly register methods before they're exposed, so much of this is about conventions. Maybe we don't need anything else? Removing or modifying a "Service.register()" call should send up red flags, but I can see how we could forget the contract since "Service.register" is often called far away from the function definition. One other potential footgun here: Since Service.request() is async (and events are not), invoking Service.request() without waiting for the promise would be a programming error. If we wait for the promise, we get immediate feedback when something is no longer hooked up right (and it's so, so easy to mock!), but if we don't, the error falls into the void. I'm not sure how to best address those two concerns.
_______________________________________________ dev-fxos mailing list [email protected] https://lists.mozilla.org/listinfo/dev-fxos

