refactor(core): Remove reliance on TNodeType.View. (#38707)

`TNodeType.View` was created to support inline views. That feature did
not materialize and we have since removed the instructions for it, leave
 an unneeded `TNodeType.View` which was still used in a very
 inconsistent way. This change no longer created `TNodeType.View` (and
 there will be a follow up chang to completely remove it.)

Also simplified the mental model so that `LView[HOST]`/`LView[T_HOST]`
always point to the insertion location of the `LView`.

PR Close #38707
This commit is contained in:
Misko Hevery
2020-09-14 11:21:15 -07:00
committed by Alex Rickabaugh
parent b2579d43cd
commit eb32b6bd6b
45 changed files with 372 additions and 377 deletions

View File

@ -261,10 +261,10 @@ export function renderTemplate<T>(
const renderer = providedRendererFactory.createRenderer(null, null);
// We need to create a root view so it's possible to look up the host element through its index
const tView = createTView(TViewType.Root, -1, null, 1, 0, null, null, null, null, null);
const tView = createTView(TViewType.Root, null, null, 1, 0, null, null, null, null, null);
const hostLView = createLView(
null, tView, {}, LViewFlags.CheckAlways | LViewFlags.IsRoot, null, null,
providedRendererFactory, renderer);
providedRendererFactory, renderer, null, null);
enterView(hostLView);
const def: ComponentDef<any> = ɵɵdefineComponent({
@ -282,7 +282,7 @@ export function renderTemplate<T>(
hostLView[hostTNode.index] = hostNode;
componentView = createLView(
hostLView, componentTView, context, LViewFlags.CheckAlways, hostNode, hostTNode,
providedRendererFactory, renderer, sanitizer);
providedRendererFactory, renderer, sanitizer || null, null);
}
renderComponentOrTemplate(componentView[TVIEW], componentView, templateFn, context);
return componentView;