fix(views): remove dynamic component views, free host views, free embedded views

Closes #2472
Closes #2339

BREAKING CHANGE
- `Compiler.compile` has been removed, the only way to compile
  components dynamically is via `Compiler.compileInHost`
- `DynamicComponentLoader.loadIntoExistingLocation` has changed:
  * renamed into `loadIntoLocation`
  * will always create the host element as well
  * requires an element with a variable inside of the host component view
    next to which it will load new component.
- `DynamicComponentLoader.loadNextToExistingLocation` was renamed into
  `DynamicComponentLoader.loadNextToLocation`
- `DynamicComponentLoader.loadIntoNewLocation` is removed
  * use `DynamicComponentLoader.loadNextToLocation` instead
    and then move the view nodes
    manually around via `DomRenderer.getRootNodes()`
- `AppViewManager.{create,destroy}Free{Host,Embedded}View` was removed
  * use `AppViewManager.createViewInContainer` and then move the view nodes
    manually around via `DomRenderer.getRootNodes()`
- `Renderer.detachFreeView` was removed. Use `DomRenderer.getRootNodes()`
  to get the root nodes of a view and detach them manually.
This commit is contained in:
Tobias Bosch
2015-06-16 09:45:03 -07:00
parent df6acedd25
commit 5dee8e26cc
28 changed files with 386 additions and 1045 deletions

View File

@ -58,12 +58,12 @@ export function main() {
function compileNoBindings() {
cache.clear();
return compiler.compile(BenchmarkComponentNoBindings);
return compiler.compileInHost(BenchmarkComponentNoBindings);
}
function compileWithBindings() {
cache.clear();
return compiler.compile(BenchmarkComponentWithBindings);
return compiler.compileInHost(BenchmarkComponentWithBindings);
}
bindAction('#compileNoBindings', measureWrapper(compileNoBindings, 'No Bindings'));
@ -122,7 +122,7 @@ class MultipleTemplateResolver extends TemplateResolver {
}
}
@Component()
@Component({selector: 'cmp-nobind'})
@View({
directives: [Dir0, Dir1, Dir2, Dir3, Dir4],
template: `
@ -140,7 +140,7 @@ class MultipleTemplateResolver extends TemplateResolver {
class BenchmarkComponentNoBindings {
}
@Component()
@Component({selector: 'cmp-withbind'})
@View({
directives: [Dir0, Dir1, Dir2, Dir3, Dir4],
template: `