{"action":"created","comment":{"url":"https://api.github.com/repos/babel/ember-cli-babel/pulls/comments/113825911","pull_request_review_id":35248662,"id":113825911,"diff_hunk":"@@ -95,6 +95,77 @@ treeForAddon(tree) {\n }\n ```\n \n+### Debug Tooling\n+\n+In order to allow apps and addons to easily provide good development mode ergonomics (assertions, deprecations, etc) but\n+still perform well in production mode ember-cli-babel automatically manages stripping / removing certain debug\n+statements. This concept was originally proposed in [ember-cli/rfcs#50](https://github.com/ember-cli/rfcs/pull/50), \n+but has been slightly modified during implementation (after researching what works well and what does not).\n+\n+#### Debug Macros\n+\n+To add convienient deprecations and assertions, consumers (in either an app or an addon) can do the following:","path":"README.md","position":13,"original_position":13,"commit_id":"a4c476dc5464d261ccc6c37ce97a405220ffeee0","original_commit_id":"bf1c6b5bb64335351caea63bc09cc33a5184f469","user":{"login":"rwjblue","id":12637,"avatar_url":"https://avatars3.githubusercontent.com/u/12637?v=3","gravatar_id":"","url":"https://api.github.com/users/rwjblue","html_url":"https://github.com/rwjblue","followers_url":"https://api.github.com/users/rwjblue/followers","following_url":"https://api.github.com/users/rwjblue/following{/other_user}","gists_url":"https://api.github.com/users/rwjblue/gists{/gist_id}","starred_url":"https://api.github.com/users/rwjblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwjblue/subscriptions","organizations_url":"https://api.github.com/users/rwjblue/orgs","repos_url":"https://api.github.com/users/rwjblue/repos","events_url":"https://api.github.com/users/rwjblue/events{/privacy}","received_events_url":"https://api.github.com/users/rwjblue/received_events","type":"User","site_admin":false},"body":"Good point, updated!","created_at":"2017-04-27T23:39:06Z","updated_at":"2017-04-27T23:39:06Z","html_url":"https://github.com/babel/ember-cli-babel/pull/133#discussion_r113825911","pull_request_url":"https://api.github.com/repos/babel/ember-cli-babel/pulls/133","_links":{"self":{"href":"https://api.github.com/repos/babel/ember-cli-babel/pulls/comments/113825911"},"html":{"href":"https://github.com/babel/ember-cli-babel/pull/133#discussion_r113825911"},"pull_request":{"href":"https://api.github.com/repos/babel/ember-cli-babel/pulls/133"}}},"pull_request":{"url":"https://api.github.com/repos/babel/ember-cli-babel/pulls/133","id":117118036,"html_url":"https://github.com/babel/ember-cli-babel/pull/133","diff_url":"https://github.com/babel/ember-cli-babel/pull/133.diff","patch_url":"https://github.com/babel/ember-cli-babel/pull/133.patch","issue_url":"https://api.github.com/repos/babel/ember-cli-babel/issues/133","number":133,"state":"open","locked":false,"title":"Add debug tooling babel plugins.","user":{"login":"rwjblue","id":12637,"avatar_url":"https://avatars3.githubusercontent.com/u/12637?v=3","gravatar_id":"","url":"https://api.github.com/users/rwjblue","html_url":"https://github.com/rwjblue","followers_url":"https://api.github.com/users/rwjblue/followers","following_url":"https://api.github.com/users/rwjblue/following{/other_user}","gists_url":"https://api.github.com/users/rwjblue/gists{/gist_id}","starred_url":"https://api.github.com/users/rwjblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwjblue/subscriptions","organizations_url":"https://api.github.com/users/rwjblue/orgs","repos_url":"https://api.github.com/users/rwjblue/repos","events_url":"https://api.github.com/users/rwjblue/events{/privacy}","received_events_url":"https://api.github.com/users/rwjblue/received_events","type":"User","site_admin":false},"body":"Implements [ember-cli/rfcs#50](https://github.com/ember-cli/rfcs/pull/50) and the `@ember/debug` portion of https://github.com/emberjs/rfcs/pull/176.\r\n\r\nBelow is the documentation being added to the README explaining the feature.\r\n\r\n---\r\n\r\n### Debug Tooling\r\n\r\nIn order to allow addons to easily provide good development mode ergonomics (assertions, deprecations, etc) but still perform well in production mode ember-cli-babel automatically manages stripping / removing certain debug statements. This concept was originally proposed in [ember-cli/rfcs#50](https://github.com/ember-cli/rfcs/pull/50),  but has been slightly modified during implementation (after researching what works well and what does not).\r\n\r\n#### Debug Macros\r\n\r\nTo add convienient deprecations and assertions, consumers (apps and/or addons) can do the following:\r\n\r\n```js\r\nimport { deprecate, assert } from '@ember/debug';\r\n\r\nexport default Ember.Component.extend({\r\n  init() {\r\n    this._super(...arguments);\r\n    deprecate(\r\n      'Passing a string value or the `sauce` parameter is deprecated, please pass an instance of Sauce instead',\r\n      false,\r\n      { until: '1.0.0', id: 'some-addon-sauce' }\r\n    );\r\n    assert('You must provide sauce for x-awesome.', this.sauce);\r\n  }\r\n})\r\n```\r\n\r\nIn testing and development environments those statements will be executed (and assert or deprecate as appropriate), but\r\nin production builds they will be inert (and stripped during minification).\r\n\r\n#### General Purpose Env Flags\r\n\r\nIn some cases you may have the need to do things in debug builds that isn't related to asserts/deprecations/etc. For\r\nexample, you may expose certain API's for debugging only. You can do that via the `DEBUG` environment flag:\r\n\r\n```js\r\nimport { DEBUG } from '@glimmer/env';\r\n\r\nconst Component = Ember.Component.extend();\r\n\r\nif (DEBUG) {\r\n  Component.reopen({\r\n    specialMethodForDebugging() {\r\n      // do things ;)\r\n    }\r\n  });\r\n}\r\n```\r\n\r\nIn testing and development environments `DEBUG` will be replaced by the boolean literal `true`, and in production builds it will be replaced by `false`. When ran through a minifier (with dead code elimination) the entire section will be stripped.\r\n#### Disabling Debug Tooling Support\r\n\r\nIf for some reason you need to disable this debug tooling, you can opt-out via configuration.\r\n\r\nIn an app that would look like:\r\n\r\n```js\r\n// ember-cli-build.js\r\nmodule.exports = function(defaults) {\r\n  let app = new EmberApp(defaults, {\r\n    'ember-cli-babel': {\r\n      disableDebugTooling: true\r\n    }\r\n  });\r\n\r\n  return app.toTree();\r\n}\r\n```\r\n\r\nIn an addon that would look like:\r\n\r\n```js\r\n// index.js\r\n\r\n// ...snip...\r\ninit() {\r\n  this._super.init.apply(this, arguments);\r\n\r\n  this.options['ember-cli-babel'] = this.options['ember-cli-babel'] || {};\r\n  this.options['ember-cli-babel'].disableDebugTooling = true;\r\n}\r\n// ...snip...\r\n```","created_at":"2017-04-22T17:28:00Z","updated_at":"2017-04-27T23:39:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f1a49e74b51346bd569e6eee79407bfacdd56a1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/babel/ember-cli-babel/pulls/133/commits","review_comments_url":"https://api.github.com/repos/babel/ember-cli-babel/pulls/133/comments","review_comment_url":"https://api.github.com/repos/babel/ember-cli-babel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/babel/ember-cli-babel/issues/133/comments","statuses_url":"https://api.github.com/repos/babel/ember-cli-babel/statuses/a4c476dc5464d261ccc6c37ce97a405220ffeee0","head":{"label":"rwjblue:add-stripping","ref":"add-stripping","sha":"a4c476dc5464d261ccc6c37ce97a405220ffeee0","user":{"login":"rwjblue","id":12637,"avatar_url":"https://avatars3.githubusercontent.com/u/12637?v=3","gravatar_id":"","url":"https://api.github.com/users/rwjblue","html_url":"https://github.com/rwjblue","followers_url":"https://api.github.com/users/rwjblue/followers","following_url":"https://api.github.com/users/rwjblue/following{/other_user}","gists_url":"https://api.github.com/users/rwjblue/gists{/gist_id}","starred_url":"https://api.github.com/users/rwjblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwjblue/subscriptions","organizations_url":"https://api.github.com/users/rwjblue/orgs","repos_url":"https://api.github.com/users/rwjblue/repos","events_url":"https://api.github.com/users/rwjblue/events{/privacy}","received_events_url":"https://api.github.com/users/rwjblue/received_events","type":"User","site_admin":false},"repo":{"id":31292301,"name":"ember-cli-babel","full_name":"rwjblue/ember-cli-babel","owner":{"login":"rwjblue","id":12637,"avatar_url":"https://avatars3.githubusercontent.com/u/12637?v=3","gravatar_id":"","url":"https://api.github.com/users/rwjblue","html_url":"https://github.com/rwjblue","followers_url":"https://api.github.com/users/rwjblue/followers","following_url":"https://api.github.com/users/rwjblue/following{/other_user}","gists_url":"https://api.github.com/users/rwjblue/gists{/gist_id}","starred_url":"https://api.github.com/users/rwjblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwjblue/subscriptions","organizations_url":"https://api.github.com/users/rwjblue/orgs","repos_url":"https://api.github.com/users/rwjblue/repos","events_url":"https://api.github.com/users/rwjblue/events{/privacy}","received_events_url":"https://api.github.com/users/rwjblue/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rwjblue/ember-cli-babel","description":null,"fork":true,"url":"https://api.github.com/repos/rwjblue/ember-cli-babel","forks_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/forks","keys_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/teams","hooks_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/hooks","issue_events_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/issues/events{/number}","events_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/events","assignees_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/assignees{/user}","branches_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/branches{/branch}","tags_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/tags","blobs_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/git/refs{/sha}","trees_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/statuses/{sha}","languages_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/languages","stargazers_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/stargazers","contributors_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/contributors","subscribers_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/subscribers","subscription_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/subscription","commits_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/commits{/sha}","git_commits_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/git/commits{/sha}","comments_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/comments{/number}","issue_comment_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/issues/comments{/number}","contents_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/contents/{+path}","compare_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/merges","archive_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/downloads","issues_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/issues{/number}","pulls_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/pulls{/number}","milestones_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/milestones{/number}","notifications_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/labels{/name}","releases_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/releases{/id}","deployments_url":"https://api.github.com/repos/rwjblue/ember-cli-babel/deployments","created_at":"2015-02-25T01:58:02Z","updated_at":"2015-02-25T01:58:05Z","pushed_at":"2017-04-27T23:38:50Z","git_url":"git://github.com/rwjblue/ember-cli-babel.git","ssh_url":"git@github.com:rwjblue/ember-cli-babel.git","clone_url":"https://github.com/rwjblue/ember-cli-babel.git","svn_url":"https://github.com/rwjblue/ember-cli-babel","homepage":null,"size":198,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"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":0,"default_branch":"master"}},"base":{"label":"babel:master","ref":"master","sha":"12945fb0f41e7f6aea4563d9a40c63f4757344f8","user":{"login":"babel","id":9637642,"avatar_url":"https://avatars2.githubusercontent.com/u/9637642?v=3","gravatar_id":"","url":"https://api.github.com/users/babel","html_url":"https://github.com/babel","followers_url":"https://api.github.com/users/babel/followers","following_url":"https://api.github.com/users/babel/following{/other_user}","gists_url":"https://api.github.com/users/babel/gists{/gist_id}","starred_url":"https://api.github.com/users/babel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/babel/subscriptions","organizations_url":"https://api.github.com/users/babel/orgs","repos_url":"https://api.github.com/users/babel/repos","events_url":"https://api.github.com/users/babel/events{/privacy}","received_events_url":"https://api.github.com/users/babel/received_events","type":"Organization","site_admin":false},"repo":{"id":28096281,"name":"ember-cli-babel","full_name":"babel/ember-cli-babel","owner":{"login":"babel","id":9637642,"avatar_url":"https://avatars2.githubusercontent.com/u/9637642?v=3","gravatar_id":"","url":"https://api.github.com/users/babel","html_url":"https://github.com/babel","followers_url":"https://api.github.com/users/babel/followers","following_url":"https://api.github.com/users/babel/following{/other_user}","gists_url":"https://api.github.com/users/babel/gists{/gist_id}","starred_url":"https://api.github.com/users/babel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/babel/subscriptions","organizations_url":"https://api.github.com/users/babel/orgs","repos_url":"https://api.github.com/users/babel/repos","events_url":"https://api.github.com/users/babel/events{/privacy}","received_events_url":"https://api.github.com/users/babel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/babel/ember-cli-babel","description":"Ember CLI plugin for Babel","fork":false,"url":"https://api.github.com/repos/babel/ember-cli-babel","forks_url":"https://api.github.com/repos/babel/ember-cli-babel/forks","keys_url":"https://api.github.com/repos/babel/ember-cli-babel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/babel/ember-cli-babel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/babel/ember-cli-babel/teams","hooks_url":"https://api.github.com/repos/babel/ember-cli-babel/hooks","issue_events_url":"https://api.github.com/repos/babel/ember-cli-babel/issues/events{/number}","events_url":"https://api.github.com/repos/babel/ember-cli-babel/events","assignees_url":"https://api.github.com/repos/babel/ember-cli-babel/assignees{/user}","branches_url":"https://api.github.com/repos/babel/ember-cli-babel/branches{/branch}","tags_url":"https://api.github.com/repos/babel/ember-cli-babel/tags","blobs_url":"https://api.github.com/repos/babel/ember-cli-babel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/babel/ember-cli-babel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/babel/ember-cli-babel/git/refs{/sha}","trees_url":"https://api.github.com/repos/babel/ember-cli-babel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/babel/ember-cli-babel/statuses/{sha}","languages_url":"https://api.github.com/repos/babel/ember-cli-babel/languages","stargazers_url":"https://api.github.com/repos/babel/ember-cli-babel/stargazers","contributors_url":"https://api.github.com/repos/babel/ember-cli-babel/contributors","subscribers_url":"https://api.github.com/repos/babel/ember-cli-babel/subscribers","subscription_url":"https://api.github.com/repos/babel/ember-cli-babel/subscription","commits_url":"https://api.github.com/repos/babel/ember-cli-babel/commits{/sha}","git_commits_url":"https://api.github.com/repos/babel/ember-cli-babel/git/commits{/sha}","comments_url":"https://api.github.com/repos/babel/ember-cli-babel/comments{/number}","issue_comment_url":"https://api.github.com/repos/babel/ember-cli-babel/issues/comments{/number}","contents_url":"https://api.github.com/repos/babel/ember-cli-babel/contents/{+path}","compare_url":"https://api.github.com/repos/babel/ember-cli-babel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/babel/ember-cli-babel/merges","archive_url":"https://api.github.com/repos/babel/ember-cli-babel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/babel/ember-cli-babel/downloads","issues_url":"https://api.github.com/repos/babel/ember-cli-babel/issues{/number}","pulls_url":"https://api.github.com/repos/babel/ember-cli-babel/pulls{/number}","milestones_url":"https://api.github.com/repos/babel/ember-cli-babel/milestones{/number}","notifications_url":"https://api.github.com/repos/babel/ember-cli-babel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/babel/ember-cli-babel/labels{/name}","releases_url":"https://api.github.com/repos/babel/ember-cli-babel/releases{/id}","deployments_url":"https://api.github.com/repos/babel/ember-cli-babel/deployments","created_at":"2014-12-16T16:44:30Z","updated_at":"2017-04-23T05:03:54Z","pushed_at":"2017-04-27T23:38:51Z","git_url":"git://github.com/babel/ember-cli-babel.git","ssh_url":"git@github.com:babel/ember-cli-babel.git","clone_url":"https://github.com/babel/ember-cli-babel.git","svn_url":"https://github.com/babel/ember-cli-babel","homepage":"","size":188,"stargazers_count":83,"watchers_count":83,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":45,"mirror_url":null,"open_issues_count":11,"forks":45,"open_issues":11,"watchers":83,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/babel/ember-cli-babel/pulls/133"},"html":{"href":"https://github.com/babel/ember-cli-babel/pull/133"},"issue":{"href":"https://api.github.com/repos/babel/ember-cli-babel/issues/133"},"comments":{"href":"https://api.github.com/repos/babel/ember-cli-babel/issues/133/comments"},"review_comments":{"href":"https://api.github.com/repos/babel/ember-cli-babel/pulls/133/comments"},"review_comment":{"href":"https://api.github.com/repos/babel/ember-cli-babel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/babel/ember-cli-babel/pulls/133/commits"},"statuses":{"href":"https://api.github.com/repos/babel/ember-cli-babel/statuses/a4c476dc5464d261ccc6c37ce97a405220ffeee0"}}}}
{"actor":{"display_login":"rwjblue"}}