refactor(ivy): prefix all generated instructions (#29692)
- Updates all instructions to be prefixed with the Greek delta symbol PR Close #29692
This commit is contained in:
@ -16,8 +16,10 @@ import {NO_CHANGE} from '../tokens';
|
||||
* Allocates the necessary amount of slots for host vars.
|
||||
*
|
||||
* @param count Amount of vars to be allocated
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function allocHostVars(count: number): void {
|
||||
export function ΔallocHostVars(count: number): void {
|
||||
const lView = getLView();
|
||||
const tView = lView[TVIEW];
|
||||
if (!tView.firstTemplatePass) return;
|
||||
|
@ -27,8 +27,10 @@ import {addToViewTree, createDirectivesAndLocals, createLContainer, createNodeAt
|
||||
* % }
|
||||
*
|
||||
* @param index The index of the container in the data array
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function container(index: number): void {
|
||||
export function Δcontainer(index: number): void {
|
||||
const tNode = containerInternal(index, null, null);
|
||||
const lView = getLView();
|
||||
if (lView[TVIEW].firstTemplatePass) {
|
||||
@ -54,8 +56,10 @@ export function container(index: number): void {
|
||||
* @param localRefs A set of local reference bindings on the element.
|
||||
* @param localRefExtractor A function which extracts local-refs values from the template.
|
||||
* Defaults to the current element associated with the local-ref.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function template(
|
||||
export function Δtemplate(
|
||||
index: number, templateFn: ComponentTemplate<any>| null, consts: number, vars: number,
|
||||
tagName?: string | null, attrs?: TAttributes | null, localRefs?: string[] | null,
|
||||
localRefExtractor?: LocalRefExtractor) {
|
||||
@ -80,8 +84,10 @@ export function template(
|
||||
* Sets a container up to receive views.
|
||||
*
|
||||
* @param index The index of the container in the data array
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function containerRefreshStart(index: number): void {
|
||||
export function ΔcontainerRefreshStart(index: number): void {
|
||||
const lView = getLView();
|
||||
const tView = lView[TVIEW];
|
||||
let previousOrParentTNode = loadInternal(tView.data, index) as TNode;
|
||||
@ -101,8 +107,10 @@ export function containerRefreshStart(index: number): void {
|
||||
* Marks the end of the LContainer.
|
||||
*
|
||||
* Marking the end of LContainer is the time when to child views get inserted or removed.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function containerRefreshEnd(): void {
|
||||
export function ΔcontainerRefreshEnd(): void {
|
||||
let previousOrParentTNode = getPreviousOrParentTNode();
|
||||
if (getIsParent()) {
|
||||
setIsParent(false);
|
||||
|
@ -19,22 +19,25 @@ import {getLView, getPreviousOrParentTNode} from '../state';
|
||||
*
|
||||
* Usage example (in factory function):
|
||||
*
|
||||
* ```ts
|
||||
* class SomeDirective {
|
||||
* constructor(directive: DirectiveA) {}
|
||||
*
|
||||
* static ngDirectiveDef = defineDirective({
|
||||
* static ngDirectiveDef = ΔdefineDirective({
|
||||
* type: SomeDirective,
|
||||
* factory: () => new SomeDirective(directiveInject(DirectiveA))
|
||||
* factory: () => new SomeDirective(ΔdirectiveInject(DirectiveA))
|
||||
* });
|
||||
* }
|
||||
*
|
||||
* ```
|
||||
* @param token the type or token to inject
|
||||
* @param flags Injection flags
|
||||
* @returns the value from the injector or `null` when not found
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function directiveInject<T>(token: Type<T>| InjectionToken<T>): T;
|
||||
export function directiveInject<T>(token: Type<T>| InjectionToken<T>, flags: InjectFlags): T;
|
||||
export function directiveInject<T>(
|
||||
export function ΔdirectiveInject<T>(token: Type<T>| InjectionToken<T>): T;
|
||||
export function ΔdirectiveInject<T>(token: Type<T>| InjectionToken<T>, flags: InjectFlags): T;
|
||||
export function ΔdirectiveInject<T>(
|
||||
token: Type<T>| InjectionToken<T>, flags = InjectFlags.Default): T|null {
|
||||
token = resolveForwardRef(token);
|
||||
return getOrCreateInjectable<T>(
|
||||
@ -44,7 +47,9 @@ export function directiveInject<T>(
|
||||
|
||||
/**
|
||||
* Facade for the attribute injection from DI.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function injectAttribute(attrNameToInject: string): string|null {
|
||||
export function ΔinjectAttribute(attrNameToInject: string): string|null {
|
||||
return injectAttributeImpl(getPreviousOrParentTNode(), attrNameToInject);
|
||||
}
|
||||
|
@ -41,8 +41,10 @@ import {getActiveDirectiveStylingIndex} from './styling';
|
||||
* Attributes and localRefs are passed as an array of strings where elements with an even index
|
||||
* hold an attribute name and elements with an odd index hold an attribute value, ex.:
|
||||
* ['id', 'warning5', 'class', 'alert']
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function elementStart(
|
||||
export function ΔelementStart(
|
||||
index: number, name: string, attrs?: TAttributes | null, localRefs?: string[] | null): void {
|
||||
const lView = getLView();
|
||||
const tView = lView[TVIEW];
|
||||
@ -122,8 +124,12 @@ export function elementStart(
|
||||
executeContentQueries(tView, tNode, lView);
|
||||
}
|
||||
|
||||
/** Mark the end of the element. */
|
||||
export function elementEnd(): void {
|
||||
/**
|
||||
* Mark the end of the element.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function ΔelementEnd(): void {
|
||||
let previousOrParentTNode = getPreviousOrParentTNode();
|
||||
if (getIsParent()) {
|
||||
setIsParent(false);
|
||||
@ -172,11 +178,13 @@ export function elementEnd(): void {
|
||||
* @param attrs Statically bound set of attributes, classes, and styles to be written into the DOM
|
||||
* element on creation. Use [AttributeMarker] to denote the meaning of this array.
|
||||
* @param localRefs A set of local reference bindings on the element.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function element(
|
||||
export function Δelement(
|
||||
index: number, name: string, attrs?: TAttributes | null, localRefs?: string[] | null): void {
|
||||
elementStart(index, name, attrs, localRefs);
|
||||
elementEnd();
|
||||
ΔelementStart(index, name, attrs, localRefs);
|
||||
ΔelementEnd();
|
||||
}
|
||||
|
||||
|
||||
@ -189,8 +197,10 @@ export function element(
|
||||
* Otherwise the attribute value is set to the stringified value.
|
||||
* @param sanitizer An optional function used to sanitize the value.
|
||||
* @param namespace Optional namespace to use when setting the attribute.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function elementAttribute(
|
||||
export function ΔelementAttribute(
|
||||
index: number, name: string, value: any, sanitizer?: SanitizerFn | null,
|
||||
namespace?: string): void {
|
||||
if (value !== NO_CHANGE) {
|
||||
@ -258,7 +268,7 @@ export function elementAttribute(
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function elementHostAttrs(attrs: TAttributes) {
|
||||
export function ΔelementHostAttrs(attrs: TAttributes) {
|
||||
const hostElementIndex = getSelectedIndex();
|
||||
const lView = getLView();
|
||||
const tNode = getTNode(hostElementIndex, lView);
|
||||
|
@ -28,8 +28,10 @@ import {createDirectivesAndLocals, createNodeAtIndex, executeContentQueries, set
|
||||
* Even if this instruction accepts a set of attributes no actual attribute values are propagated to
|
||||
* the DOM (as a comment node can't have attributes). Attributes are here only for directive
|
||||
* matching purposes and setting initial inputs of directives.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function elementContainerStart(
|
||||
export function ΔelementContainerStart(
|
||||
index: number, attrs?: TAttributes | null, localRefs?: string[] | null): void {
|
||||
const lView = getLView();
|
||||
const tView = lView[TVIEW];
|
||||
@ -65,8 +67,12 @@ export function elementContainerStart(
|
||||
executeContentQueries(tView, tNode, lView);
|
||||
}
|
||||
|
||||
/** Mark the end of the <ng-container>. */
|
||||
export function elementContainerEnd(): void {
|
||||
/**
|
||||
* Mark the end of the <ng-container>.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function ΔelementContainerEnd(): void {
|
||||
let previousOrParentTNode = getPreviousOrParentTNode();
|
||||
const lView = getLView();
|
||||
const tView = lView[TVIEW];
|
||||
|
@ -23,8 +23,10 @@ import {assignTViewNodeToLView, createLView, createTView, refreshDescendantViews
|
||||
*
|
||||
* @param viewBlockId The ID of this view
|
||||
* @return boolean Whether or not this view is in creation mode
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function embeddedViewStart(viewBlockId: number, consts: number, vars: number): RenderFlags {
|
||||
export function ΔembeddedViewStart(viewBlockId: number, consts: number, vars: number): RenderFlags {
|
||||
const lView = getLView();
|
||||
const previousOrParentTNode = getPreviousOrParentTNode();
|
||||
// The previous node can be a view node if we are processing an inline for loop
|
||||
@ -122,8 +124,12 @@ function scanForView(lContainer: LContainer, startIdx: number, viewBlockId: numb
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Marks the end of an embedded view. */
|
||||
export function embeddedViewEnd(): void {
|
||||
/**
|
||||
* Marks the end of an embedded view.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function ΔembeddedViewEnd(): void {
|
||||
const lView = getLView();
|
||||
const viewHost = lView[T_HOST];
|
||||
|
||||
|
@ -14,7 +14,9 @@ import {getLView} from '../state';
|
||||
* Used in conjunction with the restoreView() instruction to save a snapshot
|
||||
* of the current view and restore it when listeners are invoked. This allows
|
||||
* walking the declaration view tree in listeners to get vars from parent views.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function getCurrentView(): OpaqueViewState {
|
||||
export function ΔgetCurrentView(): OpaqueViewState {
|
||||
return getLView() as any as OpaqueViewState;
|
||||
}
|
||||
|
@ -28,8 +28,10 @@ import {BindingDirection, generatePropertyAliases, getCleanup, handleError, load
|
||||
* @param useCapture Whether or not to use capture in event listener
|
||||
* @param eventTargetResolver Function that returns global target information in case this listener
|
||||
* should be attached to a global object like window, document or body
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function listener(
|
||||
export function Δlistener(
|
||||
eventName: string, listenerFn: (e?: any) => any, useCapture = false,
|
||||
eventTargetResolver?: GlobalTargetResolver): void {
|
||||
listenerInternal(eventName, listenerFn, useCapture, eventTargetResolver);
|
||||
@ -53,8 +55,10 @@ export function listener(
|
||||
* @param useCapture Whether or not to use capture in event listener
|
||||
* @param eventTargetResolver Function that returns global target information in case this listener
|
||||
* should be attached to a global object like window, document or body
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function componentHostSyntheticListener<T>(
|
||||
export function ΔcomponentHostSyntheticListener<T>(
|
||||
eventName: string, listenerFn: (e?: any) => any, useCapture = false,
|
||||
eventTargetResolver?: GlobalTargetResolver): void {
|
||||
listenerInternal(eventName, listenerFn, useCapture, eventTargetResolver, loadComponentRenderer);
|
||||
|
@ -6,4 +6,4 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
export {namespaceHTML, namespaceMathML, namespaceSVG} from '../state';
|
||||
export {ΔnamespaceHTML, ΔnamespaceMathML, ΔnamespaceSVG} from '../state';
|
||||
|
@ -16,7 +16,9 @@ import {nextContextImpl} from '../state';
|
||||
*
|
||||
* @param level The relative level of the view from which to grab context compared to contextVewData
|
||||
* @returns context
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function nextContext<T = any>(level: number = 1): T {
|
||||
export function ΔnextContext<T = any>(level: number = 1): T {
|
||||
return nextContextImpl(level);
|
||||
}
|
||||
|
@ -34,8 +34,10 @@ import {createNodeAtIndex} from './shared';
|
||||
*
|
||||
* @param selectors A collection of parsed CSS selectors
|
||||
* @param rawSelectors A collection of CSS selectors in the raw, un-parsed form
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function projectionDef(selectors?: CssSelectorList[], textSelectors?: string[]): void {
|
||||
export function ΔprojectionDef(selectors?: CssSelectorList[], textSelectors?: string[]): void {
|
||||
const componentNode = findComponentView(getLView())[T_HOST] as TElementNode;
|
||||
|
||||
if (!componentNode.projection) {
|
||||
@ -72,8 +74,10 @@ export function projectionDef(selectors?: CssSelectorList[], textSelectors?: str
|
||||
* @param selectorIndex:
|
||||
* - 0 when the selector is `*` (or unspecified as this is the default value),
|
||||
* - 1 based index of the selector from the {@link projectionDef}
|
||||
*/
|
||||
export function projection(nodeIndex: number, selectorIndex: number = 0, attrs?: string[]): void {
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Δprojection(nodeIndex: number, selectorIndex: number = 0, attrs?: string[]): void {
|
||||
const lView = getLView();
|
||||
const tProjectionNode =
|
||||
createNodeAtIndex(nodeIndex, TNodeType.Projection, null, null, attrs || null);
|
||||
|
@ -38,22 +38,26 @@ import {TsickleIssue1009, initializeTNodeInputs, loadComponentRenderer, setInput
|
||||
* (this is necessary for host property bindings)
|
||||
* @returns This function returns itself so that it may be chained
|
||||
* (e.g. `property('name', ctx.name)('title', ctx.title)`)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function property<T>(
|
||||
export function Δproperty<T>(
|
||||
propName: string, value: T, sanitizer?: SanitizerFn | null,
|
||||
nativeOnly?: boolean): TsickleIssue1009 {
|
||||
const index = getSelectedIndex();
|
||||
const bindReconciledValue = bind(value);
|
||||
const bindReconciledValue = Δbind(value);
|
||||
elementPropertyInternal(index, propName, bindReconciledValue, sanitizer, nativeOnly);
|
||||
return property;
|
||||
return Δproperty;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single value binding.
|
||||
*
|
||||
* @param value Value to diff
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function bind<T>(value: T): T|NO_CHANGE {
|
||||
export function Δbind<T>(value: T): T|NO_CHANGE {
|
||||
const lView = getLView();
|
||||
const bindingIndex = lView[BINDING_INDEX]++;
|
||||
storeBindingMetadata(lView);
|
||||
@ -75,8 +79,10 @@ export function bind<T>(value: T): T|NO_CHANGE {
|
||||
* @param sanitizer An optional function used to sanitize the value.
|
||||
* @param nativeOnly Whether or not we should only set native properties and skip input check
|
||||
* (this is necessary for host property bindings)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function elementProperty<T>(
|
||||
export function ΔelementProperty<T>(
|
||||
index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null,
|
||||
nativeOnly?: boolean): void {
|
||||
elementPropertyInternal(index, propName, value, sanitizer, nativeOnly);
|
||||
@ -102,8 +108,10 @@ export function elementProperty<T>(
|
||||
* @param sanitizer An optional function used to sanitize the value.
|
||||
* @param nativeOnly Whether or not we should only set native properties and skip input check
|
||||
* (this is necessary for host property bindings)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function componentHostSyntheticProperty<T>(
|
||||
export function ΔcomponentHostSyntheticProperty<T>(
|
||||
index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null,
|
||||
nativeOnly?: boolean) {
|
||||
elementPropertyInternal(index, propName, value, sanitizer, nativeOnly, loadComponentRenderer);
|
||||
|
@ -24,8 +24,10 @@ import {storeBindingMetadata} from './shared';
|
||||
* - has evaluated expressions at odd indexes.
|
||||
*
|
||||
* Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function interpolationV(values: any[]): string|NO_CHANGE {
|
||||
export function ΔinterpolationV(values: any[]): string|NO_CHANGE {
|
||||
ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');
|
||||
ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');
|
||||
let different = false;
|
||||
@ -67,16 +69,22 @@ export function interpolationV(values: any[]): string|NO_CHANGE {
|
||||
* @param prefix static value used for concatenation only.
|
||||
* @param v0 value checked for change.
|
||||
* @param suffix static value used for concatenation only.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function interpolation1(prefix: string, v0: any, suffix: string): string|NO_CHANGE {
|
||||
export function Δinterpolation1(prefix: string, v0: any, suffix: string): string|NO_CHANGE {
|
||||
const lView = getLView();
|
||||
const different = bindingUpdated(lView, lView[BINDING_INDEX]++, v0);
|
||||
storeBindingMetadata(lView, prefix, suffix);
|
||||
return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;
|
||||
}
|
||||
|
||||
/** Creates an interpolation binding with 2 expressions. */
|
||||
export function interpolation2(
|
||||
/**
|
||||
* Creates an interpolation binding with 2 expressions.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Δinterpolation2(
|
||||
prefix: string, v0: any, i0: string, v1: any, suffix: string): string|NO_CHANGE {
|
||||
const lView = getLView();
|
||||
const bindingIndex = lView[BINDING_INDEX];
|
||||
@ -92,8 +100,12 @@ export function interpolation2(
|
||||
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;
|
||||
}
|
||||
|
||||
/** Creates an interpolation binding with 3 expressions. */
|
||||
export function interpolation3(
|
||||
/**
|
||||
* Creates an interpolation binding with 3 expressions.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Δinterpolation3(
|
||||
prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string): string|
|
||||
NO_CHANGE {
|
||||
const lView = getLView();
|
||||
@ -114,8 +126,12 @@ export function interpolation3(
|
||||
NO_CHANGE;
|
||||
}
|
||||
|
||||
/** Create an interpolation binding with 4 expressions. */
|
||||
export function interpolation4(
|
||||
/**
|
||||
* Create an interpolation binding with 4 expressions.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Δinterpolation4(
|
||||
prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,
|
||||
suffix: string): string|NO_CHANGE {
|
||||
const lView = getLView();
|
||||
@ -138,8 +154,12 @@ export function interpolation4(
|
||||
NO_CHANGE;
|
||||
}
|
||||
|
||||
/** Creates an interpolation binding with 5 expressions. */
|
||||
export function interpolation5(
|
||||
/**
|
||||
* Creates an interpolation binding with 5 expressions.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Δinterpolation5(
|
||||
prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,
|
||||
i3: string, v4: any, suffix: string): string|NO_CHANGE {
|
||||
const lView = getLView();
|
||||
@ -164,8 +184,12 @@ export function interpolation5(
|
||||
NO_CHANGE;
|
||||
}
|
||||
|
||||
/** Creates an interpolation binding with 6 expressions. */
|
||||
export function interpolation6(
|
||||
/**
|
||||
* Creates an interpolation binding with 6 expressions.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Δinterpolation6(
|
||||
prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,
|
||||
i3: string, v4: any, i4: string, v5: any, suffix: string): string|NO_CHANGE {
|
||||
const lView = getLView();
|
||||
@ -191,8 +215,12 @@ export function interpolation6(
|
||||
NO_CHANGE;
|
||||
}
|
||||
|
||||
/** Creates an interpolation binding with 7 expressions. */
|
||||
export function interpolation7(
|
||||
/**
|
||||
* Creates an interpolation binding with 7 expressions.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Δinterpolation7(
|
||||
prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,
|
||||
i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, suffix: string): string|
|
||||
NO_CHANGE {
|
||||
@ -221,8 +249,12 @@ export function interpolation7(
|
||||
NO_CHANGE;
|
||||
}
|
||||
|
||||
/** Creates an interpolation binding with 8 expressions. */
|
||||
export function interpolation8(
|
||||
/**
|
||||
* Creates an interpolation binding with 8 expressions.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Δinterpolation8(
|
||||
prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,
|
||||
i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any,
|
||||
suffix: string): string|NO_CHANGE {
|
||||
|
@ -18,18 +18,20 @@ import {getCheckNoChangesMode, getLView, setSelectedIndex} from '../state';
|
||||
*
|
||||
* ```ts
|
||||
* (rf: RenderFlags, ctx: any) => {
|
||||
* if (rf & 1) {
|
||||
* element(0, 'div');
|
||||
* }
|
||||
* if (rf & 2) {
|
||||
* select(0); // Select the <div/> created above.
|
||||
* property('title', 'test');
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* @param index the index of the item to act on with the following instructions
|
||||
*/
|
||||
export function select(index: number): void {
|
||||
* if (rf & 1) {
|
||||
* element(0, 'div');
|
||||
* }
|
||||
* if (rf & 2) {
|
||||
* select(0); // Select the <div/> created above.
|
||||
* property('title', 'test');
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* @param index the index of the item to act on with the following instructions
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Δselect(index: number): void {
|
||||
ngDevMode && assertGreaterThan(index, -1, 'Invalid index');
|
||||
ngDevMode &&
|
||||
assertLessThan(
|
||||
|
@ -27,7 +27,7 @@ import {StylingContext} from '../interfaces/styling';
|
||||
import {BINDING_INDEX, CHILD_HEAD, CHILD_TAIL, CLEANUP, CONTEXT, DECLARATION_VIEW, ExpandoInstructions, FLAGS, HEADER_OFFSET, HOST, INJECTOR, InitPhaseState, LView, LViewFlags, NEXT, PARENT, QUERIES, RENDERER, RENDERER_FACTORY, RootContext, RootContextFlags, SANITIZER, TVIEW, TView, T_HOST} from '../interfaces/view';
|
||||
import {assertNodeOfPossibleTypes, assertNodeType} from '../node_assert';
|
||||
import {isNodeMatchingSelectorList} from '../node_selector_matcher';
|
||||
import {enterView, getBindingsEnabled, getCheckNoChangesMode, getIsParent, getLView, getNamespace, getPreviousOrParentTNode, incrementActiveDirectiveId, isCreationMode, leaveView, namespaceHTML, resetComponentState, setActiveHostElement, setBindingRoot, setCheckNoChangesMode, setCurrentDirectiveDef, setCurrentQueryIndex, setIsParent, setPreviousOrParentTNode, setSelectedIndex} from '../state';
|
||||
import {enterView, getBindingsEnabled, getCheckNoChangesMode, getIsParent, getLView, getNamespace, getPreviousOrParentTNode, incrementActiveDirectiveId, isCreationMode, leaveView, resetComponentState, setActiveHostElement, setBindingRoot, setCheckNoChangesMode, setCurrentDirectiveDef, setCurrentQueryIndex, setIsParent, setPreviousOrParentTNode, setSelectedIndex, ΔnamespaceHTML} from '../state';
|
||||
import {initializeStaticContext as initializeStaticStylingContext} from '../styling/class_and_style_bindings';
|
||||
import {NO_CHANGE} from '../tokens';
|
||||
import {attrsStylingIndexOf} from '../util/attrs_utils';
|
||||
@ -36,6 +36,7 @@ import {getLViewParent, getRootContext} from '../util/view_traversal_utils';
|
||||
import {getComponentViewByIndex, getNativeByTNode, isComponentDef, isContentQueryHost, isRootView, readPatchedLView, resetPreOrderHookFlags, unwrapRNode, viewAttachedToChangeDetector} from '../util/view_utils';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A permanent marker promise which signifies that the current CD tree is
|
||||
* clean.
|
||||
@ -426,7 +427,7 @@ export function renderEmbeddedTemplate<T>(viewToRender: LView, tView: TView, con
|
||||
|
||||
oldView = enterView(viewToRender, viewToRender[T_HOST]);
|
||||
resetPreOrderHookFlags(viewToRender);
|
||||
namespaceHTML();
|
||||
ΔnamespaceHTML();
|
||||
|
||||
// Reset the selected index so we can assert that `select` was called later
|
||||
ngDevMode && setSelectedIndex(-1);
|
||||
@ -461,7 +462,7 @@ function renderComponentOrTemplate<T>(
|
||||
if (creationModeIsActive) {
|
||||
// creation mode pass
|
||||
if (templateFn) {
|
||||
namespaceHTML();
|
||||
ΔnamespaceHTML();
|
||||
|
||||
// Reset the selected index so we can assert that `select` was called later
|
||||
ngDevMode && setSelectedIndex(-1);
|
||||
@ -1510,7 +1511,7 @@ export function checkView<T>(hostView: LView, component: T) {
|
||||
|
||||
try {
|
||||
resetPreOrderHookFlags(hostView);
|
||||
namespaceHTML();
|
||||
ΔnamespaceHTML();
|
||||
creationMode && executeViewQueryFn(RenderFlags.Create, hostTView, component);
|
||||
|
||||
// Reset the selected index so we can assert that `select` was called later
|
||||
|
@ -30,13 +30,19 @@ export function store<T>(index: number, value: T): void {
|
||||
* with a nextContext() call, which walks up the tree and updates the contextViewData instance.
|
||||
*
|
||||
* @param index The index of the local ref in contextViewData.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function reference<T>(index: number) {
|
||||
export function Δreference<T>(index: number) {
|
||||
const contextLView = getContextLView();
|
||||
return loadInternal<T>(contextLView, index);
|
||||
}
|
||||
|
||||
/** Retrieves a value from current `viewData`. */
|
||||
export function load<T>(index: number): T {
|
||||
/**
|
||||
* Retrieves a value from current `viewData`.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Δload<T>(index: number): T {
|
||||
return loadInternal<T>(getLView(), index);
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ import {scheduleTick, setInputsForProperty} from './shared';
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function elementStyling(
|
||||
export function ΔelementStyling(
|
||||
classBindingNames?: string[] | null, styleBindingNames?: string[] | null,
|
||||
styleSanitizer?: StyleSanitizeFn | null): void {
|
||||
const tNode = getPreviousOrParentTNode();
|
||||
@ -106,7 +106,7 @@ export function elementStyling(
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function elementHostStyling(
|
||||
export function ΔelementHostStyling(
|
||||
classBindingNames?: string[] | null, styleBindingNames?: string[] | null,
|
||||
styleSanitizer?: StyleSanitizeFn | null): void {
|
||||
const tNode = getPreviousOrParentTNode();
|
||||
@ -166,7 +166,7 @@ function initElementStyling(
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function elementStyleProp(
|
||||
export function ΔelementStyleProp(
|
||||
index: number, styleIndex: number, value: string | number | String | PlayerFactory | null,
|
||||
suffix?: string | null, forceOverride?: boolean): void {
|
||||
const valueToAdd = resolveStylePropValue(value, suffix);
|
||||
@ -200,7 +200,7 @@ export function elementStyleProp(
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function elementHostStyleProp(
|
||||
export function ΔelementHostStyleProp(
|
||||
styleIndex: number, value: string | number | String | PlayerFactory | null,
|
||||
suffix?: string | null, forceOverride?: boolean): void {
|
||||
const directiveStylingIndex = getActiveDirectiveStylingIndex();
|
||||
@ -253,7 +253,7 @@ function resolveStylePropValue(
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function elementClassProp(
|
||||
export function ΔelementClassProp(
|
||||
index: number, classIndex: number, value: boolean | PlayerFactory,
|
||||
forceOverride?: boolean): void {
|
||||
const input = (value instanceof BoundPlayerFactory) ?
|
||||
@ -283,7 +283,7 @@ export function elementClassProp(
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function elementHostClassProp(
|
||||
export function ΔelementHostClassProp(
|
||||
classIndex: number, value: boolean | PlayerFactory, forceOverride?: boolean): void {
|
||||
const directiveStylingIndex = getActiveDirectiveStylingIndex();
|
||||
const hostElementIndex = getSelectedIndex();
|
||||
@ -326,7 +326,7 @@ function booleanOrNull(value: any): boolean|null {
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function elementStylingMap(
|
||||
export function ΔelementStylingMap(
|
||||
index: number, classes: {[key: string]: any} | string | NO_CHANGE | null,
|
||||
styles?: {[styleName: string]: any} | NO_CHANGE | null): void {
|
||||
const lView = getLView();
|
||||
@ -379,7 +379,7 @@ export function elementStylingMap(
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function elementHostStylingMap(
|
||||
export function ΔelementHostStylingMap(
|
||||
classes: {[key: string]: any} | string | NO_CHANGE | null,
|
||||
styles?: {[styleName: string]: any} | NO_CHANGE | null): void {
|
||||
const directiveStylingIndex = getActiveDirectiveStylingIndex();
|
||||
@ -405,7 +405,7 @@ export function elementHostStylingMap(
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function elementStylingApply(index: number): void {
|
||||
export function ΔelementStylingApply(index: number): void {
|
||||
elementStylingApplyInternal(DEFAULT_TEMPLATE_DIRECTIVE_INDEX, index);
|
||||
}
|
||||
|
||||
@ -419,7 +419,7 @@ export function elementStylingApply(index: number): void {
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function elementHostStylingApply(): void {
|
||||
export function ΔelementHostStylingApply(): void {
|
||||
elementStylingApplyInternal(getActiveDirectiveStylingIndex(), getSelectedIndex());
|
||||
}
|
||||
|
||||
@ -449,4 +449,4 @@ export function getActiveDirectiveStylingIndex() {
|
||||
// parent directive. To help the styling code distinguish between a parent
|
||||
// sub-classed directive the inheritance depth is taken into account as well.
|
||||
return getActiveDirectiveId() + getActiveDirectiveSuperClassDepth();
|
||||
}
|
||||
}
|
||||
|
@ -21,8 +21,10 @@ import {createNodeAtIndex} from './shared';
|
||||
*
|
||||
* @param index Index of the node in the data array
|
||||
* @param value Value to write. This value will be stringified.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function text(index: number, value?: any): void {
|
||||
export function Δtext(index: number, value?: any): void {
|
||||
const lView = getLView();
|
||||
ngDevMode && assertEqual(
|
||||
lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex,
|
||||
@ -42,8 +44,10 @@ export function text(index: number, value?: any): void {
|
||||
*
|
||||
* @param index Index of the node in the data array.
|
||||
* @param value Stringified value to write.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function textBinding<T>(index: number, value: T | NO_CHANGE): void {
|
||||
export function ΔtextBinding<T>(index: number, value: T | NO_CHANGE): void {
|
||||
if (value !== NO_CHANGE) {
|
||||
const lView = getLView();
|
||||
ngDevMode && assertDataInRange(lView, index + HEADER_OFFSET);
|
||||
|
Reference in New Issue
Block a user