{"action":"created","comment":{"url":"https://api.github.com/repos/emberjs/data/pulls/comments/47268609","id":47268609,"diff_hunk":"@@ -0,0 +1,27 @@\n+/*jshint node:true*/\n+module.exports = {\n+  name: 'enable-optional-features-via-url',\n+\n+  /**\n+    So the ENABLE_OPTIONAL_FEATURES flag is considered correctly within the\n+    index.html, it needs to be set before Ember.js is loaded. Since there is\n+    currently no way to access the `window` object within config/environment.js\n+    (and hereby check if there is a query parameter present for the checkbox),\n+    a script is injected, before Ember.js is loaded. The script checks if there\n+    is no value yet for the ENABLE_OPTIONAL_FEATURES flag, and if so, it sets\n+    the flag to true when there is a `enableoptionalfeatures` query parameter.\n+   */\n+  contentFor: function(name) {\n+    if (name === \"vendor-prefix\") {\n+      var array = [\n+        \"<!-- injected by lib/enable-optional-features-via-url -->\",\n+        \"window.EmberENV = window.EmberENV || {};\",\n+        \"if (typeof window.EmberENV.ENABLE_OPTIONAL_FEATURES === 'undefined') {\",\n+        \"  window.EmberENV.ENABLE_OPTIONAL_FEATURES = window.location.search.indexOf('enableoptionalfeatures') !== -1;\",\n+        \"}\"\n+      ];\n+\n+      return array.join('\\n');\n+    }\n+  }","path":"lib/enable-optional-features-via-url/index.js","position":26,"original_position":26,"commit_id":"a1cdc95aad289b66202949a13ac57d2ac10d4284","original_commit_id":"a1cdc95aad289b66202949a13ac57d2ac10d4284","user":{"login":"pangratz","id":341877,"avatar_url":"https://avatars.githubusercontent.com/u/341877?v=3","gravatar_id":"","url":"https://api.github.com/users/pangratz","html_url":"https://github.com/pangratz","followers_url":"https://api.github.com/users/pangratz/followers","following_url":"https://api.github.com/users/pangratz/following{/other_user}","gists_url":"https://api.github.com/users/pangratz/gists{/gist_id}","starred_url":"https://api.github.com/users/pangratz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pangratz/subscriptions","organizations_url":"https://api.github.com/users/pangratz/orgs","repos_url":"https://api.github.com/users/pangratz/repos","events_url":"https://api.github.com/users/pangratz/events{/privacy}","received_events_url":"https://api.github.com/users/pangratz/received_events","type":"User","site_admin":false},"body":":+1: absolutely","created_at":"2015-12-10T19:02:22Z","updated_at":"2015-12-10T19:02:22Z","html_url":"https://github.com/emberjs/data/pull/3979#discussion_r47268609","pull_request_url":"https://api.github.com/repos/emberjs/data/pulls/3979","_links":{"self":{"href":"https://api.github.com/repos/emberjs/data/pulls/comments/47268609"},"html":{"href":"https://github.com/emberjs/data/pull/3979#discussion_r47268609"},"pull_request":{"href":"https://api.github.com/repos/emberjs/data/pulls/3979"}}},"pull_request":{"url":"https://api.github.com/repos/emberjs/data/pulls/3979","id":53032213,"html_url":"https://github.com/emberjs/data/pull/3979","diff_url":"https://github.com/emberjs/data/pull/3979.diff","patch_url":"https://github.com/emberjs/data/pull/3979.patch","issue_url":"https://api.github.com/repos/emberjs/data/issues/3979","number":3979,"state":"open","locked":false,"title":"Re-enable feature flags","user":{"login":"pangratz","id":341877,"avatar_url":"https://avatars.githubusercontent.com/u/341877?v=3","gravatar_id":"","url":"https://api.github.com/users/pangratz","html_url":"https://github.com/pangratz","followers_url":"https://api.github.com/users/pangratz/followers","following_url":"https://api.github.com/users/pangratz/following{/other_user}","gists_url":"https://api.github.com/users/pangratz/gists{/gist_id}","starred_url":"https://api.github.com/users/pangratz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pangratz/subscriptions","organizations_url":"https://api.github.com/users/pangratz/orgs","repos_url":"https://api.github.com/users/pangratz/repos","events_url":"https://api.github.com/users/pangratz/events{/privacy}","received_events_url":"https://api.github.com/users/pangratz/received_events","type":"User","site_admin":false},"body":"This re-enables testing feature flags and stripping disabled feature flags from production build (using [ember-cli/babel-plugin-feature-flags](https://github.com/ember-cli/babel-plugin-feature-flags)).\r\n\r\nFeature flags are now possible within ember-data by using the following setup:\r\n\r\n```js\r\nimport isEnabled from 'ember-data/features';\r\n\r\nif (isEnabled(\"ds-my-feature\")) {\r\n  // ...\r\n}\r\n```\r\n\r\nThe features need to be defined within `config/features.json`. Disabled feature flags are also stripped from production builds.\r\n\r\n---\r\n\r\nRunning the tests with all optional feature flags enabled is possible via `ember test --environment=test-optional-features`. When the tests are run via `ember serve`, the optional feature flags can be enabled via a checkbox.\r\n\r\n---\r\n\r\nThis addresses #3922.","created_at":"2015-12-08T20:15:18Z","updated_at":"2015-12-10T19:02:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"54afdd69b121312982dcbc69c08d51198e627339","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/emberjs/data/pulls/3979/commits","review_comments_url":"https://api.github.com/repos/emberjs/data/pulls/3979/comments","review_comment_url":"https://api.github.com/repos/emberjs/data/pulls/comments{/number}","comments_url":"https://api.github.com/repos/emberjs/data/issues/3979/comments","statuses_url":"https://api.github.com/repos/emberjs/data/statuses/a1cdc95aad289b66202949a13ac57d2ac10d4284","head":{"label":"pangratz:feature_flags","ref":"feature_flags","sha":"a1cdc95aad289b66202949a13ac57d2ac10d4284","user":{"login":"pangratz","id":341877,"avatar_url":"https://avatars.githubusercontent.com/u/341877?v=3","gravatar_id":"","url":"https://api.github.com/users/pangratz","html_url":"https://github.com/pangratz","followers_url":"https://api.github.com/users/pangratz/followers","following_url":"https://api.github.com/users/pangratz/following{/other_user}","gists_url":"https://api.github.com/users/pangratz/gists{/gist_id}","starred_url":"https://api.github.com/users/pangratz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pangratz/subscriptions","organizations_url":"https://api.github.com/users/pangratz/orgs","repos_url":"https://api.github.com/users/pangratz/repos","events_url":"https://api.github.com/users/pangratz/events{/privacy}","received_events_url":"https://api.github.com/users/pangratz/received_events","type":"User","site_admin":false},"repo":{"id":3021258,"name":"data","full_name":"pangratz/data","owner":{"login":"pangratz","id":341877,"avatar_url":"https://avatars.githubusercontent.com/u/341877?v=3","gravatar_id":"","url":"https://api.github.com/users/pangratz","html_url":"https://github.com/pangratz","followers_url":"https://api.github.com/users/pangratz/followers","following_url":"https://api.github.com/users/pangratz/following{/other_user}","gists_url":"https://api.github.com/users/pangratz/gists{/gist_id}","starred_url":"https://api.github.com/users/pangratz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pangratz/subscriptions","organizations_url":"https://api.github.com/users/pangratz/orgs","repos_url":"https://api.github.com/users/pangratz/repos","events_url":"https://api.github.com/users/pangratz/events{/privacy}","received_events_url":"https://api.github.com/users/pangratz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pangratz/data","description":"A data persistence library for Ember.js.","fork":true,"url":"https://api.github.com/repos/pangratz/data","forks_url":"https://api.github.com/repos/pangratz/data/forks","keys_url":"https://api.github.com/repos/pangratz/data/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pangratz/data/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pangratz/data/teams","hooks_url":"https://api.github.com/repos/pangratz/data/hooks","issue_events_url":"https://api.github.com/repos/pangratz/data/issues/events{/number}","events_url":"https://api.github.com/repos/pangratz/data/events","assignees_url":"https://api.github.com/repos/pangratz/data/assignees{/user}","branches_url":"https://api.github.com/repos/pangratz/data/branches{/branch}","tags_url":"https://api.github.com/repos/pangratz/data/tags","blobs_url":"https://api.github.com/repos/pangratz/data/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pangratz/data/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pangratz/data/git/refs{/sha}","trees_url":"https://api.github.com/repos/pangratz/data/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pangratz/data/statuses/{sha}","languages_url":"https://api.github.com/repos/pangratz/data/languages","stargazers_url":"https://api.github.com/repos/pangratz/data/stargazers","contributors_url":"https://api.github.com/repos/pangratz/data/contributors","subscribers_url":"https://api.github.com/repos/pangratz/data/subscribers","subscription_url":"https://api.github.com/repos/pangratz/data/subscription","commits_url":"https://api.github.com/repos/pangratz/data/commits{/sha}","git_commits_url":"https://api.github.com/repos/pangratz/data/git/commits{/sha}","comments_url":"https://api.github.com/repos/pangratz/data/comments{/number}","issue_comment_url":"https://api.github.com/repos/pangratz/data/issues/comments{/number}","contents_url":"https://api.github.com/repos/pangratz/data/contents/{+path}","compare_url":"https://api.github.com/repos/pangratz/data/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pangratz/data/merges","archive_url":"https://api.github.com/repos/pangratz/data/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pangratz/data/downloads","issues_url":"https://api.github.com/repos/pangratz/data/issues{/number}","pulls_url":"https://api.github.com/repos/pangratz/data/pulls{/number}","milestones_url":"https://api.github.com/repos/pangratz/data/milestones{/number}","notifications_url":"https://api.github.com/repos/pangratz/data/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pangratz/data/labels{/name}","releases_url":"https://api.github.com/repos/pangratz/data/releases{/id}","created_at":"2011-12-20T17:39:07Z","updated_at":"2015-05-08T20:55:11Z","pushed_at":"2015-12-09T10:42:10Z","git_url":"git://github.com/pangratz/data.git","ssh_url":"git@github.com:pangratz/data.git","clone_url":"https://github.com/pangratz/data.git","svn_url":"https://github.com/pangratz/data","homepage":"","size":10507,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"emberjs:master","ref":"master","sha":"342919e7bde2cb24c060f1692da1add9faa751ca","user":{"login":"emberjs","id":1253363,"avatar_url":"https://avatars.githubusercontent.com/u/1253363?v=3","gravatar_id":"","url":"https://api.github.com/users/emberjs","html_url":"https://github.com/emberjs","followers_url":"https://api.github.com/users/emberjs/followers","following_url":"https://api.github.com/users/emberjs/following{/other_user}","gists_url":"https://api.github.com/users/emberjs/gists{/gist_id}","starred_url":"https://api.github.com/users/emberjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emberjs/subscriptions","organizations_url":"https://api.github.com/users/emberjs/orgs","repos_url":"https://api.github.com/users/emberjs/repos","events_url":"https://api.github.com/users/emberjs/events{/privacy}","received_events_url":"https://api.github.com/users/emberjs/received_events","type":"Organization","site_admin":false},"repo":{"id":3016562,"name":"data","full_name":"emberjs/data","owner":{"login":"emberjs","id":1253363,"avatar_url":"https://avatars.githubusercontent.com/u/1253363?v=3","gravatar_id":"","url":"https://api.github.com/users/emberjs","html_url":"https://github.com/emberjs","followers_url":"https://api.github.com/users/emberjs/followers","following_url":"https://api.github.com/users/emberjs/following{/other_user}","gists_url":"https://api.github.com/users/emberjs/gists{/gist_id}","starred_url":"https://api.github.com/users/emberjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emberjs/subscriptions","organizations_url":"https://api.github.com/users/emberjs/orgs","repos_url":"https://api.github.com/users/emberjs/repos","events_url":"https://api.github.com/users/emberjs/events{/privacy}","received_events_url":"https://api.github.com/users/emberjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/emberjs/data","description":"A data persistence library for Ember.js.","fork":false,"url":"https://api.github.com/repos/emberjs/data","forks_url":"https://api.github.com/repos/emberjs/data/forks","keys_url":"https://api.github.com/repos/emberjs/data/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emberjs/data/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emberjs/data/teams","hooks_url":"https://api.github.com/repos/emberjs/data/hooks","issue_events_url":"https://api.github.com/repos/emberjs/data/issues/events{/number}","events_url":"https://api.github.com/repos/emberjs/data/events","assignees_url":"https://api.github.com/repos/emberjs/data/assignees{/user}","branches_url":"https://api.github.com/repos/emberjs/data/branches{/branch}","tags_url":"https://api.github.com/repos/emberjs/data/tags","blobs_url":"https://api.github.com/repos/emberjs/data/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emberjs/data/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emberjs/data/git/refs{/sha}","trees_url":"https://api.github.com/repos/emberjs/data/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emberjs/data/statuses/{sha}","languages_url":"https://api.github.com/repos/emberjs/data/languages","stargazers_url":"https://api.github.com/repos/emberjs/data/stargazers","contributors_url":"https://api.github.com/repos/emberjs/data/contributors","subscribers_url":"https://api.github.com/repos/emberjs/data/subscribers","subscription_url":"https://api.github.com/repos/emberjs/data/subscription","commits_url":"https://api.github.com/repos/emberjs/data/commits{/sha}","git_commits_url":"https://api.github.com/repos/emberjs/data/git/commits{/sha}","comments_url":"https://api.github.com/repos/emberjs/data/comments{/number}","issue_comment_url":"https://api.github.com/repos/emberjs/data/issues/comments{/number}","contents_url":"https://api.github.com/repos/emberjs/data/contents/{+path}","compare_url":"https://api.github.com/repos/emberjs/data/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emberjs/data/merges","archive_url":"https://api.github.com/repos/emberjs/data/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emberjs/data/downloads","issues_url":"https://api.github.com/repos/emberjs/data/issues{/number}","pulls_url":"https://api.github.com/repos/emberjs/data/pulls{/number}","milestones_url":"https://api.github.com/repos/emberjs/data/milestones{/number}","notifications_url":"https://api.github.com/repos/emberjs/data/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emberjs/data/labels{/name}","releases_url":"https://api.github.com/repos/emberjs/data/releases{/id}","created_at":"2011-12-20T01:50:40Z","updated_at":"2015-12-10T09:54:41Z","pushed_at":"2015-12-09T18:23:28Z","git_url":"git://github.com/emberjs/data.git","ssh_url":"git@github.com:emberjs/data.git","clone_url":"https://github.com/emberjs/data.git","svn_url":"https://github.com/emberjs/data","homepage":"","size":17345,"stargazers_count":2587,"watchers_count":2587,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1000,"mirror_url":null,"open_issues_count":258,"forks":1000,"open_issues":258,"watchers":2587,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/emberjs/data/pulls/3979"},"html":{"href":"https://github.com/emberjs/data/pull/3979"},"issue":{"href":"https://api.github.com/repos/emberjs/data/issues/3979"},"comments":{"href":"https://api.github.com/repos/emberjs/data/issues/3979/comments"},"review_comments":{"href":"https://api.github.com/repos/emberjs/data/pulls/3979/comments"},"review_comment":{"href":"https://api.github.com/repos/emberjs/data/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/emberjs/data/pulls/3979/commits"},"statuses":{"href":"https://api.github.com/repos/emberjs/data/statuses/a1cdc95aad289b66202949a13ac57d2ac10d4284"}}}}