refactor(ivy): split util functions into different files (#28382)
Google3 detected circular references here, so splitting up this rather hodge-podge list of functions into slightly better organizational units. PR Close #28382
This commit is contained in:
@ -16,7 +16,6 @@ import {assertDefined} from '../util/assert';
|
||||
import {assertComponentType} from './assert';
|
||||
import {getComponentDef} from './definition';
|
||||
import {diPublicInInjector, getOrCreateNodeInjectorForNode} from './di';
|
||||
import {publishDefaultGlobalUtils} from './global_utils';
|
||||
import {registerPostOrderHooks, registerPreOrderHooks} from './hooks';
|
||||
import {CLEAN_PROMISE, addToViewTree, createLView, createNodeAtIndex, createTView, getOrCreateTView, initNodeFlags, instantiateRootComponent, invokeHostBindingsInCreationMode, locateHostElement, queueComponentIndexForCheck, refreshDescendantViews} from './instructions';
|
||||
import {ComponentDef, ComponentType, RenderFlags} from './interfaces/definition';
|
||||
@ -24,8 +23,12 @@ import {TElementNode, TNode, TNodeFlags, TNodeType} from './interfaces/node';
|
||||
import {PlayerHandler} from './interfaces/player';
|
||||
import {RElement, Renderer3, RendererFactory3, domRendererFactory3} from './interfaces/renderer';
|
||||
import {CONTEXT, FLAGS, HEADER_OFFSET, LView, LViewFlags, RootContext, RootContextFlags, TVIEW} from './interfaces/view';
|
||||
import {applyOnCreateInstructions} from './node_util';
|
||||
import {enterView, getPreviousOrParentTNode, leaveView, resetComponentState, setCurrentDirectiveDef} from './state';
|
||||
import {applyOnCreateInstructions, defaultScheduler, getRootView, readPatchedLView, renderStringify} from './util';
|
||||
import {publishDefaultGlobalUtils} from './util/global_utils';
|
||||
import {defaultScheduler, renderStringify} from './util/misc_utils';
|
||||
import {getRootContext, getRootView} from './util/view_traversal_utils';
|
||||
import {readPatchedLView} from './util/view_utils';
|
||||
|
||||
|
||||
|
||||
@ -245,19 +248,6 @@ export function LifecycleHooksFeature(component: any, def: ComponentDef<any>): v
|
||||
rootTView, { directiveStart: dirIndex, directiveEnd: dirIndex + 1 } as TNode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the root context for any component by walking the parent `LView` until
|
||||
* reaching the root `LView`.
|
||||
*
|
||||
* @param component any component
|
||||
*/
|
||||
function getRootContext(component: any): RootContext {
|
||||
const rootContext = getRootView(component)[CONTEXT] as RootContext;
|
||||
ngDevMode && assertDefined(rootContext, 'rootContext');
|
||||
return rootContext;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Wait on component until it is rendered.
|
||||
*
|
||||
|
Reference in New Issue
Block a user