{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/4837","labels_url":"https://api.github.com/repos/angular/angular/issues/4837/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/4837/comments","events_url":"https://api.github.com/repos/angular/angular/issues/4837/events","html_url":"https://github.com/angular/angular/issues/4837","id":112426884,"number":4837,"title":"refactor(upgrade): better names for adapter APIs","user":{"login":"PascalPrecht","id":445106,"avatar_url":"https://avatars.githubusercontent.com/u/445106?v=3","gravatar_id":"","url":"https://api.github.com/users/PascalPrecht","html_url":"https://github.com/PascalPrecht","followers_url":"https://api.github.com/users/PascalPrecht/followers","following_url":"https://api.github.com/users/PascalPrecht/following{/other_user}","gists_url":"https://api.github.com/users/PascalPrecht/gists{/gist_id}","starred_url":"https://api.github.com/users/PascalPrecht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PascalPrecht/subscriptions","organizations_url":"https://api.github.com/users/PascalPrecht/orgs","repos_url":"https://api.github.com/users/PascalPrecht/repos","events_url":"https://api.github.com/users/PascalPrecht/events{/privacy}","received_events_url":"https://api.github.com/users/PascalPrecht/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-10-20T18:11:15Z","updated_at":"2015-10-24T10:05:39Z","closed_at":null,"body":"Currently the `UpgradeAdapter` comes with two APIs to make Angular 1 and Angular 2 components interoperable:\r\n\r\n- `upgradeNg1Component('directiveName')` - upgrades an A1 directive to A2 and allows us to define it as directive dependency on an A2 component\r\n- `downgradeNg2Component(Ng2Component)` - downgrades an A2 component to an A1 directive so we can bootstrap it in A1 application.\r\n\r\nThere are two things that feel a bit weird when using those APIs, mainly because the names don't really fit.\r\n\r\n1. The idea of `upgrade` is that we're *upgrading* an Angular 1 app to Angular 2. However, when we take an A2 component and we want to bootstrap in an A1 module, we have to *downgrade* it. While this is technically true, the naming says the total opposite of what we actually wanna do.\r\n\r\n2.  During upgrade, an Angular 2 component *always* lives in an A1 module. So even if we have an A2 component that uses A1 directives using `upgradeNg1Component()`, we have to *downgrade* the A2 component again to make it available to the outer A1 module. Again, technically this is all correct, but it feels weird from a naming perspective that we upgrade A1 components in A2 components that will be downgraded again.\r\n\r\nNot sure if we should go back to `import/export` or, what @petebacondarwin suggested, \"wrapping\" an A1 component as A2 component and vice versa.\r\n\r\nAnother idea that came up by @arvidkahl was sth. \"transforming\" a component. So maybe `transformNg1Component()` and `transformNg2Component()` although, those two names don't really say what we're transforming to..\r\n\r\nJust leaving that here, would love to here your thoughts on this @mhevery "},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/150780376","html_url":"https://github.com/angular/angular/issues/4837#issuecomment-150780376","issue_url":"https://api.github.com/repos/angular/angular/issues/4837","id":150780376,"user":{"login":"PascalPrecht","id":445106,"avatar_url":"https://avatars.githubusercontent.com/u/445106?v=3","gravatar_id":"","url":"https://api.github.com/users/PascalPrecht","html_url":"https://github.com/PascalPrecht","followers_url":"https://api.github.com/users/PascalPrecht/followers","following_url":"https://api.github.com/users/PascalPrecht/following{/other_user}","gists_url":"https://api.github.com/users/PascalPrecht/gists{/gist_id}","starred_url":"https://api.github.com/users/PascalPrecht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PascalPrecht/subscriptions","organizations_url":"https://api.github.com/users/PascalPrecht/orgs","repos_url":"https://api.github.com/users/PascalPrecht/repos","events_url":"https://api.github.com/users/PascalPrecht/events{/privacy}","received_events_url":"https://api.github.com/users/PascalPrecht/received_events","type":"User","site_admin":false},"created_at":"2015-10-24T10:05:39Z","updated_at":"2015-10-24T10:05:39Z","body":"> I am not sure I understand you argument that the names are opposite of what you want to do. I upgrade ng1 so that it can be used in ng2, and you downgrade ng2 so that it can be used in ng1.\r\n\r\n@mhevery Yupp, as I said, technically this is all very correct. It's just that the word \"downgrade\" doesn't really fit into the process of \"upgrading\". \r\n\r\nI think we have various proposals here now, maybe we can go with one of those?"}}