{"action":"created","issue":{"url":"https://api.github.com/repos/hypothesis/h/issues/2239","labels_url":"https://api.github.com/repos/hypothesis/h/issues/2239/labels{/name}","comments_url":"https://api.github.com/repos/hypothesis/h/issues/2239/comments","events_url":"https://api.github.com/repos/hypothesis/h/issues/2239/events","html_url":"https://github.com/hypothesis/h/pull/2239","id":77587568,"number":2239,"title":"Features cleanup","user":{"login":"tilgovi","id":20818,"avatar_url":"https://avatars.githubusercontent.com/u/20818?v=3","gravatar_id":"","url":"https://api.github.com/users/tilgovi","html_url":"https://github.com/tilgovi","followers_url":"https://api.github.com/users/tilgovi/followers","following_url":"https://api.github.com/users/tilgovi/following{/other_user}","gists_url":"https://api.github.com/users/tilgovi/gists{/gist_id}","starred_url":"https://api.github.com/users/tilgovi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tilgovi/subscriptions","organizations_url":"https://api.github.com/users/tilgovi/orgs","repos_url":"https://api.github.com/users/tilgovi/repos","events_url":"https://api.github.com/users/tilgovi/events{/privacy}","received_events_url":"https://api.github.com/users/tilgovi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/hypothesis/h/milestones/16","html_url":"https://github.com/hypothesis/h/milestones/05-19-2015","labels_url":"https://api.github.com/repos/hypothesis/h/milestones/16/labels","id":1097366,"number":16,"title":"05-19-2015","description":"","creator":{"login":"judell","id":46509,"avatar_url":"https://avatars.githubusercontent.com/u/46509?v=3","gravatar_id":"","url":"https://api.github.com/users/judell","html_url":"https://github.com/judell","followers_url":"https://api.github.com/users/judell/followers","following_url":"https://api.github.com/users/judell/following{/other_user}","gists_url":"https://api.github.com/users/judell/gists{/gist_id}","starred_url":"https://api.github.com/users/judell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/judell/subscriptions","organizations_url":"https://api.github.com/users/judell/orgs","repos_url":"https://api.github.com/users/judell/repos","events_url":"https://api.github.com/users/judell/events{/privacy}","received_events_url":"https://api.github.com/users/judell/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":13,"state":"open","created_at":"2015-05-05T18:12:11Z","updated_at":"2015-05-20T16:15:53Z","due_on":"2015-05-19T07:00:00Z","closed_at":null},"comments":5,"created_at":"2015-05-18T09:49:49Z","updated_at":"2015-05-20T17:06:09Z","closed_at":"2015-05-18T20:06:11Z","pull_request":{"url":"https://api.github.com/repos/hypothesis/h/pulls/2239","html_url":"https://github.com/hypothesis/h/pull/2239","diff_url":"https://github.com/hypothesis/h/pull/2239.diff","patch_url":"https://github.com/hypothesis/h/pull/2239.patch"},"body":"This is a set of commits that cleans up the feature flag usage a bit and propagates feature flags to the frontend.\r\n\r\n- Rather than use `request.feature` the function is available as a config directive: `config.feature('name')`. This is slightly more attractive and pyramidal to me than setting properties on the registry.\r\n\r\n- Export the feature test function to jinja2 templates by adding it as a global for all the configured renderers during configuration time rather than during the `BeforeRender` event.\r\n\r\n- Add jinja2 templating to the asset pipeline, including feature flags. Since browserify must be the inner-most filter, the variable substitution delimiters are surrounded with quotes so that simple templates with variable substitutions can pass through browserify before jinja2.\r\n\r\n- Create a features configuration in the frontend as part of the config package.\r\n\r\n- Make the `h` angular module depend on `h.config` and make the config package use the latter. By defining this package in the main app bundle but augmenting it in the config bundle we ensure a few things:\r\n  - The application can load without a config bundle.\r\n  - The application's providers are available to the config bundle for configuration.\r\n  - The application will not start until the config bundle is loaded.\r\n  - The feature service is available to all service constructors in the application."},"comment":{"url":"https://api.github.com/repos/hypothesis/h/issues/comments/103962687","html_url":"https://github.com/hypothesis/h/pull/2239#issuecomment-103962687","issue_url":"https://api.github.com/repos/hypothesis/h/issues/2239","id":103962687,"user":{"login":"tilgovi","id":20818,"avatar_url":"https://avatars.githubusercontent.com/u/20818?v=3","gravatar_id":"","url":"https://api.github.com/users/tilgovi","html_url":"https://github.com/tilgovi","followers_url":"https://api.github.com/users/tilgovi/followers","following_url":"https://api.github.com/users/tilgovi/following{/other_user}","gists_url":"https://api.github.com/users/tilgovi/gists{/gist_id}","starred_url":"https://api.github.com/users/tilgovi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tilgovi/subscriptions","organizations_url":"https://api.github.com/users/tilgovi/orgs","repos_url":"https://api.github.com/users/tilgovi/repos","events_url":"https://api.github.com/users/tilgovi/events{/privacy}","received_events_url":"https://api.github.com/users/tilgovi/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T17:06:09Z","updated_at":"2015-05-20T17:06:09Z","body":"I'm not understanding which comment is about a crashing bug on master.\nOn May 20, 2015 10:04 AM, \"Randall Leeds\" <tilgovi@hypothes.is> wrote:\n\n> Okay....\n>\n> I don't see where that pull request tries to access a feature flag from a\n> view, though.\n>\n> I'll look at the crash you say.\n> On May 20, 2015 5:34 AM, \"Nick Stenning\" <notifications@github.com> wrote:\n>\n>> I'm afraid I've had to revert this:\n>>\n>>    - it introduced a crashing bug on master (see #2131 (comment)\n>>    <https://github.com/hypothesis/h/pull/2131#discussion_r30692024>)\n>>    - feature flags are no longer accessible by view functions\n>>    (configurator object is not available from the request), thus this blocks\n>>    #2131 <https://github.com/hypothesis/h/pull/2131>\n>>\n>> The reason feature is on the registry is because the registry is\n>> available both at configuration time and during the request cycle. While\n>> obviously the parts of this PR that expose feature flags to the frontend\n>> are [image: :+1:], I think the changes to the backend need a little more\n>> thought.\n>>\n>> Also, review is good. Let's seek review proactively for changes like this.\n>>\n>> —\n>> Reply to this email directly or view it on GitHub\n>> <https://github.com/hypothesis/h/pull/2239#issuecomment-103865580>.\n>>\n>\n"}}