{"action":"created","issue":{"url":"https://api.github.com/repos/babel/babel/issues/8147","repository_url":"https://api.github.com/repos/babel/babel","labels_url":"https://api.github.com/repos/babel/babel/issues/8147/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel/issues/8147/comments","events_url":"https://api.github.com/repos/babel/babel/issues/8147/events","html_url":"https://github.com/babel/babel/issues/8147","id":331288926,"node_id":"MDU6SXNzdWUzMzEyODg5MjY=","number":8147,"title":"Determine if site is using Babel","user":{"login":"acconrad","id":422184,"node_id":"MDQ6VXNlcjQyMjE4NA==","avatar_url":"https://avatars3.githubusercontent.com/u/422184?v=4","gravatar_id":"","url":"https://api.github.com/users/acconrad","html_url":"https://github.com/acconrad","followers_url":"https://api.github.com/users/acconrad/followers","following_url":"https://api.github.com/users/acconrad/following{/other_user}","gists_url":"https://api.github.com/users/acconrad/gists{/gist_id}","starred_url":"https://api.github.com/users/acconrad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acconrad/subscriptions","organizations_url":"https://api.github.com/users/acconrad/orgs","repos_url":"https://api.github.com/users/acconrad/repos","events_url":"https://api.github.com/users/acconrad/events{/privacy}","received_events_url":"https://api.github.com/users/acconrad/received_events","type":"User","site_admin":false},"labels":[{"id":441984845,"node_id":"MDU6TGFiZWw0NDE5ODQ4NDU=","url":"https://api.github.com/repos/babel/babel/labels/i:%20enhancement","name":"i: enhancement","color":"e99695","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-06-11T17:56:06Z","updated_at":"2018-06-20T06:55:20Z","closed_at":null,"author_association":"NONE","body":"## Feature Request\r\n\r\n**Is your feature request related to a problem? Please describe.**\r\nI spoke with @hzoo and one thing we realized is that it's currently very difficult to determine if a site is using Babel or not.\r\n\r\n**Describe the solution you'd like**\r\nI see two solutions:\r\n\r\n1. **Prepend the AST to have a `__babelVersion` global variable**. This is the most intuitive and simple solution. Simply make this string variable the first thing to output to the AST so that someone can go into the console of their browser and type `__babelVersion` to get something like `7.0.0-beta49`. **Drawbacks:** bloating the AST and adding a global variable is not exactly desirable.\r\n2. **Create a plugin for a version string**. This fits into the more traditional model of \"everything is a plugin first\" approach and sort of gates this as a feature. There is also no global variable so it's still searchable via something like BigQuery without having to pollute the global scope. **Drawbacks:** plugins require opt-in (unless we auto-include this plugin along with `babel-core`) and it's really only useful for the Babel team. It won't be nearly as transparent to the end user for their own debugging purposes, and isn't nearly as easy for our own purposes to determine if Babel is in use.\r\n\r\n**Describe alternatives you've considered**\r\nCurrently you can determine Babel through some convoluted mechanisms of searching for particular strings in the outputted code.\r\n\r\n**Teachability, Documentation, Adoption, Migration Strategy**\r\nAs mentioned above, for end users, solution 1 is as simple as typing out `__babelVersion` into the console. For solution 2, it's more about being able to grep in the output for a babel version string so people can see it is in use. Nothing really too complicated here.\r\n"},"comment":{"url":"https://api.github.com/repos/babel/babel/issues/comments/398644236","html_url":"https://github.com/babel/babel/issues/8147#issuecomment-398644236","issue_url":"https://api.github.com/repos/babel/babel/issues/8147","id":398644236,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODY0NDIzNg==","user":{"login":"xtuc","id":1493671,"node_id":"MDQ6VXNlcjE0OTM2NzE=","avatar_url":"https://avatars3.githubusercontent.com/u/1493671?v=4","gravatar_id":"","url":"https://api.github.com/users/xtuc","html_url":"https://github.com/xtuc","followers_url":"https://api.github.com/users/xtuc/followers","following_url":"https://api.github.com/users/xtuc/following{/other_user}","gists_url":"https://api.github.com/users/xtuc/gists{/gist_id}","starred_url":"https://api.github.com/users/xtuc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xtuc/subscriptions","organizations_url":"https://api.github.com/users/xtuc/orgs","repos_url":"https://api.github.com/users/xtuc/repos","events_url":"https://api.github.com/users/xtuc/events{/privacy}","received_events_url":"https://api.github.com/users/xtuc/received_events","type":"User","site_admin":false},"created_at":"2018-06-20T06:55:20Z","updated_at":"2018-06-20T06:55:20Z","author_association":"MEMBER","body":"I'm not a fan of injecting specific code into the generated code and we'll likely have many duplicates on a single page. \r\n\r\nI just want to mention that GitHub has a great code analysis tool/team. "}}
{"actor":{"display_login":"xtuc"}}