{"action":"created","issue":{"url":"https://api.github.com/repos/flutter/flutter/issues/1722","repository_url":"https://api.github.com/repos/flutter/flutter","labels_url":"https://api.github.com/repos/flutter/flutter/issues/1722/labels{/name}","comments_url":"https://api.github.com/repos/flutter/flutter/issues/1722/comments","events_url":"https://api.github.com/repos/flutter/flutter/issues/1722/events","html_url":"https://github.com/flutter/flutter/pull/1722","id":132503744,"number":1722,"title":"Introduce globals","user":{"login":"devoncarew","id":1269969,"avatar_url":"https://avatars.githubusercontent.com/u/1269969?v=3","gravatar_id":"","url":"https://api.github.com/users/devoncarew","html_url":"https://github.com/devoncarew","followers_url":"https://api.github.com/users/devoncarew/followers","following_url":"https://api.github.com/users/devoncarew/following{/other_user}","gists_url":"https://api.github.com/users/devoncarew/gists{/gist_id}","starred_url":"https://api.github.com/users/devoncarew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devoncarew/subscriptions","organizations_url":"https://api.github.com/users/devoncarew/orgs","repos_url":"https://api.github.com/users/devoncarew/repos","events_url":"https://api.github.com/users/devoncarew/events{/privacy}","received_events_url":"https://api.github.com/users/devoncarew/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-02-09T19:06:59Z","updated_at":"2016-02-10T06:22:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/flutter/flutter/pulls/1722","html_url":"https://github.com/flutter/flutter/pull/1722","diff_url":"https://github.com/flutter/flutter/pull/1722.diff","patch_url":"https://github.com/flutter/flutter/pull/1722.patch"},"body":"- change the global `AppContext context` variable from knowing about specific services to being a type -> object map for a zone. Each zone can introduce their own local overrides. This is useful for testing; each `context.runInZone()` call essentially becomes a container with it's own values for the globals, so you can use mocks for testing w/o changing the call locations.\r\n- introduce some globals for the Logger and DeviceManager class (in the `base/globals.dart` library).\r\n- create a `testUsingContext()` method to define a test, and run that test in a new context with some default mocks set up\r\n\r\nHopefully using these zone-specific globals will allow us to have fewer statics, pass fewer objects along method call chains, and make testing easier.\r\n"},"comment":{"url":"https://api.github.com/repos/flutter/flutter/issues/comments/182219386","html_url":"https://github.com/flutter/flutter/pull/1722#issuecomment-182219386","issue_url":"https://api.github.com/repos/flutter/flutter/issues/1722","id":182219386,"user":{"login":"Hixie","id":551196,"avatar_url":"https://avatars.githubusercontent.com/u/551196?v=3","gravatar_id":"","url":"https://api.github.com/users/Hixie","html_url":"https://github.com/Hixie","followers_url":"https://api.github.com/users/Hixie/followers","following_url":"https://api.github.com/users/Hixie/following{/other_user}","gists_url":"https://api.github.com/users/Hixie/gists{/gist_id}","starred_url":"https://api.github.com/users/Hixie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hixie/subscriptions","organizations_url":"https://api.github.com/users/Hixie/orgs","repos_url":"https://api.github.com/users/Hixie/repos","events_url":"https://api.github.com/users/Hixie/events{/privacy}","received_events_url":"https://api.github.com/users/Hixie/received_events","type":"User","site_admin":false},"created_at":"2016-02-10T06:22:49Z","updated_at":"2016-02-10T06:22:49Z","body":"I look forward to seeing the results ☺"}}