{"action":"opened","number":3335,"pull_request":{"url":"https://api.github.com/repos/babel/babel/pulls/3335","id":58558960,"html_url":"https://github.com/babel/babel/pull/3335","diff_url":"https://github.com/babel/babel/pull/3335.diff","patch_url":"https://github.com/babel/babel/pull/3335.patch","issue_url":"https://api.github.com/repos/babel/babel/issues/3335","number":3335,"state":"open","locked":false,"title":"Add lossy traversal method type","user":{"login":"kittens","id":853712,"avatar_url":"https://avatars.githubusercontent.com/u/853712?v=3","gravatar_id":"","url":"https://api.github.com/users/kittens","html_url":"https://github.com/kittens","followers_url":"https://api.github.com/users/kittens/followers","following_url":"https://api.github.com/users/kittens/following{/other_user}","gists_url":"https://api.github.com/users/kittens/gists{/gist_id}","starred_url":"https://api.github.com/users/kittens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kittens/subscriptions","organizations_url":"https://api.github.com/users/kittens/orgs","repos_url":"https://api.github.com/users/kittens/repos","events_url":"https://api.github.com/users/kittens/events{/privacy}","received_events_url":"https://api.github.com/users/kittens/received_events","type":"User","site_admin":false},"body":"This adds a new type of visitor method called `lossy`. The idea behind these is that they're only necessary when a transform is **lossy** AKA information is lost due to a transform. They're specified like so:\r\n\r\n```javsacript\r\n({\r\n  ClassExpression: {\r\n    lossy(path) {}\r\n  }\r\n});\r\n```\r\n\r\nThings to note about this:\r\n\r\n - Only one lossy function can be specified per node type.\r\n - They're ran on `exit`.\r\n - They're always the last `exit` function.\r\n\r\nOne scenario where this became an issue is that one of the transforms they use internally for [relay](https://github.com/facebook/relay) transforms `Relay.QL` tagged template literals. This means that their transform needs to happen before the internal one.\r\n\r\nThis prevents plugins needing to specify any sort of ordering information as this lossy transforms is the largest cause of these issues.This is especially problematic when people try and write plugins that are interopable with the internal ones. This gets tricky as sometimes you need to be aware of the behaviour of the internal visitor and on what method a replacement is triggered on. This will hopefully negate a lot of that and we make the lossy methods public API that can actually be relied upon..\r\n\r\nI've only converted the `transform-es2015-classes` plugin, I can do the rest if we decide that this is a good way to go. Also tests will follow if this is :+1:. Also I'm ambivalent to the \"lossy\" name so I'm open to alternate names.","created_at":"2016-02-07T22:07:48Z","updated_at":"2016-02-07T22:07:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/babel/babel/pulls/3335/commits","review_comments_url":"https://api.github.com/repos/babel/babel/pulls/3335/comments","review_comment_url":"https://api.github.com/repos/babel/babel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/babel/babel/issues/3335/comments","statuses_url":"https://api.github.com/repos/babel/babel/statuses/885154d605b9e2969dd5c1b8c6e26441fb9aa41f","head":{"label":"babel:lossy","ref":"lossy","sha":"885154d605b9e2969dd5c1b8c6e26441fb9aa41f","user":{"login":"babel","id":9637642,"avatar_url":"https://avatars.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":24560307,"name":"babel","full_name":"babel/babel","owner":{"login":"babel","id":9637642,"avatar_url":"https://avatars.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/babel","description":"Babel is a compiler for writing next generation JavaScript.","fork":false,"url":"https://api.github.com/repos/babel/babel","forks_url":"https://api.github.com/repos/babel/babel/forks","keys_url":"https://api.github.com/repos/babel/babel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/babel/babel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/babel/babel/teams","hooks_url":"https://api.github.com/repos/babel/babel/hooks","issue_events_url":"https://api.github.com/repos/babel/babel/issues/events{/number}","events_url":"https://api.github.com/repos/babel/babel/events","assignees_url":"https://api.github.com/repos/babel/babel/assignees{/user}","branches_url":"https://api.github.com/repos/babel/babel/branches{/branch}","tags_url":"https://api.github.com/repos/babel/babel/tags","blobs_url":"https://api.github.com/repos/babel/babel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/babel/babel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/babel/babel/git/refs{/sha}","trees_url":"https://api.github.com/repos/babel/babel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/babel/babel/statuses/{sha}","languages_url":"https://api.github.com/repos/babel/babel/languages","stargazers_url":"https://api.github.com/repos/babel/babel/stargazers","contributors_url":"https://api.github.com/repos/babel/babel/contributors","subscribers_url":"https://api.github.com/repos/babel/babel/subscribers","subscription_url":"https://api.github.com/repos/babel/babel/subscription","commits_url":"https://api.github.com/repos/babel/babel/commits{/sha}","git_commits_url":"https://api.github.com/repos/babel/babel/git/commits{/sha}","comments_url":"https://api.github.com/repos/babel/babel/comments{/number}","issue_comment_url":"https://api.github.com/repos/babel/babel/issues/comments{/number}","contents_url":"https://api.github.com/repos/babel/babel/contents/{+path}","compare_url":"https://api.github.com/repos/babel/babel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/babel/babel/merges","archive_url":"https://api.github.com/repos/babel/babel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/babel/babel/downloads","issues_url":"https://api.github.com/repos/babel/babel/issues{/number}","pulls_url":"https://api.github.com/repos/babel/babel/pulls{/number}","milestones_url":"https://api.github.com/repos/babel/babel/milestones{/number}","notifications_url":"https://api.github.com/repos/babel/babel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/babel/babel/labels{/name}","releases_url":"https://api.github.com/repos/babel/babel/releases{/id}","deployments_url":"https://api.github.com/repos/babel/babel/deployments","created_at":"2014-09-28T13:38:23Z","updated_at":"2016-02-07T21:45:23Z","pushed_at":"2016-02-07T22:04:32Z","git_url":"git://github.com/babel/babel.git","ssh_url":"git@github.com:babel/babel.git","clone_url":"https://github.com/babel/babel.git","svn_url":"https://github.com/babel/babel","homepage":"https://babeljs.io/","size":13786,"stargazers_count":13595,"watchers_count":13595,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":888,"mirror_url":null,"open_issues_count":190,"forks":888,"open_issues":190,"watchers":13595,"default_branch":"master"}},"base":{"label":"babel:master","ref":"master","sha":"8191681dfa1af7fc6b976e83e0887c9eba4e6dae","user":{"login":"babel","id":9637642,"avatar_url":"https://avatars.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":24560307,"name":"babel","full_name":"babel/babel","owner":{"login":"babel","id":9637642,"avatar_url":"https://avatars.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/babel","description":"Babel is a compiler for writing next generation JavaScript.","fork":false,"url":"https://api.github.com/repos/babel/babel","forks_url":"https://api.github.com/repos/babel/babel/forks","keys_url":"https://api.github.com/repos/babel/babel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/babel/babel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/babel/babel/teams","hooks_url":"https://api.github.com/repos/babel/babel/hooks","issue_events_url":"https://api.github.com/repos/babel/babel/issues/events{/number}","events_url":"https://api.github.com/repos/babel/babel/events","assignees_url":"https://api.github.com/repos/babel/babel/assignees{/user}","branches_url":"https://api.github.com/repos/babel/babel/branches{/branch}","tags_url":"https://api.github.com/repos/babel/babel/tags","blobs_url":"https://api.github.com/repos/babel/babel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/babel/babel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/babel/babel/git/refs{/sha}","trees_url":"https://api.github.com/repos/babel/babel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/babel/babel/statuses/{sha}","languages_url":"https://api.github.com/repos/babel/babel/languages","stargazers_url":"https://api.github.com/repos/babel/babel/stargazers","contributors_url":"https://api.github.com/repos/babel/babel/contributors","subscribers_url":"https://api.github.com/repos/babel/babel/subscribers","subscription_url":"https://api.github.com/repos/babel/babel/subscription","commits_url":"https://api.github.com/repos/babel/babel/commits{/sha}","git_commits_url":"https://api.github.com/repos/babel/babel/git/commits{/sha}","comments_url":"https://api.github.com/repos/babel/babel/comments{/number}","issue_comment_url":"https://api.github.com/repos/babel/babel/issues/comments{/number}","contents_url":"https://api.github.com/repos/babel/babel/contents/{+path}","compare_url":"https://api.github.com/repos/babel/babel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/babel/babel/merges","archive_url":"https://api.github.com/repos/babel/babel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/babel/babel/downloads","issues_url":"https://api.github.com/repos/babel/babel/issues{/number}","pulls_url":"https://api.github.com/repos/babel/babel/pulls{/number}","milestones_url":"https://api.github.com/repos/babel/babel/milestones{/number}","notifications_url":"https://api.github.com/repos/babel/babel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/babel/babel/labels{/name}","releases_url":"https://api.github.com/repos/babel/babel/releases{/id}","deployments_url":"https://api.github.com/repos/babel/babel/deployments","created_at":"2014-09-28T13:38:23Z","updated_at":"2016-02-07T21:45:23Z","pushed_at":"2016-02-07T22:04:32Z","git_url":"git://github.com/babel/babel.git","ssh_url":"git@github.com:babel/babel.git","clone_url":"https://github.com/babel/babel.git","svn_url":"https://github.com/babel/babel","homepage":"https://babeljs.io/","size":13786,"stargazers_count":13595,"watchers_count":13595,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":888,"mirror_url":null,"open_issues_count":190,"forks":888,"open_issues":190,"watchers":13595,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/babel/babel/pulls/3335"},"html":{"href":"https://github.com/babel/babel/pull/3335"},"issue":{"href":"https://api.github.com/repos/babel/babel/issues/3335"},"comments":{"href":"https://api.github.com/repos/babel/babel/issues/3335/comments"},"review_comments":{"href":"https://api.github.com/repos/babel/babel/pulls/3335/comments"},"review_comment":{"href":"https://api.github.com/repos/babel/babel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/babel/babel/pulls/3335/commits"},"statuses":{"href":"https://api.github.com/repos/babel/babel/statuses/885154d605b9e2969dd5c1b8c6e26441fb9aa41f"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":100,"deletions":28,"changed_files":3}}